1

I tried creating an iframe. I have created an iframe before. But this one doesn't seem to work no matter what I do.

<!DOCTYPE html>
<html>
<head>
<title>DSCOVR</title>
</head>
<body>
DSCOVR:
<iframe src="http://epic.gsfc.nasa.gov/index.html" width="100%" height="1000px">loading...</iframe>
</body>
</html>

Link to jsfiddle with my code

It doesn't seem to work with any other websites either.

Sub 6 Resources
  • 1,674
  • 15
  • 31

2 Answers2

1

Open your browser's developer tools. Look at the console.

Mixed Content: The page at 'https://jsfiddle.net/mmzj1uge/' was loaded over HTTPS, but requested an insecure resource 'http://epic.gsfc.nasa.gov/index.html'. This request has been blocked; the content must be served over HTTPS.

You can't embed insecure content into an otherwise secure page.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • The server I'm using doesn't use https:// only http:// – Sub 6 Resources May 03 '16 at 22:14
  • @sub6resources — That doesn't substantially change the answer. Look at the console. Read the error message. `Refused to display 'http://epic.gsfc.nasa.gov/index.html' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.` – Quentin May 03 '16 at 22:18
  • @sub6resources If your server is HTTP, can you provide a link to the page that this code is on (On your insecure server)? – Emmet Arries May 03 '16 at 22:20
0

If you look at the warnings (with Safari), there is one that says:

[blocked] The page at about:blank was not allowed to display insecure content from http://epic.gsfc.nasa.gov/index.html.

Like Quentin said:

My guess is that JSFiddle won't embed HTTP stuff because JSFiddle's website is HTTPS secured, and if it did, it would compromise security.

Hope this helped!

Emmet Arries
  • 539
  • 2
  • 12
  • 35