我在控制台中收到错误消息“对象 [对象对象] 没有方法“应用”。请看小提琴.. http://jsfiddle.net/vineet85/AQx63/6/
var RefreshingView = new Backbone.View.extend({
initialize: function() {
this.model.on('change', this.render, this);
},
render: function() {
this.$el.html(this.model.get('text'));
}
});
var m = new Backbone.Model({text: new Date().toString()});
var myView = new RefreshingView({model: m, el: 'body'});
myView.render();
setInterVal(function() {
m.set({text: new Date().toString()});
}, 1000);