views:

157

answers:

1

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?

+1  A: 

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.

tyranid
Thanks a lot for this answer! It works perfectly.
Silvan Mühlemann