Posted in Javascript onFebruary 28, 2014
前台js
$("#nickForm").ajaxSubmit({ type: "post", url: "http://localhost:8080/test/myspace.do?method=updateNick¶m=1", dataType: "json", success: function(result){ //返回提示信息 alert(result.nickMsg); } });
后台封装:
public ActionForward toUpdateNickName(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ PrintWriter pw = response.getWriter(); JSONObject obj = new JSONObject(); obj.put("nickMsg", "昵称修改成功!"); pw.print(obj); pw.close(); }
jquery ajaxSubmit 异步提交的简单实现
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@