我有一个包含 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/