Html IFrame:此内容无法在框架中显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14141388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IFrame: This content cannot be displayed in a frame
提问by daveomcd
I have two internal sites. I'm trying to show one's content in the iframe of the other site. However I'm getting this message: "This content cannot be displayed in a frame." I've read the reason I'm getting this message but, I would like to bypass it since the sites are internal and I'm not concerned with someone trying to hiHyman my users. I couldn't find a way to bypass it after searching the internet, but feel like it should be possible because the rest of the message seems to hint at it.
我有两个内部网站。我试图在另一个网站的 iframe 中显示一个人的内容。但是我收到此消息:“此内容无法显示在框架中。” 我已阅读收到此消息的原因,但我想绕过它,因为这些站点是内部站点,而且我不担心有人试图劫持我的用户。在搜索互联网后,我找不到绕过它的方法,但感觉应该是可能的,因为消息的其余部分似乎暗示了这一点。
"To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame."
“为了帮助保护您输入到本网站的信息的安全性,此内容的发布者不允许将其显示在框架中。”
Since I'm the publisher how can I allow it to be displayed in the frame? Thanks!
既然我是发布者,我怎么能让它显示在框架中?谢谢!
采纳答案by Cinder
use <meta http-equiv="X-Frame-Options" content="allow">
in the one to show in the iframe to allow it.
用于<meta http-equiv="X-Frame-Options" content="allow">
在 iframe 中显示以允许它。
回答by Carl Bosch
The X-Frame-Options is defined in the Http Header and not in the <head>
section of the page you want to use in the iframe.
X-Frame-Options 在 Http Header 中定义,而不是在<head>
您要在 iframe 中使用的页面部分中定义。
Accepted values are: DENY, SAMEORIGIN and ALLOW-FROM "url"
可接受的值为:DENY、SAMEORIGIN 和 ALLOW-FROM "url"
回答by Hikmat Ullah Bettani
Use target="_top"
attribute in anchor tag that will really work.
target="_top"
在锚标记中使用真正有效的属性。