$.post(url,{"":,"random":Math.random()},function(data){});这种方式提交的数据可以得到后台返回的结果
于是我想当修改成功的时候将信息返回到页面,想到ajax
但是 我提交的是整个form表单的值 这个表单中有很多表单域的!就像注册一样要提交很多信息
但是目前$.post()这种方式是不是只带一个参数。就算可待多个参数,那么我是不是要在,{"":,"":.........将所有的信息都这么写在这里面}
这样是不是有点太麻烦了
前辈们有什么好方法吗?
把url 换成
$("#formid").submit();
$.ajax({
cache: true,
type: "POST",
url:ajaxCallUrl,
data:$('#yourformid').serialize(),// 你的formid
async: false,
error: function(request) {
alert("Connection error");
},
success: function(data) {
$("#commonLayout_appcreshi").parent().html(data);
}
});