在linux 用什么代替 windows 里的 new ActiveXObject'Microsof
1个回答
展开全部
这个只与浏览器有关的。
比如在Firefox中是这样的:
document.implementation.createDocument( " ", " ",null);
给你一个创建函数:
function XmlDom(){
if(window.ActiveXObject){
var arrSignatures=new Array(5);
arrSignatures[0]= "MSXML2.DOMDocument.5.0 ";
arrSignatures[1]= "MSXML2.DOMDocument.4.0 ";
arrSignatures[2]= "MSXML2.DOMDocument.3.0 ";
arrSignatures[3]= "MSXML2.DOMDocument ";
arrSignatures[4]= "Microsoft.XmlDom ";
for(var x=0;x <arrSignatures.length;x++){
try{ return new ActiveXObject(arrSignatures[x]);}
catch(oError){/*ignore*/}
}
throw new Error( "MSXML is not installed on your system. ");
}
else if(document.implementation && document.implementation.createDocument) return document.implementation.createDocument( " ", " ",null);
else throw new Error( "Your browser doesn 't support an XML DOM object. ");
}
比如在Firefox中是这样的:
document.implementation.createDocument( " ", " ",null);
给你一个创建函数:
function XmlDom(){
if(window.ActiveXObject){
var arrSignatures=new Array(5);
arrSignatures[0]= "MSXML2.DOMDocument.5.0 ";
arrSignatures[1]= "MSXML2.DOMDocument.4.0 ";
arrSignatures[2]= "MSXML2.DOMDocument.3.0 ";
arrSignatures[3]= "MSXML2.DOMDocument ";
arrSignatures[4]= "Microsoft.XmlDom ";
for(var x=0;x <arrSignatures.length;x++){
try{ return new ActiveXObject(arrSignatures[x]);}
catch(oError){/*ignore*/}
}
throw new Error( "MSXML is not installed on your system. ");
}
else if(document.implementation && document.implementation.createDocument) return document.implementation.createDocument( " ", " ",null);
else throw new Error( "Your browser doesn 't support an XML DOM object. ");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询