发生错误时,我尝试访问发回服务器的状态文本。在服务器端,我将状态文本设置为错误消息。StatusCode 是 500,statusText 是错误描述。
Headers 部分内的 Chrome 控制台输出为:
Status Code:500 (big red dot) Error Message: Something went wrong.
但是当我现在尝试在 .error() 函数回调中访问 statusText 时,总是有文本“错误”:
.error(function (xhr, text) {
alert(xhr.statusText);
});
jQuery 是覆盖这个字段还是我如何访问原始值?
感谢帮助!