我的框架正在重定向页面!如何阻止它? [英] My frame is redirecting page !! How to stop it?

查看:22
本文介绍了我的框架正在重定向页面!如何阻止它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
如何防止 IFRAME 重定向顶级窗口

<iframe width="980px" frameborder="0" marginheight="0" marginwidth="0" height="1500px" src="http://www.torrentz.com/search?q=<?php echo $_GET['search'] ?>"></iframe>

我有一个这样的框架.现在当我在我的页面中运行 tun 时..它开始将我重定向到torrentz.com"..

知道如何阻止它吗?

解决方案

它正在做一些称为framebusting"的事情.

虽然您可以阻止这种情况发生,但您确实不应该这样做.如果一个网站有框架破坏代码,他们不希望他们的网站在框架中.所以你应该尊重它,不要嵌入它.

<块引用><块引用>

相关: 如何阻止 iframe 重定向顶级窗口阻止 iframe 从设置 parent.location, 如何阻止子 Iframe 重定向

Possible Duplicate:
How to prevent IFRAME from redirecting top-level window

<iframe width="980px" frameborder="0" marginheight="0" marginwidth="0" height="1500px" src="http://www.torrentz.com/search?q=<?php echo $_GET['search'] ?>" ></iframe>

I have a frame like this.Now when i run tun this in my page..its startes redirecting my to "torrentz.com"..

Have any idea how to stop it ?

解决方案

It's doing something known as "framebusting."

While you can stop that from happening, you really shouldn't do it. If a website has framebusting code, they don't want their site to be in frames. So you should respect that and don't embed it.

Related: How to prevent iframe from redirecting top-level window, Block iframe from setting parent.location, How can I stop child Iframes from redirecting

这篇关于我的框架正在重定向页面!如何阻止它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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