Note that there are some explanatory texts on larger screens.

plurals
  1. POFire javascript code when download finishes
    text
    copied!<p>I need to update a pair of old classic asp pages&mdash; a <code>search.asp</code> page that provides a simple form which is then posted to a <code>results.asp</code> page. One of the form options on the search page is a drop down list (<code>&lt;select</code>) for the "format". If the user chooses the excel format the results page just sets the Response.ContentType to <code>application/vnd.ms-excel</code> and adds a content-disposition header to set the file name and make it an attachment. That's it: it's up to excel to then correctly render the html, and it generally does a pretty good job.</p> <p>All that works pretty well, except for one thing. The reason for the Excel option is that in this case the users really do want to see as many as 10,000 items or even more for a single search. They'll use Excel to do some additional analysis on the results. So the search operation typically takes just over a minute and I can't change that. </p> <p>The user experience during that minute is less than ideal. Not only is the user just sitting there with little to no feedback, but there are often enough results that the page overflows the response buffer. This means the page has to flush periodically, and therefore the file starts downloading right away but the download manager isn't able to provide meaningful feedback by itself. My mission is to improve the situation.</p> <p>The first step is to just show a simple <code>processing...</code> message on the search page when the form submits, and I can do that easily enough. In fact, it's been doing this already for the "HTML" format option. The problem is that when downloading the Excel file I don't know how to tell anything about the download so I can hide the message again, and the existing implementation doesn't provide any feedback on download progress at all. Any ideas? If I can just get a javascript function to fire when the download completes I can hook just about anything to that, but I can't even do that yet.</p> <p><strong>Update:</strong><br> I re-worded the question to try to present the problem more clearly.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload