I am writing a script that hits against the server on keyup to populate a list, but I want to write something to keep the server from getting flooded as they are typing
My thought was to write a handler that would start a global variable countdown and send the request when the counter hit 0, with each subsequent keystroke resetting the counter. That way rapid keystrokes would not all be processed if the user was still typing or a scan gun was used, and only one AJAX request would be sent.
I have been working on this all week. I thought that this would be a common issue. Either I am missing something obvious, or I don't know the keywords to use in searching. If anyone could offer a suggestion, or better yet point me to a tutorial where this kind of thing is done, I would greatly appreciate it.
My thought was to write a handler that would start a global variable countdown and send the request when the counter hit 0, with each subsequent keystroke resetting the counter. That way rapid keystrokes would not all be processed if the user was still typing or a scan gun was used, and only one AJAX request would be sent.
I have been working on this all week. I thought that this would be a common issue. Either I am missing something obvious, or I don't know the keywords to use in searching. If anyone could offer a suggestion, or better yet point me to a tutorial where this kind of thing is done, I would greatly appreciate it.