日期:2014-05-16  浏览次数:20715 次

设置ajaxError
通过设置ajaxError ajaxComplete可以或者ajax 异常


$(document).ajaxError(function(event, jqxhr, settings, exception) {
	window.console && console.log(exception);
	alert('An unexpected error has occurred. Please contact support.\nError requesting page ' + settings.url);
});
$(document).ajaxComplete(function(event, xhr, settings) {
	if (xhr.responseText == "AJAX_UNEXPECTED_EXCEPTION") {
		alert('An error has occurred. Please contact support.');
	}
});