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

后端 未结 4 770
萌比男神i
萌比男神i 2020-12-06 05:04

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

I tried following code, but it\'s not working in Firefox.

window.ActiveXObject not wo         


        
4条回答
  •  [愿得一人]
    2020-12-06 05:39

    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 */ }
    

提交回复
热议问题