title: How to Save a file at client side using JavaScript?
body: <p>I want to save a JSON object to a file at client to persist it for future usage, I have tried following line</p>
  
  <p><code>window.open("data:text/json;charset=utf-8," + escape(JSON.stringify(obj)));</code>  </p>
  
  <p>and it works!! Problem it asks user the location and name of the file for saving. What I want is I want the user completely unaware of the fact that something is being saved for future use or atleast keep it to minimum possible user clicks.</p>
  
  <p>How can I give the <strong>file name and location statically</strong> in <code>window.open()</code> ?</p>
  
  <p>Thanks in advance, </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Just to make it clear that " I don't store arbitrary or unwanted data. All the users are registered users of the system." In normal conditions I don't store anything locally. However I want to store some JSON objects if the network was not available at the time of form submission.</p>
  
  <p>One obvious solution will be to use cookies. Since Cookies can be accidentally deleted due to user's browser settings. I need a way to persist the data till the network becomes available. It will be greater to have cross browser support.</p>