I'm trying to create a text file using javascript (online) with the following code:
<html>
<head>
<script>
function WriteToFile(passForm) {
var fso = CreateObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("profile/test.txt", True);
s.writeline("HI");
s.writeline("Bye");
s.writeline("-----------------------------");
s.Close();
}
</script>
</head>
<body>
<p>To sign up for the Excel workshop please fill out the form below:
</p>
<form onsubmit="WriteToFile(this)">
Type your first name:
<input type="text" name="FirstName" size="20">
<br>Type your last name:
<input type="text" name="LastName" size="20">
<br>
<input type="submit" value="submit">
</form>
</body>
However, I receive the error:
Uncaught SyntaxError: Unexpected identifier
with the set fso line.
I hope someone can help me here