以下为引用内容:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery 异步提交表单实例解析</title>
</head>
<script src="js/jquery-1.4.2.js"></script>
<script>

 
$('#f1').submit(function() {
$.ajax({
url: 'updateOrAddUser.action',
data: $('#f1').serialize(),
type: "post",
cache : false,
beforeSend:function(){
 if(!validateAll()){
  return false;
 }
},
success: function()
{

 
 jQuery("#content").load("searchUsers.action?"+(new Date()).valueOf());
}
});
return false;
});


</script>
<body>
<form />
</form>
</body>
</html>

-------------------------------------

后台:
 PrintWriter out = null;
  response.setContentType("text/html;charset=UTF-8");
  try {
   out = response.getWriter();
   out.write(jsonStr);
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }finally{
   out.close();
  }

相关文章:

  • 2021-12-12
  • 2022-01-23
  • 2022-02-08
  • 2022-12-23
  • 2021-12-17
  • 2021-11-04
猜你喜欢
  • 2022-02-08
  • 2021-12-31
  • 2022-02-28
  • 2022-02-08
  • 2022-02-01
  • 2021-05-21
相关资源
相似解决方案