简体   繁体   中英

History.js onstatechange in IE7 does not work

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?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM