deanhiller
Programmer
I have an app, that every second sends an XMLHttpReqeust object out. In the same app when someone starts typing, I send a different XMLHttpRequest. When I put a 2 second delay in the server code handling the second one, I never receive it back. In fact any time, I get the response from the first request while the second is outstanding, I never get the second response.
I have tried using a different callback method for each request, firstResponseCallback, secondResponseCallback. When I do this, secondResponseCallback frequently receives the first request's reponse instead of the second one. It seems you can only have one outstanding XMLHttpRequest out at a time. Is there any way around this?
Is there any way to do synchronization in javascript? How do I deal with this? Without the sleep in the server, this problem is intermittent and very annoying. The sleep makes it happen every time.
I have tried using a different callback method for each request, firstResponseCallback, secondResponseCallback. When I do this, secondResponseCallback frequently receives the first request's reponse instead of the second one. It seems you can only have one outstanding XMLHttpRequest out at a time. Is there any way around this?
Is there any way to do synchronization in javascript? How do I deal with this? Without the sleep in the server, this problem is intermittent and very annoying. The sleep makes it happen every time.