jQuery Table to CSV export
<p>I'm using the jQuery Table to CSV Plugin.  I've altered the popup so that it tells the browser to download a CSV file.</p>

<p>It was:</p>

<pre><code>function popup(data) {
  var generator = window.open('', 'csv', 'height=400,width=600'); 
  generator.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;CSV&lt;/title&gt;'); 
  generator.document.write('&lt;/head&gt;&lt;body &gt;'); 
  generator.document.write('&lt;textArea cols=70 rows=15 wrap="off" &gt;'); 
  generator.document.write(data); 
  generator.document.write('&lt;/textArea&gt;'); 
  generator.document.write('&lt;/body&gt;&lt;/html&gt;'); 
  generator.document.close();
  return true; 
}
</code></pre>

<p>I've changed it to:</p>

<pre><code>function popup(data) {
  window.location='data:text/csv;charset=utf8,' + encodeURIComponent(data);
  return true; 
}
</code></pre>

<p>It works, for the most part.  It still requires that you find your spreadsheet software, and create your own filename...because it creates a strange file name (Example: 14YuskG_.csv.part).</p>

<p>Any suggestions on how to improve this?</p>
