1.

How To Read And Write A File Using Java Script?

Answer»

This can be done in TWO ways which are discussed below,
1. Using an ActiveX objects (Internet Explorer only)
Using ActiveX objects, following should be INCLUDED in the code to read a file
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("C:\\example.txt", 1, true);
2. By the use of JavaScript EXTENSIONS which RUNS from the Java Script EDITOR.
In JavaScript Extensions,
fh = fopen(getScriptPath(), 0); to open a file

This can be done in two ways which are discussed below,
1. Using an ActiveX objects (Internet Explorer only)
Using ActiveX objects, following should be included in the code to read a file
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("C:\\example.txt", 1, true);
2. By the use of JavaScript extensions which runs from the Java Script editor.
In JavaScript Extensions,
fh = fopen(getScriptPath(), 0); to open a file



Discussion

No Comment Found