|
发表于 2020-3-9 15:15:01
|
显示全部楼层
function load()
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");//创建XMLHTTPRequest对象,需MSXML4.0支持
xmlhttp.open("POST","../../AddressBehind.aspx",false,"",""); //使用HTTP GET初始化HTTP请求
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ;
xmlhttp.send("name=ddlPro&id=1"); //发送HTTP请求并获取HTTP响应
var res=xmlhttp.responseText.split("|*");
var name=res[0].split("|");
var id=res[1].split("|");
document.all.ddlPro.options[0] = new Option("请选择",0);
document.all.ddlCity.options[0] = new Option("请选择",0);
document.all.ddlReg.options[0] = new Option("请选择",0);
for(i=0;i<name.length;i++)
{
document.all.ddlPro.options[i+1] = new Option(name[i],id[i]);
}
xmlhttp.open("POST","../../Sort.aspx",false,"",""); //使用HTTP GET初始化HTTP请求
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ;
xmlhttp.send(); //发送HTTP请求并获取HTTP响应
var res=xmlhttp.responseText.split("|");
document.getElementById("dish").innerHTML =res[1];
var dishImage=document.getElementById("dishImage");
dishImage.src="../../image/"+res[0];
xmlhttp.open("POST","../../RestSort.aspx",false,"",""); //使用HTTP GET初始化HTTP请求
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") ;
xmlhttp.send(); //发送HTTP请求并获取HTTP响应
res=xmlhttp.responseText.split("|");
document.getElementById("rest").innerHTML =res[1];
var restImage=document.getElementById("restImage");
restImage.src="../../image/"+res[0];
} |
|