如何在iframe中执行https://url


how to execute https:// url in iframe

这是我的代码

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div id="container">
    <iframe src="https://google.com" style="width:1000px;height:1000px"></iframe>
</div>
</body>
</html>

控制台中的错误,即

Refused to display 'https://www.google.co.in/?gws_rd=cr&ei=YE1eU9jPItDqrQe8g4GwCg' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

问题与https无关。

查看错误消息:

 because it set 'X-Frame-Options' to 'SAMEORIGIN'

谷歌明确告诉你的浏览器,只允许google.com在iframe中显示页面。

没有办法推翻这种行为。这是谷歌的网页。

最接近的方法是将内容复制到自己的服务器上并在那里显示。小心国际版权法。