jQuery.ajax(): discard slow requests

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-06-15T17:53:45Z Indexed on 2010/06/15 18:02 UTC
Read the original article Hit count: 374

Filed under:
|
|

I've build a livesearch with the jQuery.ajax() method. On every keyup events it receives new result data from the server.

The problem is, when I'm typing very fast, e.g. "foobar" and the GET request of "fooba" requires more time than the "foobar" request, the results of "fooba" are shown.

To handle this with the timeout parameter is impossible, I think.

Has anyone an idea how to solve this?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX