据骨干JS的网站:
骨干网的唯一困难的依赖是Underscore.js(> 1.3.1)。 对于通过Backbone.Router和DOM操作与Backbone.View RESTful的持久性,历史的支持,包括json2.js,和任一的jQuery(1.4.2)或的Zepto。
我用代码测试下面,除去jQuery和骨干视图引发错误。
<html>
<head>
<title>asda</title>
<!--<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>-->
<script src="http://documentcloud.github.com/underscore/underscore.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone.js"></script>
<script type="text/javascript" charset="utf-8" async defer>
SearchView = Backbone.View.extend({
initialize: function(){
alert("Alerts suck.");
}
});
// The initialize function is always called when instantiating a Backbone View.
// Consider it the constructor of the class.
var search_view = new SearchView;
</script>
</head>
<body>
</body>
</html>
Backbone.View和Backbone.Router如何工作,而jQuery的?