I have the following jquery code that basically acts as a auto complete for an input. However, when the user types in something fairly quickly (or at normal pace for some people) the dropdown flickers back and forth between different autocompletes. Like if I type in "happy" very quickly, it might flicker between "happy" and "happiness". I think this is being caused by a delay between when the data is sent and recieved.. Any way to fix this?
var textvalue= $(this).val();
$("#facebookDropdown").html("
loading...
");
$.ajax({
type: "GET",
url: "../invites/afterauth.php",
data: "q=" + textvalue,
success:
function(msg){
$("#facebookDropdown").html(msg)}
})