Here's my Jquery (just the part that retrieves info from the DB and what it displays):
if(input!='')
{
$.ajax({
url: "http://mysearch.mydomain.title?s=jsonp",
dataType: "jsonp",
data: {
q: input
},
success: function( data ) {
var i = 0;
$.map( data, function( value ) {
$(".hint").append("<li><a href="">" + value + "</a></li>");
});
}
});
}
I want to limit this to 5 results and everytime I press a key, it "resets" (so the li's don't stay on html).
Thanks.