1.

How can we read and write a file by using JavaScript?

Answer»

How can we read and WRITE a file by using JavaScript?
There are 2 ways to read and write a file using Javascript
(1)First is by using ActiveX objects and code is given below
var fsoobject = new ActiveXObject("Scripting.FileSystemObject");
var sobject = fso.OpenTextFile("C: testexample.txt", 1, true);


(2)By using JavaScript extensions
fh = fopen(getScriptPath(), 0); to OPEN a file



Discussion

No Comment Found