html - 将 Facebook 加载到 iframe

标签 html iframe

我无法将 facebook 加载到 iframe 中,在如下网页中:

<html>
<head>
<!-- some stuffs here -->
</head>
<body>
<!-- some stuffs here -->
<iframe src="http://www.google.com" frameborder="0">
</iframe>
</body>
</html>

我已经在其他网站上对其进行了测试,它似乎可以毫无问题地加载,例如 wired.com,但 facebook.com...

谁能解释一下为什么?

如果需要,我会使用 Google Chrome 和 Safari。

Google 似乎阻止了其页面的 iframe 加载。

最佳答案

如果您使用 Firebug 或 Google Chrome 的开发者控制台,您会看到以下错误

Refused to display document because display forbidden by X-Frame-Options.


<强> 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.

这是另一个相关的 stackoverflow 问题 Overcoming “Display forbidden by X-Frame-Options”

关于html - 将 Facebook 加载到 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9680215/

相关文章:

jquery - 将 HTML 插入 iframe

javascript - 在 Firefox 中使用 javascript 设置 iframe 内容失败

javascript - 打开新标签页,同时下载 PDF

html - 从无 cookie 域提供静态内容

html - 在不使用表格单元格的情况下从带有超链接的图像中删除换行符

javascript - 如何找到选项卡并按名称在浏览器中刷新它

javascript - Jquery遍历iframe中的html元素

php - 禁用 iframe 的基本身份验证

tomcat - 有没有办法从 SSRS 报告管理器 URL 禁用 X-Frame 选项?

jquery - 如何在 li 标签内使用 jQuery 使 div 可点击