Make the bfcache in Internet Explorer work like Firefox

女生的网名这么多〃 提交于 2019-11-30 17:00:33

问题


I have kind of the opposite problem of the accepted answer to this question: Ajax, back button and DOM updates

There, most people wanted Firefox to fire "unload" event when coming Back to the page with the Back button.

We manipulate the divs that are shown/hidden (navigating a tree), and go off to another page. When you click "Back", Firefox uses its bfcache and shows the page as it was when you left (this is good). IE shows the page in its initial state (this is bad). We want IE to behave like firefox and use its bfcache, are there any tricks to make it do so?

(we are not using Jquery)


回答1:


I found a similar question:( Differences in Internet Explorer and Firefox when dynamically loading content then going forward and back ) The answer there is that you can trick IE's history mechanism into keeping the modified dom by using a lot of javascript to rewrite the document, or put the values you want to save into hidden input fields. Anything better?



来源:https://stackoverflow.com/questions/7825579/make-the-bfcache-in-internet-explorer-work-like-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!