Open save as dialog on newly opened window
<p>How in JS/jQuery do I pop open the "Save As" dialog for a newly opened window.  Basically I am scraping some data off of a web page.  As such I am opening a new window via:</p>

<pre><code>dataWindow = window.open('blank','dataWindow');
</code></pre>

<p>I then write the output to the blank window but I want to automatically pop open the "Save As" dialog to save the content of the window to a file (text/csv).  How would I do this.  I tried:</p>

<pre><code>dataWindow.document.execCommand("saveAs",true,".txt");
</code></pre>

<p>but it doesn't seem to do anything.</p>
