我遇到了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)
但它仍然无法正常工作.我仍然得到错误.
我该怎么解决这个问题?