jquery-latest.js:9631 Access to XMLHttpRequest at 'http://123.123.123.123' from origin 'http://234.234.234.234' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private.
但是我浏览器设置了跨域的呀,jquery-latest.js 这个文件也放到网站空间里了
"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir=C:\MyChromeDevUserData
本地直接开html文件能够通过页面POST数据到服务器,而把页面放到网站服务器上后就发送失败了,以前都是正常能够通过在线网站操作,前段时间就不行了,一直没有找到问题,请问该怎么处理呢?
以前没有问题,那可能是浏览器更新了跨域安全协议,
解决方法:
1、浏览器地址栏输入:chrome://flags/#out-of-blink-cors 回车
2、找到 Out of blink CORS 项
3、选择Disable 禁用
4、重启浏览器
看你的描述,你应该进行了类似的设置。如果浏览器设置不生效,可以尝试设置一下jQuery,jQuery默认是禁止跨域请求的,
1、可以直接设置jQuery.support.cors = true; 开启跨域;
2、在headers里面设置"Access-Control-Allow-Origin":"*";
一般跨域问题在服务端解决。
要么开启跨域,要么不要进行跨域资源加载。