Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.(

Posted 遇见Time

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.(相关的知识,希望对你有一定的参考价值。

报错信息:
Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure script ‘’. This request has been blocked; the content must be served over HTTPS.
在这里插入图片描述
出错原因:
因为谷歌浏览器对于https链接会自动屏蔽不安全的http链接,就是所谓的Mixed Content。HTTPS页面里动态的引入HTTP资源时,比如引入一个js文件,会被直接block掉的.在HTTPS页面里通过AJAX的方式请求HTTP资源,也会被直接block掉的。
解决方案:
在相应页面的head中加入一段代码即可:

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

这段代码的意思是 自动将http的不安全请求升级为https 。
(注意尽量在只需要它的地方引入,随意加入也可能会出错)

以上是关于Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.(的主要内容,如果未能解决你的问题,请参考以下文章

错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure.......(

Mixed Content: The page at ‘<URL>‘ was loaded over HTTPS, but requested an insecure script ‘<URL>‘.(

JS错误:Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure

解决Mixed Content: The page at https://* was loaded over HTTPS, but requested an insecure XMLHttpReque

转载 Mixed Content Page

Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.