How to capture the onload event of a window with attachment response?
<p>I have the following download request in javascript:</p>

<pre><code>var exportWindow = window.open('Download.ashx?source=1', '');
exportWindow.onload = function() { 
    alert('finished');
};
</code></pre>

<p>My problem is that the above alert box does not appear.
The download.ashx sets up the following response (which will be saved as a csv file), which works fine.</p>

<pre><code>        context.Response.ClearContent();
        context.Response.ContentType = "application/text";
        context.Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
        context.Response.Write(resultWriter.ToString());
        context.Response.Flush();
        context.Response.Close();
</code></pre>

<p>If I replace the download.ashx with a normal aspx page, then the alert appears.
So my question would be: is it possible to know programatically when the dowload.ashx returned with a response?
(using FF3)</p>

<p>Thanks in advance,
Geza</p>
