Search code examples
javascriptwindows-mobileactivexwindows-mobile-6.5filesystemobject

ActiveX write to file from JavaScript on Windows Mobile 6.5 - nothing happens


I need to persist some information in offline mode for future use. Normally I would use local storage from HTML5, but on Windows Mobile 6.5, it seems there is no browser available that would support HTML5. So I'm analysing using ActiveX to write information to the file, which could be send to the server (manually) when back online.

The following code:

function tst_write_file() {
    var fnameinput = $("filename");
    var fname = fnameinput.value;
    var sometextinput = $("sometext");
    var sometext = sometextinput.value;
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var file = fso.CreateTextFile(fname, true, true);
    file.WriteLine(sometext);
    file.Close();
    alert("Text was written");
};

Is working on Windows (laptop), prompting that unsecure ActiveX requires to be run. On my IE on Windows Mobile 6.5, however, no prompt is done, no alert is shown, and I have checked in security options, that scripts are enabled.

Am I doing something wrong or this ActiveX component is not available on WM 6.5?


Solution

  • The Scripting object doesn't exist in Windows CE, Windows Mobile or Windows Phone.