javascript - onkeyup Event Firing delay -
i have input textbox people enter username, has onkeyup
event attribute attached fires off ajax request check if username taken.
what delay between first key second ? meaning if type 5 letter word 1 letter after other. ajax fire 5 times ?
if there no delay, "computationally expensive" since there many database queries ? or there no noticeable difference ?
if there difference in performance, methods take using javascript check if user "done" typing. still want automatically check after typing. ruling out
onblur
attributes etc.
my code: http://pastebin.com/hxfgk7nl
(code indentation wasn't working me on stack overflow)
yes, fire every key-up event. can reduce performance hit using following approach.
i sure must have minimum character length username. wait until user type number of characters query database.
you bring usernames starting user typed username , process in local memory. may not real time reduce number database queries. depend on size of current user list.
double check existence of username before saving database.
Comments
Post a Comment