gpt4 book ai didi

javascript - History.js onstatechange 在 IE7 中不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:36:21 27 4
gpt4 key购买 nike

我集成了 History.js,这段代码在 URL 更改时运行:

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

它在除 IE7(IE8 的兼容模式)之外的所有浏览器中都运行良好。我认为 History.js 会处理这个。

IE7真的不理解onStateChange事件吗?这种情况可以使用什么窗口事件?

最佳答案

从兼容性说明中可以看出:

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/

关于javascript - History.js onstatechange 在 IE7 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8054029/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com