ReferenceError: not defined with activeX

BigBug picture BigBug · Jan 16, 2013 · Viewed 7.9k times · Source

what does it mean to get this error:

ReferenceError: ActiveXObject is not defined
var fso = new ActiveXObject("Scripting.FileSystemObject");

here is my code:

    var fso = new ActiveXObject("Scripting.FileSystemObject");
    varFileObject = fso.OpenTextFile("C:\\LogFile.txt", 8, true,0); // 8=append, true=create if not exist, 0 = ASCII
    newObject.write(XML.innerHTML);
    newFileObject.close();

thanks in advance..

Answer

Avitus picture Avitus · Jan 16, 2013

The problem is the security setting of your browser is blocking it.

If you try IE6 the code should work. You have to use a dead browser because the new browsers block it from working as part of a killbit fix that Microsoft did to fix a security issue.