Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我 unbind() jQuery 中的处理程序,当我“重新绑定”时它仍然会执行最初绑定时的操作吗?
当您取消绑定特定处理程序时,它会删除绑定到它的所有处理程序代码。
$('#elem').unbind('click') 移除元素的点击事件 $('#elem').unbind() 移除所有附加到它的事件..
当您重新绑定时,是的,只要您调用相同的函数,它就会提供相同的功能。如果将它绑定到不同的函数,那么显然它会给出不同的输出。