Have a loading animation while server-side is working
-
Hello! I have a page from which the user can export data. This can take quite a while if alof of data is to be exported. I have tried showing a loading animation(.gif) while the user waits, but to no avail. I got it working in firefox by appending a gif-image to the page using javascript when user clicks submit-button, but in IE the gif-image shows fine but doesnt move. Anyone got an idea how to achieve this?
-
Hello! I have a page from which the user can export data. This can take quite a while if alof of data is to be exported. I have tried showing a loading animation(.gif) while the user waits, but to no avail. I got it working in firefox by appending a gif-image to the page using javascript when user clicks submit-button, but in IE the gif-image shows fine but doesnt move. Anyone got an idea how to achieve this?
The easiest way to do this is to start sending the server response immediately - just the start of a document with progress indicator - and not finish the response until your task is complete. The downside of this technique is two-fold: you're limited in how long you can keep a connection open, and you're keeping a connection open the entire time; if you expect more than a handful of simultaneous users, this will kill your server. More efficient techniques can make use of AJAX, META-refresh, or script-driven postback. CP has a number of articles on the subject[^].
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
-
The easiest way to do this is to start sending the server response immediately - just the start of a document with progress indicator - and not finish the response until your task is complete. The downside of this technique is two-fold: you're limited in how long you can keep a connection open, and you're keeping a connection open the entire time; if you expect more than a handful of simultaneous users, this will kill your server. More efficient techniques can make use of AJAX, META-refresh, or script-driven postback. CP has a number of articles on the subject[^].
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.