Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Rails style routing for jQuery.
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time


jQuery Routes

Download: Development | Production (6KB)
See Also: jQuery View

Rails style routing for jQuery. Enables back button support, deep linking and allows methods to be called by normal links in your application without adding an event handler. Methods that have been specified in your routes will automatically set the URL of the page when called.

  "/": "PageView#home",
  "/article/:id": "ArticlesView#article",
  "/about/(:page_name)": function(params){}

Clicking: <a href="#/article/5"></a>
Will call: ArticlesView.instance().article({id:5})

Calling: ArticlesView.instance().article({id:6})
Will set URL: "#/article/6"

jQuery Routes depends on the jQuery Address plugin which is included in the production build.

Alternatively, you can use jQuery Routes to emulate the hashchange event

  //do stuff

To unregister the handler above:

Something went wrong with that request. Please try again.