Firefox后退按钮与iframes [英] Firefox back button vs iframes

查看:135
本文介绍了Firefox后退按钮与iframes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Firefox中,如果iframe的window.location发生改变,这将被填充到顶层窗口的历史记录中。



如果用户现在单击浏览器后退按钮,iframe的内容将改变,而不是浏览器回到以前的HTML页面。



这对某些体系结构是完全错误的。 b
$ b

有没有什么方法可以防止Firefox(3.x)这样做?

(请坚持这个问题,而不是为什么/何时/如何iframes与其他技术应该使用。)解决方案

使用。location.replace


In Firefox if the window.location of an iframe is changed, this gets populated to the history of the top level window.

If the user now clicks the browser back button, the contents of the iframe will change rather than the browser going back to the previous HTML page.

This is totally wrong for some architectures.

Is there any way with JavaScript to prevent Firefox (3.x) from doing this?

(Please stick to just this question, not why/when/how iframes versus other techniques should be used.)

解决方案

Use .location.replace

这篇关于Firefox后退按钮与iframes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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