所以,我很困惑......所以我去了w3Schools iFrame页面。复制并粘贴此代码到直接从W3Schools的codepen ...iFrame不加载一些网址,但加载其他网址
<iframe src="https://www.w3schools.com"></iframe>
我也试图改变URL几次。载入Google甚至无法正常工作......发生的只是一个空白页面,其页面背景颜色与父页面相同。我不明白为什么iframe代码甚至从w3schools不起作用...我不加载依赖项?我正在使用最新版本的Chrome。
的index.html
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Soundcloud Downloader</title>
</head>
<body>
<div class="container">
<iframe src="http://1stdibs.com/"></iframe>
<iframe src="http://soundtake.net/"></iframe>
<iframe src="https://www.w3schools.com"></iframe>
</div>
</body>
</html>
一个工作代码笔:
https://codepen.io/anon/pen/GEePEK
我的观点(截图): http://imgur.com/a/6bPWB
也许它是http vs https?在浏览器中查看dev控制台中的错误。 –
Google绝对是发送“X-Frame-Options:SAMEORIGIN”响应标题的站点之一。这就要求父代必须与iframe中的子页面在同一个域上运行。所以除非你拥有google.com,否则它不会发生。 – zer00ne