ajax fetch获取不到数据提示需要跨域(肯定没有跨域)-灵析社区

万码F5GTP6P0

http://aabb:8088/Customer/index 请求 http://aabb:8088/Service/ $.ajax({ url:'http://aabb:8088/Service/', type:'GET', success:function(data){ console.log(data) } }) XMLHttpRequest cannot load http://aabb:8088/Service/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://aabb:8088' is therefore not allowed access. 请求的url换成/Service/就正常了,请问这是为什么?

阅读量:175

点赞量:0

问AI
英勇投弹手
因为 http://aabb:8088/Service/ 与 http://aabb:8088 是两个不同的域名