By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

test ActiveX controls

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"stegada" <st***************@inwind.it> wrote in message
news:70**************************@posting.google.c om...
Hi,
i must determine if client's browsers support ActiveX controls.
Is it possible to obtain this information using Javascript?
Thank's a lot.


It's pretty simple:

<object
id="myActiveXControl"
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.getElementById('myActiveXControl');
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 <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.