I’m making a ajax request to a page that does some expensive operations (re-indexing some database tables).
These take time, and I want to display progress messages until it finishes.
How can I do that? Is this possible? Because the javascript waits until the page has finished loading then displays all the messages…
Return one message per request. Keep making AJAX requests until a specific “done” response is received. This is how push or “COMET” works behind the scenes, you could use a proper push technology, too.
The hidden/implied point here is you shouldn’t be doing expensive operations on page scripts.