Hi,
I'm trying to use the browser back button, i understood how to catch the event with hashchange plugin =>
$(window).hashchange( function(){
alert( location.hash );
});$(window).hashchange();
When i try to load the new page, nothing happens.. Is there a way to "reload" the page with the new url ?
Thanks !
Try this instead:
$(window).on('hashchange', function(){
// Your code goes here
}).trigger('hashchange'); // bind event to the same selector as event-listener
.trigger()
basicly activates events manually.
EDIT:
This should be enough for you to work.
Try this piece of code and see if you got any luck.
Included javascript.js is compressed with jquery and hashchange.
Put $(window).bind('hashchange', function() {});
outside of the document.ready
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