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 request = $.post("AJAXModule.php", {
                                 queryString: ""+inputString+""},
                         function(data){
                                 if(data.length >0) {

                                 console.log(data);

                                 }
                         });
        }

Also I want to make sure that the most current request is satisfied and not
anything older than the current. Can you help me with that?


~ Chintan


On Sun, Feb 15, 2009 at 3:20 PM, James <james.gp....@gmail.com> wrote:

>
> 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/<http://www.cs.indiana.edu/%7Ecdtank/>
>

Reply via email to