[jQuery] Re: Cancel Previous $.post request

2009-02-23 Thread Chintan Tank
Thanks a lot, Beres & James. On Tue, Feb 17, 2009 at 9:01 AM, Beres Botond wrote: > > Basically the main point of what James said is that you don't send the > request at all in the first place *instantly*.. only after > a small delay, so if the user keeps typing only one request will be > sent (

[jQuery] Re: Cancel Previous $.post request

2009-02-17 Thread Beres Botond
Basically the main point of what James said is that you don't send the request at all in the first place *instantly*.. only after a small delay, so if the user keeps typing only one request will be sent (the latest one) I assume you have a keyup event on the search input or similar... trying to k

[jQuery] Re: Cancel Previous $.post request

2009-02-15 Thread Chintan Tank
Thanx James for the reply. I am kind of a greenhorn in using Javascript/Jquery. I ddnt follow you exactly. This is the snippet of the code am talking about ... if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { var reque

[jQuery] Re: Cancel Previous $.post request

2009-02-15 Thread James
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