-1

I have some links that when the user clicks one, it links to a php script which runs some stored procedures to generate data and then calls another script to download the data as an excel spreadsheet. This all works fine.

What I'd like to do is have a loader gif appear beside the link that was clicked clicked and when the dialog appears to get the user to save the file, have that gif disappear again.

Can I track this event at all to achieve this? Not had much luck so far.

vinman75
  • 101
  • 3
  • 11
  • what have you tried so far ? and you can look here http://stackoverflow.com/questions/68485/how-to-show-loading-spinner-in-jquery – riso Apr 12 '12 at 09:41

1 Answers1

2

I would call the generate script as ajax, and use the success and error functions to recognize completion of the script? THen you can just start the animation, call your script, and when it returns you can cancel the animation.

Nanne
  • 61,952
  • 16
  • 112
  • 157
  • Tried that, problem here is that when the script processes it sets the content headers to allow the download of the generated file. I could get the content this way, but not generate the dialog to save. – vinman75 Apr 12 '12 at 09:45
  • I also would be interested in this. Same problem at me: download is generated on server site, which is time consuming,, about 5-10 sec till file save dialog appears, until I would like to show a "watit for the download" message. And let it disappear when no need for it anymore. – Konstantin Jul 02 '16 at 03:49