Basically, I want to have links throughout the page that change the anchor -- the part of the URL after a # symbol. When that part of the URL changes, the JavaScript should respond.
I could add an onclick method to every link, but is there a better way?
That's not an anchor, it's the hash?
$(window).on('hashchange', function() {
alert('My fracking hash changed to : '+document.location.hash);
});
$(window).bind('hashchange', function() {
// code here
});
think that should do it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With