async (Boolean) : (默认: true) 默认设置下,所有请求均为异步请求。
如果需要发送同步请求,请将此选项设置为 false。注意,同步请求将锁住浏览器,用户其它操作必须等待请求完成才可以执行。
pdata=encodeURI(encodeURI(pdata)); $.ajax({ type: "POST", URL: "<%=request.getContextPath()%>/weeklyProjectAjaxAction.do", data: pdata, success: function(msg){ //success functions }, error:function(msg){ //error functions } });
//BookingDaysCommentOpenAction.java
response.setContentType("text/html; charset=utf-8");
response.getWriter().write(msg.toString());
return null;
$.post("dailybooking_update.do", pdata, success); var success = function(msg) { //success functions };