ajax跨域请求问题:Access to XMLHttpRequest at……has been blocked by CORS policy: Cross origin requests
背景:本地代码调试时,加载本地资源正常,jquery的AJAX请求服务端资源报错。Access to XMLHttpRequest at '***** ’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests.报错信息:跨域请求已被CORS策略阻止。CORS:Cross-origin resource sharing ,跨域资源共享。报错原因:出于安全性,浏览器的同源策略限制脚本内发起跨源Http请求。
原创
2020-12-21 18:15:14 ·
2089 阅读 ·
0 评论