jQuery - Resurrect 7/21/2010 All jQuery posts
I ran into a problem when using a wizard type ajax interface where the live() jQuery events would become bound, bound, and then rebound, as you navigated back and forth through the wizard. To ensure that any live events would be properly set you need to call the die() method first and then rebind.
$("#myClickableThing").die("click").live("click", function () {
// do work
});
And to add it as a new jQuery function you can try this:
jQuery.fn.resurrect = function (eventType, callback) {
$(this).die(eventType).live(eventType, callback);
};
Now you can call resurrect like this:
$("#myClickableThing").resurrect("click", function() {
// do work
});