title: Create log text file using Javascript
body: <p>I have been trying to do this with no luck so I've decided to ask SO.</p>
  
  <p>I have a page with a bunch of different buttons and each button has it own parameters.</p>
  
  <p>I want to create a .txt file as a log and then every time someone clicks on one of the buttons write in the log with the parameters and the button that was clicked.
  Each button has its own function so I'm assuming I would just create the function and then add it at the beginning of each function using the function's parameters.</p>
  
  <p>So I would need to create the txt file using onLoad() I guess, and then create a function to write in the .txt file every time a button is clicked.</p>
  
  <p>I tried:</p>
  
  <pre><code>function WriteToFile(passForm) {
  
      set fso = CreateObject("Scripting.FileSystemObject");  
      set s = fso.CreateTextFile("logs\log1.txt", True);
      s.writeline("HI");
      s.writeline("Bye");
      s.writeline("-----------------------------");
      s.Close();
   }
  </code></pre>
  
  <p>but had no luck and I get an error saying Object expected at the beginning of the <code>set fso</code> line.</p>
  
  <p>Any ideas on how to solve this or implement it in a better way?</p>
  
  <p><strong>UPDATE</strong>
  So I just want to create a log file and get filled with data every time a user clicks on a buttons just so I know who is clicking what. All of my files are in a server so I just want to create the text file there and fill it out with information.</p>