无法在iframe代码中显示一些网站 [英] Can't show some websites in iframe tag
本文介绍了无法在iframe代码中显示一些网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图开发一个网页,我可以一次显示3个以上的网站,
如下:
< UL>
< li>
< iframe src =http://www.facebook.com//>< p> iframe不受支持< / p>
< / li>
< li>
< iframe src =http://www.yahoo.com/>< / iframe>
< / li>
< li>
< iframe src =http://www.google.co.in>< / iframe>
< / li>
< / ul>
问题是它显示yahoo.com和google.co.in,但不显示Facebook在iframe中。
解决方案
您必须检查这些网站的HTTP响应标头X-Frame-Option。如果它的值是DENY或SAMEORIGIN,那么你不能在iframe中加载这些网站。
$ b DENY =没有人可以在iframe中加载网站。即使是相同的域名页面也无法加载。
SAMEORIGIN =只有位于同一网域的网页可以在iframe中加载此网站。
I am trying to develop a page in which I can show more than 3 website at a time, as below:
<ul>
<li>
<iframe src="http://www.facebook.com/" /><p> iframe is not supported</p>
</li>
<li>
<iframe src="http://www.yahoo.com/"></iframe>
</li>
<li>
<iframe src="http://www.google.co.in"></iframe>
</li>
</ul>
The problem is that it shows yahoo.com and google.co.in, but does not display Facebook in the iframe.
解决方案
You have to check for HTTP response header X-Frame-Option of those sites. if its value is "DENY or SAMEORIGIN", then you can not load those website in the iframes.
DENY = No one can load the website in iframe. Even the same domain page wont be able to load. SAMEORIGIN = only a page which is in same domain can load this website in iframe.
这篇关于无法在iframe代码中显示一些网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文