我正在尝试发出跨域请求,但服务器无法响应
Access-Control-Allow-Origin: *
我正在尝试读取响应标头。当我尝试读取状态代码或就绪状态时,它返回 0。我的 ajax 请求代码如下。
$.ajax({
url: "https://accounts.google.com/o/oauth2/auth",
type: "POST",
data: {"response_type":"token","client_id":"6720XXXXXXX.apps.googleusercontent.com","redirect_uri":"http://localhost:51967/oauth2callback.aspx","scope":"https://www.googleapis.com/auth/calendar","state":"this is state information","approval_prompt":"auto"},
crossDomain: true
}).always(function(jqxhr,testStatus,errorThrown)
{
alert(jqxhr.readyState);
alert(jqxhr.status);
});
提前致谢