相关疑难解决方法(0)

CORS jQuery AJAX请求

我遇到了ajax请求的麻烦.我收到了错误

No 'Access-Control-Allow-Origin' header is present on the requested resource.

所以我尝试的是这个jQuery ajax请求:

var request = $.ajax({
    type: 'GET',
    url: url,
    dataType: "json",
    xhrFields: {
        withCredentials: true
    }
});
request.done(function(data){
    console.log(data);
});    
Run Code Online (Sandbox Code Playgroud)

但它仍然无法正常工作.我仍然得到错误.

我该怎么解决这个问题?

ajax jquery request cors

29
推荐指数
1
解决办法
11万
查看次数

标签 统计

ajax ×1

cors ×1

jquery ×1

request ×1