//Method 1.
var url = '/PropertyRight/reports30.do?method=putinExcel';
var form = Form.serialize('changeInfoID');
var myAjax = new Ajax.Request(url , {parameters:form,method:"post",onComplete:afterAdd});
//Method 2.
var pars = '&date=' + date + '&cqdw=' + cqdw + '&reportID=' + reportID;
var url = '/PropertyRight/reports30.do?method=putinExcel';
var myAjax = new Ajax.Request(url, {method: 'post',parameters: pars, onComplete:afterAdd});
function afterAdd(){
........
}
var url = '/PropertyRight/reports30.do?method=putinExcel';
var form = Form.serialize('changeInfoID');
var myAjax = new Ajax.Request(url , {parameters:form,method:"post",onComplete:afterAdd});
//Method 2.
var pars = '&date=' + date + '&cqdw=' + cqdw + '&reportID=' + reportID;
var url = '/PropertyRight/reports30.do?method=putinExcel';
var myAjax = new Ajax.Request(url, {method: 'post',parameters: pars, onComplete:afterAdd});
function afterAdd(){
........
}
本文介绍两种使用Ajax进行POST请求的方法,包括序列化表单数据及拼接参数的方式,并展示了如何处理请求完成后的回调函数。
120

被折叠的 条评论
为什么被折叠?



