test ActiveX controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stegada

    #1

    test ActiveX controls

    Hi,
    i must determine if client's browsers support ActiveX controls.
    Is it possible to obtain this information using Javascript?
    Thank's a lot.
    Stefano
  • Grant Wagner

    #2
    Re: test ActiveX controls

    "stegada" <stefano.santag ada@inwind.it> wrote in message
    news:70cf2e62.0 502020632.60402 b1d@posting.goo gle.com...[color=blue]
    > Hi,
    > i must determine if client's browsers support ActiveX controls.
    > Is it possible to obtain this information using Javascript?
    > Thank's a lot.[/color]

    It's pretty simple:

    <object
    id="myActiveXCo ntrol"
    classid="CLSID: CA8A9780-280D-11CF-A24D-444553540000"
    width="80"
    height="30">
    <param name="src" value="test.pdf ">
    </object>
    <script type="text/javascript">
    window.onload = function()
    {
    var ax = document.getEle mentById('myAct iveXControl');
    if (ax && ax.src)
    {
    alert('browser appears to have loaded your ActiveX control');
    }
    else
    {
    alert('browser appears to not have loaded your ActiveX
    control');
    }
    }
    </script>

    Put the ActiveX control in your page, then retrieve it and test a
    well-known exported property or method unique to your ActiveX control.

    If the property or method returns what it is supposed to return, the
    ActiveX control loaded and is scriptable.

    You could also test by creating a new ActiveX control using "new
    ActiveXObject(. ..);", assuming you know the user agent you're using
    actually supports "new ActiveXObject(. ..);".

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq


    Comment

    Working...