我有如下全局处理。
$.ajaxSetup({
statusCode: {
200: function(res, status, xhr) {
},
500: function() {
},
400: function(jqXHR, textStatus, errorThrown) {
},
});
我在骨干模型提取中进行如下特定处理。
var xhr = byBackbone.fetch({//or save
success: function(){},
error: function(){
if(xhr.statusCode == 400 && xhr.data == "some specific response"){
//specefic handling
} else {
//how to call statusCode.400() here or how to leave it for getting handled globally?
}
}
});
因此,在评论中,问题是,在捕获特定错误后如何让它在全球范围内得到处理?