function userPageLock(){$("body").bind("ajaxComplete.lockpage", function(){$("body").unbind("ajaxComplete.lockpage");executePageLock();});};
function executePageLock(){//do something}
$('#container').on('click','span',function(eo){alert(1);
$(this).off(); //seams easy, but does not work
$('#container').off('click','span'); //clears click event for every span
$(this).on("click",function(){return false;}); //this works.
});
(function($){
$("#btn_add").on("click",function(){$("#btn_click").on("click",added_handler);alert("Added new handler to button 1");});
$("#btn_remove").on("click",function(){$("#btn_click").off("click",added_handler);alert("Removed new handler to button 1");});
function fixed_handler(){alert("Fixed handler");}
function added_handler(){alert("new handler");}
$("#btn_click").on("click",fixed_handler);$("#btn_fixed").on("click",fixed_handler);
})(jQuery);
var original, clone;// element with id my-div and its child nodes have some event-handlersoriginal = $('#my-div');clone = original.clone();//original.replaceWith(clone);