我在使用 JQuery 解除绑定(bind)事件时遇到问题。
$(document).ready(function() {
$('#tdMinPriceOnNonStop0').unbind("click");
});
它不工作..
<td class="tddat matrixCellHt" align="center" onclick='javascript:DoHighlighting("tdMinPriceOnNonStop",<%#Container.ItemIndex%>);FilterResults("SingleAirlineParticularStop","0&<%#((string)DataBinder.Eval(Container.DataItem, "AirlineDisplayName"))%>")' id="tdMinPriceOnNonStop<%# Container.ItemIndex %>"
最佳答案
这不是强制性的,但您应该提供您想要取消绑定(bind)的处理程序:
function doStuff(){
//doing stuff
}
$('#tdMinPriceOnNonStop0').bind("click",doStuff);
//then
$('#tdMinPriceOnNonStop0').unbind("click",doStuff);
关于javascript - 使用 JQuery 取消绑定(bind)事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8923460/