var xmlDoc=new ActiveXObject("Microsoft.XMLDOM") ; //创建XmlDom对象
xmlDoc.async=true; //사용异步加载
xmlDoc.onreadystatechange=loadedSales;
함수 loadSales()
{
var txt="";
if(xmlDoc.readyState == 0){
alert("0");
}
if(xmlDoc.readyState == 1){
alert("1");
}
if(xmlDoc.readyState == 2){
alert("2");
}
if(xmlDoc.readyState == 3){
alert("3");
}
if(xmlDoc.readyState == 4)
{
if(xmlDoc.parseError.errorCode != 0)
{
txt="xml解析错误!";
}else{
var items=xmlDoc.documentElement.selectNodes("item");
if(items != null && items.length > 0)
{
for(var i=0; i < items.length; i )
{
txt = "
" items[i].childNodes[0].text "";
}
}else{
txt="";
}
}
}else{
txt="";
}
document.getElementById("판매").innerHTML=txt;
}
함수 loadXmlDoc()
{
var url="Hot.xml";
xmlDoc.load(url);
}