When JQuery binded or lived events are triggered multiple times

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

The “clicked” function could be triggered multiple times in certain circumstance.
But one solution to this is to remove the binded event before binding/live it, sth like:

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

Advertisements