我的代碼觸發事件:
$("div.condition.editmode").trigger('removeEdit');
我的HTML:
<div class="condition editmode"></div>
控制檯錯誤:
Uncaught TypeError: Object [object Object] has no method 'apply' jquery-1.9.1.min.js
b.event.dispatch jquery-1.9.1.min.js
b.event.add.v.handle jquery-1.9.1.min.js
b.event.trigger jquery-1.9.1.min.js
(anonymous function) jquery-1.9.1.min.js
b.extend.each jquery-1.9.1.min.js
b.fn.b.each jquery-1.9.1.min.js
b.fn.extend.trigger
那麼什麼是聽事件* removeEdit *?這可能是你需要看的地方。沒有看到該代碼,這可能無法回答。 – epascarello
你有一個自定義事件'removeEdit'? –
我正在用Backbone.js視圖監聽事件: 'this。$ el.on('removeEdit',this.toggleEdit,this);' – JonathanWill