【问题标题】:how to open google links inside iframe?如何在 iframe 中打开谷歌链接?
【发布时间】:2011-10-17 22:30:36
【问题描述】:

我正在尝试在 iframe 中打开谷歌搜索。直到最近它还在工作,但发生了一些事情。

这可以在这里测试:http://jsfiddle.net/patrioticcow/xTjyX/

我还在链接末尾添加了&output=embed,但它看起来没有帮助。

在 chrome 中我得到:Refused to display document because display forbidden by X-Frame-Options. 但它在 Mozilla 中也不起作用。

有什么想法吗?

谢谢

【问题讨论】:

标签: php iframe


【解决方案1】:

X-Frame 选项是您尝试嵌入 iframe 的页面的网络服务器发送的标头。它基本上告诉浏览器不允许将页面嵌入到 iframe 中。请查看https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header 以获得更详细的说明。

显然,Google 不希望您将其搜索结果嵌入 iframe。

【讨论】:

    【解决方案2】:

    我们看到了同样的问题 - 这次是在标准框架中使用 google。几个月前还好,现在不行了。我认为 Google 只是改变了规则……不是是一件非常开放的事情。

    我建议您将 iframe 中的内容作为单独的子窗口或新选项卡运行 - 不确定这是否会给您想要的结果。

    【讨论】:

      猜你喜欢
      • 2015-04-23
      • 1970-01-01
      • 2012-08-15
      • 2022-09-23
      • 2013-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多