title: File handling in JavaScript
body: <p>Is it possible in javaScript to create an html file in same directory ? After some searching on google I landed upon using ActiveXObject like this :-</p>
  
  <pre><code>var fso = new ActiveXObject("Scripting.FileSystemObject");
          varFileObject = fso.OpenTextFile("C:\apache-tomcat-7.0.23\webapps\proof\web.html", 2, true,0);
          varFileObject.write(data);
          varFileObject.close();
  </code></pre>
  
  <p>But it is showing an error which is ActiveXObject is not defined or does not exist. I am not sure why this error is coming. Is this code browser specific?
  I am using chrome and I need to write html file using javascript.
  Please help me what can i modify in above code so that it can run. Or help me with some other alternative.</p>