javascript xmldoc.getElementByTagName出错 - Web 开发 / 其他
var xmldoc = new ActiveXObject("Microsoft.XMLDOM");xmldoc.load("/a.xml");xmldoc.loadXML("<Colleges></Colleges>");var colleges=xmldoc.getElementByTagName("collegeName");//上面这句话出的错误
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Colleges[<!ELEMENT Colleges (collegeName,collegeID,Majors)><!ELEMENT collegeName (#PCDATA)><!ELEMENT collegeID (#PCDATA)><!ELEMENT Majors (majorName,majorID,classes)><!ELEMENT majorName (#PCDATA)><!ELEMENT majorID (#PCDATA)><!ELEMENT classes (classID)><!ELEMENT classID (#PCDATA)>]><Colleges> <collegeName>Computer Science</collegeName> <collegeID>1</collegeID> <Majors> <majorName>Web Science</majorName> <majorID>11</majorID> <classes> <classID>111</classID> </classes> </Majors></Colleges>