-4

I am trying to create and edit a text file usinf Javascript.

I have used the following code. But it returns an error.

SyntaxError: missing ; before statement

var fso = CreateObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("I:\Satheesh\test.txt", True);
s.writeline("HI");
s.close

Please note that my Javascript should run only on firefox.

Thanks in Advance

Tracey
  • 3
  • 4

1 Answers1

0

I see that you've edited the question.

The original error you were getting:

SyntaxError: missing ; before statement

Is caused by the "set" before the first variable name:

set fso = CreateObject("Scripting.FileSystemObject");

Which is not valid Javascript. You've (correctly) changed "set" to "var".

var fso = CreateObject("Scripting.FileSystemObject");

So I expect that error message has now gone away - in which case your original question is answered.

Lqueryvg
  • 202
  • 3
  • 9