Reputation: 1007
Is there a way I can trigger an event whenever I alter window.location.href using jQuery?
I am using onbeforeunload but that triggers only if it is a navigation to a new url. For me the event need to be triggered even if I am altering the location.href by appending "&key" to it.
Upvotes: 2
Views: 112
Reputation: 2068
window.location.watch
you can use above for your need
for further reading https://www.bennadel.com/blog/1520-binding-events-to-non-dom-objects-with-jquery.htm
Upvotes: 2