VOOZH about

URL: https://www.geeksforgeeks.org/javascript/backbone-js-history/

⇱ Backbone.js History - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Backbone.js History

Last Updated : 23 Jul, 2025

Backbone.js is a compact library used to organize JavaScript code. An MVC/MV* framework is another term for it. If MVC is unfamiliar to you, it is just a technique for designing user interfaces. The creation of a program's user interface is made considerably easier by JavaScript functions. BackboneJS provides a variety of building elements to aid developers in creating client-side web applications, including models, views, events, routers, and collections.

Backbone's History is a global router that keeps track of the past and enables routing in the application. We must create the router class and call Backbone.history in order to instantiate a route and begin monitoring the navigation history. Start allowing the backbone to manage history and begin listening to routes.

Syntax:

Backbone.history.start(options)

Parameters:

  • options: This includes parameters like hasChange or pushChange to use with history.

Example 1: The code demonstrates how when you navigate to routes and the URL gets updated and you can bookmark it.

Output:


Example 2: The code demonstrates how you can add routes to navigate to different views, you can observe how the URL gets updated and you can bookmark it.

Comment
Article Tags: