Putting mobile Google into an iframe does not work

瘦欲@ 提交于 2019-12-12 15:33:38

问题


Behind the following link is the mobile view of Google: Google's mobile site.

I tried to put it in an iframe on my website, but it doesn't work.

<iframe id="google_search" src="http://m.google.at/search?hl=de&safe=on&q=stackoverflow" style="width: 400px; height: 600px; overflow:scroll; border: 1px solid black;"></iframe>

All I get is an emty iframe. Why?


回答1:


I would suspect that Google is sending the X-FRAME-OPTIONS header set to deny. This prevents the page from loading in a frame in IE8+ and newer versions of FireFox, Opera, and Chrome (the exact version numbers escape me at the moment).

This is usually done to combat ClickJacking. The IEBlog has a great article on this: IE8 Security Part VII: ClickJacking Defenses



来源:https://stackoverflow.com/questions/5449017/putting-mobile-google-into-an-iframe-does-not-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!