function createIEXmlDom(){
var arr=["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0",
"MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XMLDOM"];
try{
for(var i=0;i<arr.length;i++){
return new ActiveXObject(arr[i]);
}
}catch(e){
throw e;
}
}
function xmlDom(){
var dom;
if(window.ActiveXObject){
dom=createIEXmlDom();
}else if(document.implementation && document.implementation.createDocument){
//在firefox及其他浏览器中
alert("火狐");
dom=document.implementation.createDocument("","",null);
}else{
throw new Error("您的浏览器不支持");
}
return dom;
}
var arr=["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0",
"MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XMLDOM"];
try{
for(var i=0;i<arr.length;i++){
return new ActiveXObject(arr[i]);
}
}catch(e){
throw e;
}
}
function xmlDom(){
var dom;
if(window.ActiveXObject){
dom=createIEXmlDom();
}else if(document.implementation && document.implementation.createDocument){
//在firefox及其他浏览器中
alert("火狐");
dom=document.implementation.createDocument("","",null);
}else{
throw new Error("您的浏览器不支持");
}
return dom;
}