<script type="text/javascript">
var xmlDoc;
function loadXML(){
if(document.implementation&&document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("test.xml");
xmlDoc.onload=getmessage();
}
else{
alert("Your browser cannot handle this script");
}
}
function getmessage(){
var nodes=xmlDoc.getElementsByTagName("note");
alert(nodes.length);
}
</script><br/>
test.xml<br/>
<?xml version="1.0" encoding="gb2312" ?>
<note>
<to>gww</to>
<from>dan dan</from>
<body>Hello world</body>
</note>
<note>
<to>aa</to>
<from>bb</from>
<body>Hello to mars</body>
</note>
<br/>请问该怎么取note节点下的子结点呢 ?这个是在ff下。
var xmlDoc;
function loadXML(){
if(document.implementation&&document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("test.xml");
xmlDoc.onload=getmessage();
}
else{
alert("Your browser cannot handle this script");
}
}
function getmessage(){
var nodes=xmlDoc.getElementsByTagName("note");
alert(nodes.length);
}
</script><br/>
test.xml<br/>
<?xml version="1.0" encoding="gb2312" ?>
<note>
<to>gww</to>
<from>dan dan</from>
<body>Hello world</body>
</note>
<note>
<to>aa</to>
<from>bb</from>
<body>Hello to mars</body>
</note>
<br/>请问该怎么取note节点下的子结点呢 ?这个是在ff下。
楼主【gwwnha】截止到2008-07-02 12:15:44的历史汇总数据(不包括此帖):
发帖的总数量:8 发帖的总分数:250
结贴的总数量:3 结贴的总分数:110
无满意结贴数:0 无满意结贴分:0
未结的帖子数:5 未结的总分数:140
结贴的百分比:37.50 % 结分的百分比:44.00 %
无满意结贴率:0.00 % 无满意结分率:0.00 %
楼主该结一些帖子了