Mixed Content:'xxx' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'xxx'

1、我访问一个https页面,但是js中有个ajax请求http,url是:http//:。提示请求了一个不安全的脚本,结果发送ajax 请求时,报出如下错误

Mixed Content: The page at 'https:.....” was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://...'

Mixed Content:'xxx' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'xxx'_第1张图片

 2、这是浏览器限制的,不好解决。我感觉解决方式只有一种,把两种协议变成一种协议。

我的方法:把https请求,进行转发为http

另一种网友提供:

页面的head中加入:

           

你可能感兴趣的:(报错及异常总结)