Mixed Content:'https:.....' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpo...

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://...'


2、这是浏览器限制的,不好解决

2.1、把两种协议变成一种协议:把https请求,进行转发为http

2.2、页面的head中加入:

你可能感兴趣的:(Mixed Content:'https:.....' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpo...)