function read() { // var file = fopen(getScriptPath("a.txt"), 0); // var file_length = flength(file); // var content = fread(file, file_length); //document.getElementById("myDiv").innerText = content; try { var fso = new ActiveXObject('Scripting.FileSystemObject'); alert('ok'); var fh = fso.OpenTextFile('a.txt',1); var contents = fh.ReadAll(); fh.Close(); alert(contents); //return contents; } catch (Exception) { alert('Cannot open file :('); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)