https://jsfiddle.net/2j0bw7yy/
If you look at the jsfiddle link above you can see a very basic Backbone app.
Everything works except this line:
events: {
"click button": "updatePoints"
},
updatePoints: function() {
alert("aaa");
return this;
},
When I click the button, the updatePoints function is not called. Nothing happens.
The error message in the console is quite cryptic:
Uncaught TypeError: undefined is not a function
You are using jQuery 1.6.x. Backbone requires at least 1.7.x.
In the backbone code, this was failing since 1.6.x does not have .off
undelegateEvents: function() {
this.$el.off('.delegateEvents' + this.cid);
return this;
},
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.