$("-sharpsearch").on("keyup",function (e) {
e.preventDefault();
if($(this).val().length > 0){
$.ajax({
type: "GET",
url: "search",
data: "search="+$("-sharpsearchbar").val(),
success: function(data){
$("-sharpsearch-result-display").html(data);
}
});
}
});
I now have a problem
but I have joined if ($(this). Val (). Length > 0) {
but if there are five words
he will send out requests five times.
means that I will see search-result-display
this event five times.
is there any way to improve this situation?