如何获得jQuery$.ajax错误响应文本?
<?
header('HTTP/1.1 500 Internal Server Error');
print "Gone to the beach"?>$.ajax({
type: "post",
data: {id: 0},
cache: false,
url: "doIt.php",
dataType: "text",
error: function (request, error) {
console.log(arguments);
alert(" Can't do because: " + error);
},
success: function () {
alert(" Done ! ");
}});[XMLHttpRequest readyState=4 status=500, "error", undefined]
不能做,因为:错误
GCT1015
MYYA
慕标5832272