JQuery

When JQuery binded or lived events are triggered multiple times

For a code piece like this:

var clicked = function(){
alert('clicked')
}
$(".click").live("click",clicked);

The "clicked" function could be triggered multiple times in certain circumstance, on which I haven't research further yet.
But one solution to this is to remove the binded event before binding/live it, sth like:

$(".click").die("click").live("click",clicked);

or

$(".click").unbind("click").bind("click",clicked);

English
Subscribe to RSS - JQuery