$(\"#archive\").click(function(event){
/*do something*/
});
$(\'#archive2\').unbind(\'click\',event);
i have this click function that I unbind
You have to keep a reference to the function (instead of passing an anonymous function):
function handler() {
// do something
}
$("#archive").click(handler); // bind the first time
$("#archive").unbind('click', handler); // unbind
$("#archive").click(handler); // bind again
Not sure what is event
in your case, but if it is the event
object passed to the event handler then it does not make sense to pass it to unbind
and bind
.