我有一个服务器上的一个HTML文件和不同服务器上的两个文件,如下禁用其他HTML页面的JavaScript和meta标签:通过使用Javascript
a.html - 服务器1
<html><head></head><body><iframe src="http://server2/b.html"></iframe></body></html>
b.html - 服务器2
<script type="text/javascript">/* <![CDATA[ */if (top == self || parent != top || document.location.hostname != document.domain) { top.location.replace("c.html");}/* ]]> */</script>
<!DOCTYPE html><html lang="en" id="myworld" class="no_js">
<head><meta charset="utf-8" />
<script type="text/javascript">/* <![CDATA[ */if (top == self || parent != top || document.location.hostname != document.domain) { top.location.replace("c.html");}/* ]]> */</script><noscript> <meta http-equiv="refresh" content="0; URL=b.html?st=1" /> </noscript>
</head><body>text is here</body></html>
c.html - 服务器2
<html><head></head><body>Please visit later.</body></html>
当我打开http://server1/a.html
,因为它使用JavaScript和meta标签的主机是否不同重定向我重定向到http://website2/c.html
。
我想要做的是:我不想让b.html
运行它的JavaScript来重定向并将元标记刷新为c.html
。
代码a.html
如何在我的iframe中渲染b.html
?所以它应该禁用b.html
的JavaScript和元标记。
这个问题可能会帮助你:[框架巴斯特巴斯特...巴斯特代码需要](http://stackoverflow.com/questions/958997/frame-buster-buster-buster-code-需要) – alexmuller
有趣的黑客那里,但:我真的不确定我们应该建议人们如何禁用禁用帧的代码。即使将道德问题放在一边,如果框架破解代码得到更新,他们的网站也会突然中断。 – minimalis