Results 1 to 2 of 2

Thread: Calling a big server side procedure

  1. #1
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Calling a big server side procedure

    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>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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):

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •