【发布时间】:2012-01-07 05:25:15
【问题描述】:
所以我有这个代码:
<iframe id="theFrame" src="http://localhost" style="width:100%;" frameborder="0">
</iframe>
在 iframe 中加载的 localhost 站点就好了..
但是当我将 src 更改为外部网站时
<iframe id="theFrame" src="http://www.youtube.com" style="width:100%;" frameborder="0">
</iframe>
网站未加载。
我做错了什么?我知道您可以在 iframe 中使用外部网站,因为 Google 图片搜索可以这样做...
如何让外部网站在我的 iframe 中运行?
【问题讨论】:
-
您的 HTML 编码正确,但我认为您尝试访问 Youtube 的网络已阻止 youtube.com 域。您可以通过尝试不同的域来验证这一点吗?