Results (
Thai) 2:
[Copy]Copied!
What is a router?
Backbone routers are used for routing your applications URL's when using hash tags(#). In the traditional MVC sense they don't necessarily fit the semantics and if you have read "What is a view?" it will elaborate on this point. Though a Backbone "router" is still very useful for any application/feature that needs URL routing/history capabilities.
Defined routers should always contain at least one route and a function to map the particular route to. In the example below we are going to define a route that is always called.
Also note that routes interpret anything after "#" tag in the URL. All links in your application should target "#/action" or "#action". (Appending a forward slash after the hashtag looks a bit nicer e.g. http://example.com/#/user/help)
Being translated, please wait..
