CodesJava

Easy learning with example program codes

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.

 

METHODUSES
executeTo be used when a route matches its corresponding callback.
extendTo extend the backbone’s router class.
initializeTo create a new constructor for the router installation.
navigateTo update the URL in the applications.
routeTo create a route for the router.
routesTo define the URL representation of application’s objects.

 

Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki