Backbone.js Router

The client request is sent by an HTTP client using a router. The main purpose of a router is to route client-side applications. The router uses the URL to connect the client-side applications to actions and events. Thus routing can be simply understood as a URL representation of an application’ objects. To specify an application’ state which needs to be sent to the user, a URL is used. It also offers the feature of manual change of the URL by the user. For important locations in the app, web applications may provide linkable, bookmarkable, and shareable URL and this is when a router is needed because of its mechanism of copying the URLs to reach the view. There are a list of the methods mentioned below that can be used to modify or manipulate the Backbone.js Router.

 

METHOD USES
execute To be used when a route matches its corresponding callback.
extend To extend the backbone’s router class.
initialize To create a new constructor for the router installation.
navigate To update the URL in the applications.
route To create a route for the router.
routes To define the URL representation of application’s objects.

 

Please follow and like us:
Content Protection by DMCA.com