Usually auto-complete features implement a request delay (using
setTimeout), for example 300ms, before initiating the request. If a
user types a character, the setTimeout goes, and if the user types
another character within that timeout, it'll clear that timeout
(clearTimeout) so the request will not be executed until another
300ms.

On Feb 15, 7:28 am, Chintan Tank <tankchin...@gmail.com> wrote:
> Hi,
> I am using the jquery + $.post to create an auto-suggest feature. I wanted
> to know if there is a way to cancel previous post requests.
> For example this is how it is happening now..
>
> User types in "*jquery*"
>
> so my app sends request for *j, jq, jqu, jque, jquer, jquery* ....
> and depending on which request is satisfied first it displays the result.
> i want that once the user types in *"jqu"* the app should abort the request
> for "*jq*".
> is that possible? that would be great help.. solving both inconsitency &
> time issue.
>
> --
> Regards,
>
> Chintan D. Tank
> Graduate Student
> Department of Computer Science
> Indiana University, Bloomington.
>
> http://www.cs.indiana.edu/~cdtank/

Reply via email to