如何检测浏览器是否能用ActiveX
var xhr=false;
function CreateXHR(){
try{
//检查能否用activexobject
xhr=new ActiveXObject("msxml2.XMLHTTP");
}catch(e1){
try{
//检查能否用activexobject
xhr=new ActiveXObject("microsoft.XMLHTTP");
}catch(e2){
try{
//检查能否用本地的javascript对象
xhr=new XMLHttpRequest();
}catch(e3){
xhr=false;
}
}
}
}