title: Javascript - Download CSV as File
body: <p>I'm messing with some javascript to download some csv text:</p>
  
  <pre><code>&lt;script&gt;
  var data = '"Column One","Column Two","Column Three"';
  window.location.href = 'data:text/csv;charset=UTF-8,' + encodeURIComponent(data);
  &lt;/script&gt;
  </code></pre>
  
  <p>So far this is working, but as the browser prompts me to save the file, there is no filename, nor extension.</p>
  
  <p>How can I predetermine the name of the file and it's extension, inside the <code>window.location.href</code> ?</p>