How to make 1st function back_a with popstate inside remove after click,
then I can run antoner?
function back_a(){
$(window).bind('popstate', function(e){
//do some thing
});
}
back_a();
function back_b(){
$(window).bind('popstate', function(e){
//do different thing
});
}
$('btn').click(funcion(){
// how to cancel back_a();
//run back_b();
back_b();
});
Events in jquery can be namespaced:
You can remove just that particular event later by doing:
Edit
Try something like this: