Iframe source doesn't work [closed]

北战南征 提交于 2019-12-13 09:59:53

问题


Why can't this link be the source of an iframe? http://exame.abril.com.br/tecnologia/facebook/noticias/facebook-nao-tem-planos-de-voltar-a-china-diz-executivo

im using jquery $("#frame").attr("src",source);


回答1:


Running this:

<html>
    <head></head>
    <body>
        <iframe width="500" height="500" src="http://exame.abril.com.br/tecnologia/facebook/noticias/facebook-nao-tem-planos-de-voltar-a-china-diz-executivo">
        </iframe>
    </body>
</html>

In Chrome yields:

Refused to display document because display forbidden by X-Frame-Options.

Which is explained here.




回答2:


It has the X-Frame-Options:SAMEORIGIN http response header, which tells the user agent to only allow the page to be loaded in a frame if its parent has the same origin.



来源:https://stackoverflow.com/questions/12327864/iframe-source-doesnt-work

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