应该怎么操作xmlDoc才能获得里面的东西呢?function createXMLObj(){
if(window.ActiveXObject){ //在IE下
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("xml/info.xml");
alert(xmlDoc);
}else if(document.implementation && document.implementation.createDocument){ //在FF下
xmlDoc=document.implementation.createDocument("", "", null);
xmlDoc.load("xml/info.xml");
alert(xmlDoc);
}else{
return null;
}
return xmlDoc;
}
if(window.ActiveXObject){ //在IE下
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("xml/info.xml");
alert(xmlDoc);
}else if(document.implementation && document.implementation.createDocument){ //在FF下
xmlDoc=document.implementation.createDocument("", "", null);
xmlDoc.load("xml/info.xml");
alert(xmlDoc);
}else{
return null;
}
return xmlDoc;
}
你好,alert结果是undefined
alert(xmlDoc.xml)
这两个结果都是undefined