gpt4 book ai didi

ajax - 使 Internet Explorer 中的 bfcache 像 Firefox 一样工作

转载 作者:行者123 更新时间:2023-12-04 15:26:05 26 4
gpt4 key购买 nike

我对这个问题的公认答案有一些相反的问题:
Ajax, back button and DOM updates

在那里,大多数人希望 Firefox 在使用后退按钮返回页面时触发“卸载”事件。

我们操作显示/隐藏的 div(导航树),然后转到另一个页面。当您单击“返回”时,Firefox 使用其 bfcache 并显示您离开时的页面(这很好)。 IE 显示页面的初始状态(这很糟糕)。
我们希望 IE 表现得像 firefox 并使用它的 bfcache,有什么技巧可以让它这样做吗?

(我们没有使用 Jquery)

最佳答案

我发现了一个类似的问题:( Differences in Internet Explorer and Firefox when dynamically loading content then going forward and back ) 答案是你可以通过使用大量javascript重写文档来欺骗IE的历史记录机制来保留修改后的dom,或者将你想要保存的值放入隐藏的输入字段.有什么更好的吗?

关于ajax - 使 Internet Explorer 中的 bfcache 像 Firefox 一样工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7825579/

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