Home Best way to handle Search in Ajax request
 I have search result on keyup event following is my code which if firing on keyup event  function GetAllThirdParty(pageIndex, Type) { $.ajax({ type: "POST", url: "ManageThirdParty.aspx/GetAllThirdParty", contentType: "application/json; charset=utf-8", data: '{Category: "' +$('#ddlCategoryFilter option:selected').attr('data-category') + '", pageIndex: ' + pageIndex + ', ' + 'PageSize: ' + $('#ddlRecordsPerPage').val() + ', searchTerm: "' + SearchTerm() + '", Alphabate: "' +$('#hdnAlphabate').val() + '"}', beforeSend: function () { $('#tblThirdParty').dataTable().fnDestroy();$('#tblThirdParty > tbody').empty(); }, success: function (data) { } }); }  When I am typing slower the search result is perfect, but whenever I am typing faster(for same word) search result giving me wrong data because firingup GetAllThirdParty() without completing up current execution. If I set timeout then search result giving me correct result but it takes lots of time to execute. How to overcome this situation?