ITeye博客

设置ajaxError

palmer · 2013-04-30 00:39 · Web前端 · Markdown

通过设置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.');
	}
});


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。