This will only work on IE, but if that is not a problem for you, here is some sample code to write to a file:
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("c:\\path\\to\\myfile.txt" , 8, 1, -2);
s.writeline("Hello World");
s.Close();
And then to read from it:
f = fso.OpenTextFile(filename, ForReading);
while (!f.AtEndOfStream) {
var r = f.ReadLine();
document.write (r + "<br />");
}
f.Close();
For more information about OpenTextFile, check out: http://msdn.microsoft.com/en-us/library/314cz14s(VS.85).aspx