Forum Moderators: open
I have an ajax script I'm using that simply checks if a username is available (does a REALLY simple mysql_query).
It's triggered onkeyup. Now, if I type slow it seems to work. If I type fast, it (after a couple characters) stops returning anything (like too many AJAX requests are happening?)
Any way I can check if there's already a request processing? Or ... not sure really, how would you fix this?
Thanks!
Any way I can check if there's already a request processing?
Also consider inserting small delay before sending, reset after each keystroke, so fast typing will not trigger search early.
Also I'm thinking I can have my ajax function check if there's a already a request going and stop it (and start the new one). I tried using setTimeout to make it wait a second or two (thus eliminating a new request the moment a user types a letter).
So if I have a span with an id, how can I null it? Sounds like a feasible idea :)
Also I'm thinking I can have my ajax function check if there's a already a request going and stop it
You may not gain must be canceling request, as sql request has probably started, simpler ? to wait for reply and issue new request.
I tried using setTimeout to make it wait a second or two