Using a Backbone.js View, say I want to include the following events:
events: {
\'click a\': \'link\',
\'click\': \'openPanel\'
}
The JQuery preventDefault
method would also be a good option.
window.LocationViewLI = Backbone.View.extend({
tagName: "li",
template: _.template('<%= name %>'),
events: {
"click a": "handleClick"
},
handleClick: function(event) {
event.preventDefault();
console.log("LocationViewLI handleClick", this.model.escape("name") );
// debugger;
},
...