如何将 preventDefault() 添加到<button>
事件中?我下面的东西不起作用..谢谢
var View = Backbone.View.extend({
initialize: function () {
//console.log('initializing ' + this.options.blankOption);
this.template = $('#list-template').children();
},
el: '#container',
events: {
'click button' : 'render'
},
render: function(){
this.events.preventDefault(); // not working ????
var data = this.model.get('data');
$.each(data,function (i,v) {
console.log(data.text + " " + data.href);
});
}
});