Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect if an ActiveX control is loaded?

I would like to integrate the Aurigma image uploader (http://www.aurigma.com/Products/ImageUploader/) on a website.

On Internet Explorer the control is an ActiveX control which issues a security prompt prior to the first installation.

To give the user instructions about how to react to this security warning I'd like to display an information window. I want to display this window only the control is not loaded.

  if (controlIsNotLoaded()) {
    doSomething()
  }

How can I do that?

like image 352
Silvan Mühlemann Avatar asked Jan 29 '10 15:01

Silvan Mühlemann


1 Answers

Assuming you have the id of the object tag (if it is coming from that) then test for the object attribute of the element against null.

function controlNotLoaded()
{
     var obj = document.getElementById("controlId");
     return (obj.object == null);
}

If you are using new ActiveXObject then it will throw an exception. Of course this will only tell you if the control isn't able to be created, not necessarily why.

like image 125
tyranid Avatar answered Sep 24 '22 16:09

tyranid