Backbone官网: http://backbonejs.org
Github地址:https://github.com/jashkenas/backbone/
Backbone's only hard dependency is Underscore.js ( >= 1.5.0). For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include json2.js, and either jQuery ( >= 1.7.0) or Zepto.
即:Backbone严重依赖于underscore.js,且underscore.js的版本不能低于1.5.0。
对于其他的特性,eg:history Router Dom View等依赖于json2.js 和 jquery或者Zepto,如果使用jquery,要使用的版本不能低于1.7.0.
1.0 版本的Backbone比其他版本,有一些改动,尤其是:
Model validation is now only enforced by default in save — not in set unless the{validate:true} option is passed. Model validation now fires an "invalid" event instead of "error".
Model使用set方法时并不一定会进行validate了,只有在save中会强制执行validate。如果想在set中进行校验,可以在set中传入第二个参数:{validate:true}