You are here: irt.org | FAQ | JavaScript | File | Q994 [ previous next ]
Only in Netscape Navigator 4+ after requesting extra priviledges:
<script language="JavaScript"><!-- function writeToFile(fileName,text) { netscape.security.PrivilegeManager.enablePrivilege('UniversalFileAccess'); var fileWriter = new java.io.FileWriter(fileName); fileWriter.write (text, 0, text.length); fileWriter.close(); } if (document.layers) { writeToFile('file.txt','Hello World'); } //--></script>