I would like to trigger some Javascript function when window.location.href
link changes. Is it possible?
Something like this:
$(window.location.href).on('change', function(){
doSomething();
});
You said 'something like', given the example code you're probably looking for the onbeforeunload
event handler.
From the Mozilla docs:
window.onbeforeunload = function(e) {
return 'Dialog text here.';
};
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments