$(document).ajaxError(function (e, xhr, options, data) {
if (xhr.status === 403) {
dosomething;
} else if (xhr.status === 0){
alert("当前网络状态不佳哦,请稍后重试");
} else if (xhr.status === 500){
alert("服务器挂掉了,请稍后重试");
} else {
alert("当前网络状态不佳哦,请稍后重试");
}
})
在xhr.status === 0 增加个ontimeout的处理