How do I detect if ActiveX is enabled in the browser of client?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 22:49:08

ActiveX objects do not exist in anything but Internet Explorer. If you're trying to use them for XMLHTTPRequests, use the XMLHTTPRequest() object instead, using feature detection.

if ("ActiveXObject" in window) { /* Do ActiveX Stuff */ }
else { /* ActiveX doesnt exist, use something else */ }

What isn't working? Is that throwing an error in FF? How about

var hasAX = "ActiveXObject" in window;
Chinmayee G

Below code should work, It is working on IE6 & FF 3.6.12 atleast.

if(typeof(window.ActiveXObject)=="undefined"){
    alert("ActiveX Object not supported");
}else {
    alert("ActiveX Object  supported");
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!