的代碼是這樣的:如何檢索jquery.ajax錯誤的responseText?
$.ajax({
url: "http://server.com/rest",
dataType: "jsonp",
success:function(d, t, x) {
console.log(d);
},
error:function(x, t, e) {
console.log(x.responseText);
}
});
螢火蟲顯示我接收到響應,但上面的代碼只記錄「未定義」。 Firebug還顯示http狀態碼是200.有人可以告訴我如何檢索響應嗎?
可能重複:http://stackoverflow.com/questions/19035557/jsonp-request-error-handling –
jqXHR.responseText給我「未定義」 –
查看鏈接發佈者@AnthonyGarcia –