function ReqXml() //主程序函數
{
CreateXMLHttpRequest(); //創建對象
xmlobj
xmlobj
xmlobj
}
function StatHandler() //用於處理狀態的函數
{
if(xmlobj
{
xml = xmlobj
var allees = xml
//獲取XML文件中的所有employee標簽
document
for(var i =
{
var tempobj
tempobj = allees[i]
name =
tempobj = allees[i]
sex =
tempobj = allees[i]
age =
tempobj = allees[i]
band =
tempobj = allees[i]
salary =
row = name + sex + age + band + salary +
document
}
}
}
</script>
</head>
<body>
<p><a href=
<p><div id=
</body>
</html>
運行結果如圖
http://develop
圖
上面的代碼首先讀取了XML文件中的所有employee標簽及其下的所有標簽來獲得XML文件中的全部內容
right
From:http://tw.wingwit.com/Article/program/PHP/201311/21449.html