Why embedding web pages does not work for all sites

I use code like this to embed a webpage in a webpage:

<object data="http://www.cnn.com" type="text/html">
    <embed src="http://www.cnn.com" type="text/html" />
</object>

For some sites this works, but for some it is not - it doesn’t show anything. What for? Is this something that can be fixed using code, or is it better to embed sites in some other way?

Here is an example of a site that works and a site that does not work: http://jsfiddle.net/fqpfj1th/1/

+4
source share
1 answer

Perhaps due to the presence of the header X-Frame-Options:

Accept-Ranges: bytes
Cache-control: max-age = 0, no-cache, no-store
Connection: keep-alive
Content-Encoding: gzip
Content-Language: en
Content-Length: 9459
Content-Type: text / html; charset = utf-8
Date: Sun, 10 May 2015 13:51:36 GMT
ETag:"1431265860-0"
Expires:Sun, 10 May 2015 13:51:36 GMT
Last-Modified:Sun, 10 May 2015 13:51:00 GMT
Link:; rel="canonical",; rel="shortlink"
Pragma:no-cache
Server:Apache
Vary:Accept-Encoding
X-Drupal-Cache:MISS
X-Frame-Options:SAMEORIGIN
X-Generator:Drupal 7 (http://drupal.org)
X-Powered-By:PHP/5.3.3
X-Server:web05a.sjc05.teslamotors.com
X-Varnish:1302280716
X-Varnish-Server:varnish02a.sjc05.teslamotors.com

, CSP Level 2, .

https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options

+2

All Articles