Sign In/My Account | View Cart  
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Help please
Date: 2005-04-07 17:23:52
From: rkhlin
Response to: Concerns

XMLHTTPRequest is really fantastic to use.
But I am having a problem at the moment.
When I wrote a JS function which calls 1st url to change one div, then it calls another url to change another div.
However only the 2nd url call is executed, the function simply ignore the 1st call (so only div2 got updated).
Is there a way I can make sure it get the 1st url done and then the 2nd url sequentially, Since no multi-threaded is supported in current JS.
I used window.setTimeout(1000); in between 2 calls, then it wont go at all.


Please help!


Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Help please
    2005-04-07 23:22:37 rkhlin [Reply]

    Solved myself, use setTimeOut(func2,msec);

    • Help please
      2005-04-21 11:27:32 nGear [Reply]

      The second one is probably not coming through, because you donot wait for the first request to finish. (i.e. the readystate did not get to 4 in the eventhandler)
      So your current solution won't work if the server takes a long time to serve the xml for the first div.

      • Help please
        2005-05-27 12:52:36 brockweaver [Reply]

        See the response I just posted for a simple solution to this thread safety problem. I didn't notice this thread before I posted, sorry about that.


        The name of my post is something like "A threadsafe implementation of XMLHTTPRequest"


Sponsored By: