$(window).hashchange() doesn't work

ajax, javascript, jquery

Solution

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.

Problem

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 !

Original source