当前位置:编程学习 > C#/ASP.NET >>

帮忙看看这段关于dom的代码

var text="<bookstore>"
text=text+"<book>";
text=text+"<title>Everyday Italian</title>";
text=text+"<author>Giada De Laurentiis</author>";
text=text+"<year>2005</year>";
text=text+"</book>";
text=text+"</bookstore>";

var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(text);

alert(xmlDoc.getElementsByTagName("author")[0].childNodes[0].nodeValue);


我在机器上会抛出异常“缺少对象”,为什么? --------------------编程问答-------------------- author下也没有子节点啊
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,