gpt4 book ai didi

javascript - 页面加载时的 HTML5 onpopstate

转载 作者:太空狗 更新时间:2023-10-29 13:06:33 24 4
gpt4 key购买 nike

我正在使用新的 HTML5 onpopstate 事件。使用 Firefox 4,window.onpopstate 事件在页面加载时触发,而在 Webkit 中,情况似乎并非如此。

哪个是正确的行为?

最佳答案

The popstate event is fired in certain cases when navigating to a session history entry.

http://www.whatwg.org/specs/web-apps/current-work/#event-popstate

根据我的理解,虽然我可能是错的,但加载页面确实意味着历史记录被创建并遍历到,是的,它应该在页面加载时触发。

另见,

http://www.mail-archive.com/whatwg@lists.whatwg.org/msg19722.html

和,

https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history

关于javascript - 页面加载时的 HTML5 onpopstate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3700440/

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