最近我试图在iframe中加载youtube网站,但我检查它不起作用.我用这个简单的代码.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe width="1000px" height="700px" src="http://www.youtube.com" ></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我想知道,为什么我的网页无法在iframe中加载youtube网站..
我用什么代码在我的网页上加载youtube网站.
我如何在我的网站上使用相同的技术,所以没有人可以在iframe中添加我的网站.
我正在尝试开发一个页面,我可以一次显示3个以上的网站,如下所示:
<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>
Run Code Online (Sandbox Code Playgroud)
问题是它显示了yahoo.com和google.co.in,但没有在iframe中显示Facebook.
以下是我的代码:
<div style="border: solid 1px #000000; margin: 5px;">
<iframe src="http://www.w3schools.com" width="100%" height="300px" scrolling="yes"><p>Your browser does not support iframe.</p></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
iframe的内容在chrome中运行良好,但在firefox中运行不正常.我已禁用加载项,但我的iframe仍为空.谁能帮帮我吗?