I was disabling a hiperlink using this function, but i don’t really understand what really the function does, my doubt is the next one, i have this function:
function bindPrevent(e)
{
e.preventDefault();
return false;
}
and when the user clicks the link i do this:
function disableButton(f)
{
if(f)
{
$('.btnOk[id!="link_lkDelete"]').each(function(){
$(this).bind("click",bindPrevent);
});
}
else
{
$('.btnOk[id!="link_lkDelete"]').each(function(){
$(this).unbind("click",bindPrevent);
});
}
}
The question is, if the link has another click handler, and i bind a new one, then which handler is called??, JQ use something like a handler stack and executes the top one handler??
Like others have stated, both handlers will be called. Here’s a fiddle illustrating it.