Book Image

Backbone.js Essentials

By : Jeremy Walker
Book Image

Backbone.js Essentials

By: Jeremy Walker

Overview of this book

<p>This book offers insight into creating and maintaining dynamic Backbone.js web applications. It delves into the the fundamentals of Backbone.js and helps you achieve mastery of the Backbone library.</p> <p>Starting with Models and Collections, you'll learn how to simplify client-side data management and easily transmit data to and from your server. Next, you'll learn to use Views and Routers to facilitate DOM manipulation and URL control so that your visitors can navigate your entire site without ever leaving the first HTML page. Finally, you'll learn how to combine those building blocks with other tools to achieve high-performance, testable, and maintainable web applications.</p>
Table of Contents (20 chapters)
Backbone.js Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Differences between routes and pages


Routes and pages are very similar concepts and are often used interchangeably by Backbone programmers. This is natural since routes are essentially just the Backbone implementation of pages. However, there are important differences between the two, at least when you compare the pages of a multi-page website to the routes of a Backbone single-page application.

In traditional, multi-page websites, each new page that the user visits requires you to make a new request to the site's server. In a Backbone-powered site, however, the user can navigate through as many pages (routes) as they want, making new requests only when it is necessary to fetch new data. This feature alone accounts for a significant increase in speed on a Backbone-powered site.

Another important difference is that standard web pages trigger an entire page load, whereas routes trigger only a specific JavaScript function. This means that unlike a traditional application, which has to limit the...