function voip_submit()
{
var link = encodeURIComponent('/goform/az_ifx_set_voip_sip_linebasicaccount');
var loc = 'page=quickstart.asp';
loc += '&status='+document.az_sip.status.value;
loc += '&cvflag='+document.az_sip.cvflag.value;
loc += '&vlstatus1='+document.az_sip.vlstatus1.value;
loc += '&vlstatus2='+document.az_sip.vlstatus2.value;
var retVal = new Ajax.Request(link, {
method: 'post',
parameters: loc,
encoding: 'ISO-8859-1',
onSuccess: function(transport) {
submit_voip1();
},
onFailure: function(transport) {
Tiny.hide();
showAlert("Apply settings failed");
}
});
}
答案 0 :(得分:0)
首先,不需要在retVal
中存储新的Ajax.Request对象。 onSuccess
和onFailure
回调是实际处理请求“返回”的数据(或缺少)的回调。
其次,您应该使用内置的Prototype方法来编码数据
function voip_submit()
{
new Ajax.Request('/goform/az_ifx_set_voip_sip_linebasicaccount', {
method: 'post',
parameters: {
page: 'quickstart.asp',
status: document.az_sip.status.value,
cvflag: document.az_sip.cvflag.value,
vlstatus1: document.az_sip.vlstatus1.value,
vlstatus2: document.az_sip.vlstatus2.value
},
encoding: 'ISO-8859-1',
onSuccess: function(transport) {
submit_voip1();
},
onFailure: function(transport) {
Tiny.hide();
showAlert("Apply settings failed");
}
});
}