我正在使用Backbone.LocalStorage
:http: //jsfiddle.net/jiewmeng/grhz9/3/
$(function() {
console.log(Backbone.LocalStorage); // undefined!!
var Todo = Backbone.Model.extend({});
var Todos = Backbone.Collection.extend({
model: Todo,
localStorage: new Backbone.LocalStorage("todos")
});
});
第一个console.log()
给undefined
. localStorage: ...
然后线路出现错误
未捕获的类型错误:未定义不是函数
预期自是Backbone.LocalStorage
但undefined
为什么呢?