var xmlHttp;
function GetXmlHttp()
{
return window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
}
function GetRequest()
{
var url = "Bookstore.xml";
xmlHttp = GetXmlHttp();
xmlHttp.onreadystatechange = OnReadyStateChange;
xmlHttp.open("GET", url, true);
xmlHttp.send("");
}
function OnReadyStateChange()
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
var xmlDoc = xmlHttp.responseXML;
}
}
}
然后解析这个xmlDoc ,添加到select中就OK了
function GetXmlHttp()
{
return window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
}
function GetRequest()
{
var url = "Bookstore.xml";
xmlHttp = GetXmlHttp();
xmlHttp.onreadystatechange = OnReadyStateChange;
xmlHttp.open("GET", url, true);
xmlHttp.send("");
}
function OnReadyStateChange()
{
if(xmlHttp.readyState == 4)
{
if(xmlHttp.status == 200)
{
var xmlDoc = xmlHttp.responseXML;
}
}
}
然后解析这个xmlDoc ,添加到select中就OK了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货