Click here to Skip to main content
14,270,307 members
Rate this:
Please Sign up or sign in to vote.
See more:

I am using the activexobject in my project it works fine in IE.

I know this is the microsoft control.
I want to run the project in Mozila and Chrome but it showing the error as Activexobject is not defined.

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

Thanks in advance
Updated 7-Jul-17 2:42am
Rate this:
Please Sign up or sign in to vote.

Solution 2

Eventhough totally agree with JSOP's answer there is one thing you can try to also get it to run on FireFox. There is a plugin that enables FireFox to host ActiveX control elements. See here:[^]. You'll have to experiment a bit I guess, but maybe this plugin will help you to get it to work with FireFox. For google chrome you might be interested in this link:[^].

For cross browser compatiblity reasons I strongly discourage the use of ActiveX on a web site though.

Best Regards,

Sergey Alexandrovich Kryukov 30-Jun-11 17:56pm
You must be right, my 5, but it does not save the concept of the ActiveX on client side (browser). For compatibility, it's the best to never use them.
Espen Harlinn 17-Jul-11 9:44am
Very nice to know, solves a common problem - my 5
thatraja 17-Jul-11 11:03am
New to me, 5!
Rate this:
Please Sign up or sign in to vote.

Solution 3

Actually, the google code project reference by Manfred, support google Chrome as well.

It also provides some security measures such as site locking, CLSID/PROGID locking, and incompatibility with IE-style HTML/JS code for creating ActiveX controls.

Disclaimer: I developed and am maintaining that project.
Espen Harlinn 17-Jul-11 9:45am
I'm fairly certain I'll find a use for that plugin, my 5
Rate this:
Please Sign up or sign in to vote.

Solution 4

Your problem can be solved using jQuery:[^]

Or you can do something similar to:
function parseXML(str) {
    if (str == null) return null;
    if ($.trim(str) == "") return createDocument();

    var dom = str;
    if ($.browser.msie) {
        dom = new ActiveXObject("Microsoft.XMLDOM");
        dom.async = "false";
    else if (typeof (DOMParser) != "undefined") {
        var parser = new DOMParser();
        try {

            dom = parser.parseFromString(str, "text/xml");
        } catch (e) { };


First try the MS way, then try what usually works with other browsers ...

Best regards
Espen Harlinn
thatraja 17-Jul-11 11:05am
Today I found many jQuery answers, 5!
Espen Harlinn 17-Jul-11 11:34am
Thank you, thatraja - when I have to work with something as "painful" as javascript, I can appreciate a library such as jQuery
thatraja 17-Jul-11 11:35am
I put jQuery(to learn quickly) in my ToDos. Within 1 or 2 months I'll be a jQuery coder. Let's see.
Espen Harlinn 17-Jul-11 11:40am
That's probably a good idea as jQuery is included with VS2010 and ASP.NET MVC.
Rate this:
Please Sign up or sign in to vote.

Solution 1

No browsers support ActiveX except IE. Why? Because nobody in their right mind would allow an activeX component to be loaded from a web site unless the network is tightly controlled, and the activeX component is from a locally controlled source.
Sergey Alexandrovich Kryukov 30-Jun-11 17:55pm
Absolutely. My 5.
Espen Harlinn 17-Jul-11 9:52am
Using ActiveX based components in IE is quite common for corporate sites - like AspenTech IP.21 Process Browser -

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100