jQueryajax错误处理,显示自定义异常消息。
throw new ApplicationException("User name already exists");
jQuery("#save").click(function () {
if (jQuery('#form').jVal()) {
jQuery.ajax({
type: "POST",
url: "saveuser.do",
dataType: "html",
data: "userId=" + encodeURIComponent(trim(document.forms[0].userId.value)),
success: function (response) {
jQuery("#usergrid").trigger("reloadGrid");
clear();
alert("Details saved successfully!!!");
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
}});undefined
汪汪一只猫
月关宝盒
萧十郎
芜湖不芜
随时随地看视频慕课网APP
相关分类