//针对两种浏览器,分别获取xmlDocument对象
function
loadXML(xmlFile)
{
var
xmlDoc;
if
(window.ActiveXObject) {
xmlDoc=
new
ActiveXObject(
"Microsoft.XMLDOM"
);
xmlDoc.async=
false
;
xmlDoc.load(xmlFile);
}
else
if
(document.implementation&&document.implementation.createDocument){
xmlDoc=document.implementation.createDocument(
""
,
""
,
null
);
xmlDoc.async=
false
;
xmlDoc.load(xmlFile);
}
else
{
alert(
'Your browser cannot handle this script'
);
}
return
xmlDoc;
}
转载于:https://www.cnblogs.com/xffy1028/archive/2011/11/21/2344319.html