Search code examples
javascriptxmlactivexobject

ReferenceError: not defined with activeX


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..


Solution

  • 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.