So, I am calling an AJAX request for each keyup
and paste
event in jQuery in a text box:
$("#server-label").bind("keyup paste", function() { $.ajax()... });
The problem is that there are too many AJAX requests if the user quickly presses the keys. What is the best way to wait until users stop typing for a few minutes (say 500ms) before calling an AJAX request. Basically, do not make an AJAX request until events with keys or inserts are triggered for 500 ms.
Thanks.
source share