Test if an ActiveX control is installed with Javascript?

£可爱£侵袭症+ 提交于 2019-11-28 18:50:33
function AXOrNull(progId) {
  try {
    return new ActiveXObject(progId);
  }
  catch (ex) {
    return null;
  }
}

Solution, try to invoke a new ActiveXObject:


function testForActiveX(){
    tester = null;
    try {
        tester = new ActiveXObject('htmlfile');
    }
     catch (e) {
        // catch the exception
    }
    if (tester) {
        // ActiveX is installed
        return true;
    }
    return false;
}
   try{
      if(new ActiveXObject("Nameofplugin")){
        // write your code if plugin available
       }
      else{
       // write your code if plugin is not available
       }
    }
    catch(erro){
    //write your code if plugin is not available
    }

` Nameofplugin you can get from IE--> Tool-->ManageAddons-->Check the List and pick the name of your supportive plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!