iframe - IE6 _top 域之间 iframe 内的链接

标签 iframe cross-browser internet-explorer-6

我有一个包含 iframe 的域,其中包含来自另一个域的内容。该 iframe 内有 _top 链接。在 IE6 上,当您单击它们时什么也不会发生。我准备了一个最小的例子。请前往http://www.bemmu.com/static/top.html用IE6试试。

编辑:这似乎只有在安全级别为“高”(或者可能是自定义)时才会发生,这是我的 IE 全新安装时的默认设置

来源http://www.bemmu.com/static/top.html :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
    <body>
        <iframe src="http://bemmu4.appspot.com/static/iframe.html"/>
    </body>
</html>

来源http://bemmu4.appspot.com/static/iframe.html :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>
    <body>
        <a href="http://www.google.com" target="_top">Let's go to Google!</a>
    </body>
</html>

有没有办法让这些 _top 链接发挥作用?

最佳答案

我的机器上没有安装 ie6,但我想你可以在 iframe 中尝试一些小技巧,在你的 anchor 标记中设置一个 onclick 属性 window.top.location.href='http:///www.google.com';。有效果吗?

关于iframe - IE6 _top 域之间 iframe 内的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1731581/

相关文章:

iframe - 跨域资源共享 header 可以授权X域IFRAME访问吗?

javascript - 无论加载什么页面都自动调整 iframe 的大小

java - 没有 cookie 的 Spring Security session

javascript - 如何使 CSS 属性动画在 Safari 中像在 Google Chrome 中一样工作?

javascript - for...of - JavaScript 关键字 Internet Explorer 解决方法

css - 有没有办法在 *.css 文件中执行特定于浏览器的条件 CSS?

javascript - iFrame src 不是 javascript :false but same effect

Javascript 图像调整大小

html - 64 位 Windows 7 上的 IE6

iframe - ckeditor不读取媒体嵌入代码