Hello,

I have been using the .keyup to produce a result list, after the third
letter in an input box.

so something like this (this is off the top of my head, syntax error
possible, but the real code works):
$('.myInput').livequery('keyup', function() {
  if ( $('.myInput').val().length > 2 ) {
    $.post('foo.php', { str: $('.myInput').val() }, function (data) { $
('.results').html(data); }
  }
});

I have been noticing this: If the user types quite (too) fast then the
responses come back in a different order then they were sent. So when
looking up "testword" it could be that the supposed final result would
be the query for "testw" because the response for "testword" had
already been displayed, but the response for "testw" came in last, and
therefore overwrote the intended final result.

How would you go about making sure the results come back in order they
were sent? I can't do it by string length, because theoretically the
last input could be shorter than the one prior to it (i.e. spell
correction).

Thanks
Casper


Reply via email to