Whenever a UI action causes an attribute of a model to change, the model triggers a "change" event; all the Views that display the model's state can be notified of the change, so that they are able to respond accordingly, re-rendering themselves with the new information.
In a finished Backbone app, you don't have to write the glue code that looks into the DOM to find an element with a specific id, and update the HTML manually — when the model changes, the views simply update themselves.
Philosophically, Backbone is an attempt to discover the minimal set of data-structuring (models and collections) and user interface (views and URLs) primitives that are generally useful when building web applications with Java Script.
If you're new here, and aren't yet quite sure what Backbone is for, start by browsing the list of Backbone-based projects.
Many of the code examples in this documentation are runnable, because Backbone is included on this page. The single most important thing that Backbone can help you with is keeping your business logic separate from your user interface.
When the two are entangled, change is hard; when logic doesn't depend on UI, your interface becomes easier to work with. Models handle syncing data with a persistence layer — usually a REST API with a backing database.
gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
The project is hosted on Git Hub, and the annotated source code is available, as well as an online test suite, an example application, a list of tutorials and a long list of real-world projects that use Backbone.
Backbone is available for use under the MIT software license.
You can report bugs and discuss features on the Git Hub issues page, on Freenode IRC in the = 1.11.0), and json2for older Internet Explorer support.
(Mimics of the Underscore and j Query APIs, such as Lodash and Zepto, will also tend to work, with varying degrees of compatibility.) When working on a web application that involves a lot of Java Script, one of the first things you learn is to stop tying your data to the DOM.
It's all too easy to create Java Script applications that end up as tangled piles of j Query selectors and callbacks, all trying frantically to keep data in sync between the HTML UI, your Java Script logic, and the database on your server.