History.js onstatechange in IE7 not working

I have included History.js and this piece of code works when changing the URL:

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

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

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

+4
source share
1 answer

From the compatibility notes, it states:

MSIE 6 and 7 sometimes don’t use a hash, even if they say it (requires a second call to the apply function)

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

+1
source

Source: https://habr.com/ru/post/1380235/


All Articles