使Internet Explorer中的bfcache与Firefox一样工作 [英] Make the bfcache in Internet Explorer work like Firefox

查看:181
本文介绍了使Internet Explorer中的bfcache与Firefox一样工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相反的问题,接受这个问题的答案:
Ajax,返回按钮和DOM更新

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

在那里,大多数人希望Firefox在返回到返回页面时启动卸载事件

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

我们操纵显示/隐藏的div(导航树),并转到另一个页面。当您点击返回时,Firefox会使用其bfcache并显示该页面,就像您离开时一样(这样很好)。 IE显示页面处于初始状态(这是坏的)。
我们希望IE的行为像firefox,并使用它的bfcache,有没有办法让它这样做?

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?

(我们不使用Jquery) p>

(we are not using Jquery)

推荐答案

我发现了类似的问题:( 当动态加载内容然后前进和后退时,Internet Explorer和Firefox中的区别)答案是可以欺骗IE的历史机制通过使用大量的javascript来重写文档来保持修改的dom,或者将要保存的值放入隐藏的输入字段。有什么更好吗?

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?

这篇关于使Internet Explorer中的bfcache与Firefox一样工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆