You could use a queue of requests, such that 6 won't be sent until 5
has returned.  It puts a bit of a bottleneck on the XHRs but will
maintain a stable sequence.  I've written an article on how to
approach something like this, review at your leisure,

On Sep 10, 7:59 am, doug <[EMAIL PROTECTED]> wrote:
> I am making a web page with autocomplete on search terms.  Of course
> the responses do not come back in the order sent.  How can I solve
> this problem?  This is how I was thinking of doing it:
> Somehow mark all of the request objects with the order the request was
> sent out. If a request comes back out of order, for example 6 comes
> back then 5, I can throw 5 away.
> However, I can not figure out a way to either
> 1. Mark the request object with a number, and retrieve that number in
> the callback.
> 2. In some other way allow the callback to be sent the number
> representing the order.
> Can some one help?  Is there a better way?
> thanks,
> -d
You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to