在下面的代码中有两个函数:OppSelect()函数正在调用另一个函数,即exOpp()。现在,如何获得"结果" OppSelect()的值为" exOpp()"功能并附加到网址?请帮忙。
JS:
function exOpp() {
alert("inside");
document.forms[0].action = "/Mgmt/ExportOpp?loadData=xls&customerprofile=" + $customerIDH + "&role=" + $roleIDH + "&targetDate=" + $targetDateH + "&actualDate=" + $actualDateH;
document.forms[0].submit();
}
function OppSelect() {
var menu = document.getElementById('selectedServersID').length;
alert(menu);
var result = "";
for (var i = 0; i < menu; i++) {
var selectedcol = document.getElementById('selectedServersID')[i].value;
//var selectedcol = document.getElementById('selectedServersID')[i].innerHTML;
// alert(selectedcol);
if (i > 0) {
result += ',';
}
result += selectedcol;
}
alert(result);
exOpp();
}
答案 0 :(得分:0)
您可以将其作为参数传递给exOpp(result);
function exOpp(data) {
var urldata = data;
document.forms[0].action = "/Mgmt/ExportOpp?loadData=xls&customerprofile="+$customerIDH+"&role="+$roleIDH+"&targetDate="+$targetDateH+"&actualDate="+$actualDateH;
document.forms[0].submit();
}
现在根据需要将urldata添加到urstring ..