Backbone.js 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 GitHub,
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
GitHub issues page,
on Freenode IRC in the #documentcloud channel, post questions to the
Google Group,
add pages to the wiki
or send tweets to @documentcloud.


Backbone is an open-source component of
DocumentCloud.

Downloads & Dependencies
(Right-click, and use "Save As")

Development Version (0.9.2) 52kb, Full source, lots of comments
Production Version (0.9.2) 5.6kb, Packed and gzipped

Backbone's only hard dependency is
Underscore.js ( > 1.3.1).
For RESTful persistence, history support via Backbone.Router
and DOM manipulation with Backbone.View, include
json2.js, and either
jQuery ( > 1.4.2) or
Zepto.

Introduction

When working on a web application that involves a lot of JavaScript, one
of the first things you learn is to stop tying your data to the DOM. It's all
too easy to create JavaScript applications that end up as tangled piles of
jQuery selectors and callbacks, all trying frantically to keep data in
sync between the HTML UI, your JavaScript logic, and the database on your
server. For rich client-side applications, a more structured approach
is often helpful.

With Backbone, you represent your data as
Models, which can be created, validated, destroyed,
and saved to the server. 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.

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 examples that follow are runnable. Click the play button
to execute them.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。