Reputation: 83755
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
Upvotes: 0
Views: 88
Reputation: 191056
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;
},
https://jsfiddle.net/2j0bw7yy/1/
Upvotes: 1