javascript 加载xml文件,在Chrome下不成功,求助!
var browse="";
loadXML = function(fileRoute){
xmlDoc=null;
if (window.ActiveXObject){
xmlDoc = new ActiveXObject('Msxml2.DOMDocument');
xmlDoc.async=false;
xmlDoc.load(fileRoute);
}
else if (document.implementation && document.implementation.createDocument){
xmlDoc=document.implementation.createDocument('', '', null);
xmlDoc.async=false;
xmlDoc.load(fileRoute); // 24行
}
else {xmlDoc=null;}
return xmlDoc;
}
var xd=loadXML('books.xml');
alert(xd)
Chrome 报错
Uncaught TypeError: Object #<a Document> has no method 'load'
http://192.168.2.48/test/js/jsReadXml.html (line 24)
加分结帖。