我正在使用 jQuery 1.6,我想知道并了解如何访问 response和以下代码中的变量xhr
:status
ex
$jQuery.ajax({
type: "POST",
url: "<some_url>",
error: function(xhr, status, ex) {
var msg = "";
if (xhr) {
msg = "readyState is " + xhr.readyState + ". ";
}
if (ex) {
msg += ex.name + ' - ' + ex.message;
}
alert("ERROR " + msg); }
success: function(jqXHR, status, ex) {
...
}
});
我如何知道所有“可访问”值的完整列表readyState
,例如xhr
( xhr.readyState
)name
和message
(ex
和)?ex.name
ex.message
此外,xhr
和ex
变量代表什么(我认为status
是指HTTP状态码)?