devmingle
Home
Categories
Popular Codes
Articles
/
Javascript
/
Backbone
/
Backbone js event listener
Backbone js event listener
Event listener javascript
const element = document.querySelector(".class__name"); element.addEventListener("click", () => { console.log("clicked element"); });
39
Backbone js event listener
var ViewName = Backbone.View.extend({ initialize: function(){ this.$el.on("eventName", this.functionName, this) }, functionName: function(){ //whatever }, remove: function() { this.$el.off("eventName", this.functionName); Backbone.View.prototype.remove.apply(this, arguments); } });
0
Source:
stackoverflow.com
Share
Similar codes
0 vote
183 views
1 answer
Backbone model save without validation
Javascript
Backbone
1 vote
192 views
2 answers
Backbone js
Javascript
Backbone
Share