[Jslib] Re: How to use jslib in local machine
Pete Collins
pete@mozdev.org
Thu, 13 Feb 2003 13:23:29 -0500
> f.open();
> var passwd=f.readline();
> textfield1 = document.getElementById("tf1");
> alert("***** after open");
> textfield1.setAttribute("value", passwd);
> alert("***** after new file");
> f.close();
If the password text file is just one line use read()
var passwd=f.read();
readline needs to be used from a loop like this:
while(!f.EOF) {
var theFileContentsLine = file.readline();
dump("line: "+theFileContentsLine+"\n");
}
This sample is posted in the head comment in file.js
Hope this helps
--pete