跨域请求所遇到的错误

1、Mixed Content: The page at 'https://www.1399p.com/api/kaijiang.html?lottery=pk10,cqssc,xyft&set=pk10&bgcolor=e0e0e0' was loaded over HTTPS, but requested an insecure script 'http://s23.cnzz.com/stat.php?id=5959517&web_id=5959517'. This request has been blocked; the content must be served over HTTPS.

这段话的意思是:https不能加载外部js文件http://s23.cnzz.com/stat.php?id=5959517&web_id=5959517

解决办法

1》加载了外部Js,就被判断为不安全的,建议能直接复制远程的Js,就复制下来。

2、Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.

这段话的意思是:未捕获的安全错误:

阻止了一个域为null的frame页面访问另一个域为null的页面。

也许你在本地直接用浏览器打开的,地址栏是file:///的页面吧。

可以试着在本地架设服务器来调试,建议工具:nginx。

放在服务器上面就正常了!!!!!

原文地址:https://www.cnblogs.com/guoyinglichong/p/7124413.html