PDA

View Full Version : Calling a big server side procedure



Zoumbatianos Kostas
06-09-2007, 05:15 PM
Hi all and thanks in advance.
What I am trying to do is call a big procedure on the server and not have the browser "stuck" until this procedure returns a result. I have a server side page that calls a big system procedure that takes some time to complete, until the procedure completes the page does not send any http response back to the browser. So when I ajax-call this page the javascript waits for it and can't do nothing in parallel. What I need is to show a "processing..." sign until the process is over. Does anyone have any ideas? Thanks.

my code is something like this:
<script>
blah blah
var a = open("url"); // Here is where it sticks and waits for the response
blah blah
</script>

jscheuer1
06-09-2007, 05:35 PM
That depends upon what else is going on with things. You mention AJAX, so I assume that this may be adding content to the existing page in a designated area, perhaps a division with an id of - say, 'loadarea'. If that is the case (using your example, ignoring any errors it may or may not have):


<script>
blah blah
document.getElementById('loadarea').innerHTML='Loading . . .';
var a = open("url"); // Here is where it sticks and waits for the response
blah blah
</script>

If you are literally loading an entire new page into the window or even into a new window you would want to have that new page have like:

Loading . . .

or an image that communicates that at the top before any code that activates the AJAX requests. When the requests returns ready, this may be removed by setting its display to none.