Hot.xml??浠?锛?
<?xml version="1.0" encoding="gb2312"?>
<root>
<item>
<name>??浜???lt;/name>
<url>MingXing/LiuYiFei.htm</url>
<color>red</color>
</item>
<item>
<name>?′???</name>
<url>MingXing/CaiYiLin.htm</url>
<color>blue</color>
</item>
<item>
<name>寮?濞???</name>
<url>MingXing/ZhangNaLa.htm</url>
<color>green</color>
</item>
<item>
<name>寮??舵兜</name>
<url>MingXiang/ZhangShaoHan.htm</url>
<color>grey</color>
</item>
<item>
<name>寮???棰?</name>
<url>MingXing/ZhangLiangYin.htm</url>
<color>black</color>
</item>
<item>
<name>??瀹???lt;/name>
<url>MingXing/LiYuChun.htm</url>
<color>yellow</color>
</item>
<item>
<name>寰??ョ??</name>
<url>MingXing/XuLuXuan.htm</url>
<color>pink</color>
</item>
</root>
====================================
demo1.html??浠訛?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript?峰??XML?版??</title>
<script language="javascript">
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); //??寤?mlDom瀵矽薄
xmlDoc.async=true; //浣跨?ㄥ?姝ュ??杞?xmlDoc.onreadystatechange=loadedSales;
function loadedSales()
{
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瑙f????璇?锛?";
}else{
var items=xmlDoc.documentElement.selectNodes("item");
if(items != null && items.length > 0)
{
for(var i=0; i < items.length; i++)
{
txt += "<li><a href="+items[i].childNodes[1].text+" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" mce_href="+items[i].childNodes[1].text+" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" style="color:" mce_style="color:""+items[i].childNodes[2].text+">"+items[i].childNodes[0].text+"</a></li>";
}
}else{
txt="";
}
}
}else{
txt="";
}
document.getElementById("sales").innerHTML=txt;
}
function loadXmlDoc()
{
var url="Hot.xml";
xmlDoc.load(url);
} ????
</script>
</head>
<body onLoad="loadXmlDoc()">
??? <div id="sales"></div>
</body>
</html>
=============================
?????撅?