在下面的代码中,我正在处理状态码200和401。如果我想直接控制到一个处理除了200和401之外所有代码的函数,我该怎么做?
$.ajax({
type: "POST",
dataType: "json",
data:POSTData,
url: 'http://localhost/api/user/authenticate',
statusCode: {
200: function() {
alert("ok");
},
401: function() {
alert("Invalid Credentials");
}
}
});