将Facebook加载到iframe中 [英] Load Facebook into an iframe
问题描述
我无法将facebook加载到iframe中,如下面的网页中:
< html>
< head>
<! - 这里有些东西 - >
< / head>
< body>
<! - 这里有些东西 - >
< iframe src =http://www.google.comframeborder =0>
< / iframe>
< / body>
< / html>
我已经在其他网站上测试过它,并且它似乎没有问题地加载,例如 wired.com
,但不适用于 facebook.com
...
任何人都可以解释为什么?
如果需要,我使用Google Chrome浏览器和Safari。
似乎Google会阻止iframe加载其页面。如果您使用Firebug或Google Chrome的开发者控制台,则可以看到下面的错误:
拒绝显示文档,因为X-Frame-Options禁止显示。
DENY
无论站点尝试这样做,页面都无法显示在框架中。
SAMEORIGIN
页面只能以与页面本身相同的起源框架显示。
这是另一个相关的stackoverflow问题
克服X-Frame-Options禁止显示
I can't load facebook into an iframe, in a web page like the following one:
<html>
<head>
<!-- some stuffs here -->
</head>
<body>
<!-- some stuffs here -->
<iframe src="http://www.google.com" frameborder="0">
</iframe>
</body>
</html>
I've tested it with other websites and it seems to load without problems for instance for wired.com
, but not for facebook.com
...
Can anyone explain me why?
I'm using Google Chrome and Safari, if needed.
It seems to be as if Google blocks iframe loading of its page.
If you use Firebug or Google Chrome's developer console, you can see the following error
Refused to display document because display forbidden by X-Frame-Options.
DENY
The page cannot be displayed in a frame, regardless of the site attempting to do so.SAMEORIGIN
The page can only be displayed in a frame on the same origin as the page itself.
Here is another related stackoverflow question Overcoming "Display forbidden by X-Frame-Options"
这篇关于将Facebook加载到iframe中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!