github 个页面上不显示简单的 iframe

simple iframe is not displayed on github pages

我经常在我的 github.io 页面中嵌入 iframes,但这个失败了 - 我不明白为什么。

iframe:

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

嵌入此页面的多个位置 - 但未显示

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

(注意:在本地加载 html 页面时,iframe 会显示)。

检查您的浏览器控制台,您会看到以下错误:

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.

您不能在 HTTPS 文档中嵌入 HTTP 框架。您可能需要联系该网站的运营商,要求他们启用 HTTPS。

快速回答: 使用 https 而不是 http