js中代码:
- JScript code
$.ajax({ type : "post", dataType:"json", async: true, url : "adddata_action.jsp", data : paras, success: function(data) { if(data.response=='success') { alert(data.message); $("#arrange_sheet").dialog("close"); }else{ alert(data.message); } }, error : function(XMLHttpRequest, textStatus, errorThrown) { alert("error"); /* $("#dialog-message_failed").dialog("open"); */ }
adddata_action.jsp中返回数据语句:
out.println("{\"response\":\"yes\",\"message\":\"信息录入成功!\"}");
求帮助啊!
------解决方案--------------------
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
就明白错误信息了;