阻止在iframe上打开页面? [英] prevent page opening on an iframe?

查看:90
本文介绍了阻止在iframe上打开页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用PHP阻止iframe上的页面打开?像iframe里面的Gmail一样?

How can I prevent page opening on an iframe using PHP? Like Gmail inside an iframe?

推荐答案

对于PHP,你可以使用。

For PHP, you can use.

header("X-FRAME-OPTIONS: DENY");

仅在现代浏览器,IE8 +,Firefox 3.6.9,Safari 4和Chrome中支持。对于旧版浏览器,您还需要一些JavaScript。

This is only supported in modern browsers, IE8+, Firefox 3.6.9, Safari 4 and Chrome. For older browser, you would also require some JavaScript.

这篇关于阻止在iframe上打开页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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