title: javascript: how to show spinner until file downloads
body: <p>I have a button to download an excel file.  When the user clicks the button, the onClick function calls
  window.location= url</p>
  
  <p>and when the downloading is done, the save as dialog popups with the file.</p>
  
  <p>Now, I want to show a spinner until the file dialog appears. How do I do this?</p>
  
  <p>I tried to create a spinner before "window.location" and hide it after that, but the spinner goes away immediately because window.location does not block until the file downloads.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks.</p>