"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