History.js onstatechange in IE7 does not work

919 Views Asked by At

I integrated History.js and this piece of code runs on URL change:

History.Adapter.bind(window,'statechange',function(){ 
    var State = History.getState();
    alert(State.url)
    showPage(State.url);
});

It works well in all browsers except IE7 (compatibility mode of IE8). I thought History.js would handle this.

Is it true that IE7 does not understand onStateChange event? What window event can be used for this case?

1

There are 1 best solutions below

1
On

From the notes on compatibility it states:

MSIE 6 and 7 sometimes do not apply a hash even it was told to (requiring a second call to the apply function)

https://github.com/browserstate/History.js/