Note: Aside from the options listed below, you can also pass any of the standard $.ajax
options to ajaxForm and ajaxSubmit.
所需JS:
jquery.form.js
设置与jquery中 $.ajax 中类似,提交后参数的形式为 a=1&b=2
option设置提交时的参数
var listOptions = {
cache:false,
type:'post',
callback:null,
dataType :'json',
url:contextpath+"/deptConfig/queryList.action",
success:function(data){
//var obj = JSON.parse(data);
if(data){
}
return false;
}
};
提交: listForm为表单form 的ID
$("#listForm").ajaxSubmit(listOptions);
api地址为:
http://www.malsup.com/jquery/form/#api