我在寻找解决办法
$.bind
和
$.unbind
在动态添加的元素中无问题地工作。
AS
on()
使用附加事件的技巧,以便在我遇到的事件上创建一个假的解除绑定:
const sendAction = function(e){ ... }
// bind the click
$('body').on('click', 'button.send', sendAction );
// unbind the click
$('body').on('click', 'button.send', function(){} );