I am looking for a way to show in a webapp in front of a task a wait-message and after it hide the message. The task is running a longer time. I dont know if it is possible at all.
The problem is, so far I can see, that the site will be returned to the users browser AFTER the task is completed because the task is part of the site as a inline code replaces by the webserver interpreter (no matter if PHP, Perl or whatever).
The only solution I can imagine is to parallel the task with threads or processes and requery the state with ajax in the website.
Any idea to do it less complex? Thanks for help!
The server should start sending content to the browser as soon as your code starts executing; it does not wait for the server-side code to finish first.
Therefore, you can just run the task after rendering the HTML containing the wait message. After the task, you can render a
<script>block that hides the wait message.