simple iframe is not displayed on github pages

2019-07-13 06:16发布

问题:

I regularly embed iframes in my github.io pages but this one fails - I can't see why.

The iframe:

<iframe src="http://www.javarepl.com/embed.html" style="width: 500px; height: 130px; border: 0px"></iframe>

Embedded at several places in this page - and not showing up:

https://seinecle.github.io/codapps/generated-html/essential-notions-of-code.html

(note: when loading the html page locally, the iframe does show up).

回答1:

Check your browser console and you'll see the error:

Mixed Content: The page at 'https://seinecle.github.io/codapps/generated-html/essential-notions-of-code.html' was loaded over HTTPS, but requested an insecure resource 'http://www.javarepl.com/embed.html'. This request has been blocked; the content must be served over HTTPS.

You can't embed HTTP frames in an HTTPS document. You may want to contact the operator of that web site to ask them to enable HTTPS.