From the course: Learning Backbone.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configuring routes

Configuring routes - Backbone.js Tutorial

From the course: Learning Backbone.js

Start my 1-month free trial

Configuring routes

Routers allow us to create a navigation structure in our Backbone web app. With routers, we can create links to pretty much anything we want. We're not going to cover every single route concept, but in this video we'll cover more than enough to get you started doing some very powerful things. Routes are built using the same key/value pair syntax we use to create events. The key in this case will be the actual route link. And it's best to think of it as an actual URL. An actual web page address that's accessible from a web browser. The value will be the custom method we want to invoke when someone navigates to the route link or URL. Now, there's a really important point you need to understand about Backbone routes. The common use of routes is to execute a method that's wrapped in the value when the value's respective route link gets loaded into a web browser. Thanks to recent browser technologies, like the history API, routes and their methods are accessible from a web browser's Back…

Contents