Iframe source doesn't work [closed]

2019-09-28 07:52发布

问题:

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.



标签: html iframe