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

时间:2014-04-28 12:46:10

标签: php html codeigniter 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'.

1 个答案:

答案 0 :(得分:2)

问题与https无关。

查看错误消息:

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

Google明确告知您的浏览器,只允许google.com在iframe中显示该页面。

无法覆盖此行为。这是Google的页面。

您最接近的可能是将内容复制到您自己的服务器并在那里显示。谨防国际版权法。