欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery ajaxSubmit 異步提交的簡單實現(xiàn)

 更新時間:2014年02月28日 09:10:26   作者:  
這篇文章主要介紹了jquery ajaxSubmit 異步提交的簡單實現(xiàn)。需要的朋友可以過來參考下,希望對大家有所幫助

前臺js

復制代碼 代碼如下:

$("#nickForm").ajaxSubmit({
     type: "post",
     url: "http://localhost:8080/test/myspace.do?method=updateNick&param=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();

}

相關文章

最新評論