Topic: drop response if from earlier request
i'm currently trying to implement an autosuggest solution and running into some asynchronous call problems.
In my script i type into a text field and every keystroke invokes an xajax call, doing a mysql query. But the time to get a response from mysql varies greatly, so it might happen, that the result from an earlier request is sent back to the client later than the most recent request.
So my script might display the older response because it was sent back later thant the response from the newest request.
If i would use synchronous calls, which I tried, the user always has to wait for the response, before he can go on typing another letter into the form input field.
What would be a good solution for this? Can anyone help me?