471,886 Members | 1,018 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,886 software developers and data experts.

onKeyup - cancel previous events if next char entered quickly?

I use the js onKeyup event to trigger server side db searches in a
hidden iframe page and generate a list of selectable items in the
parent page. The minimum characters to initiate a search is 3. I'm
trying to minimize the number of unnecessary db calls as much as I
can. It seems like if I type in 6 characters real fast then there's
only one db call after the last keyup, which is good .. but I'm not
sure. Maybe the previous calls for the 3rd,4th,5th do occur but
quickly cancelled/overridden by the next call. I'm looking for a way,
say, not to call the search after the 3rd keyup if the 4th,5th,.. are
entered real quick. Any ideas? Thanks.
Jul 23 '05 #1
1 4661
te***@yahoo.com wrote:
I use the js onKeyup event to trigger server side db searches in a
hidden iframe page and generate a list of selectable items in the
parent page.


Do not do that. It is error-prone and we do not have to discuss
the traffic and server load you create with this. Use the change
event or the click event of a button instead.

You could instead also retrieve the list once (when loading the
document) and store the database data in a client-side object,
then use only that object which would mean a considerable decrease
of network traffic and server load.
PointedEars
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Smith | last post: by
3 posts views Thread by MB | last post: by
8 posts views Thread by paul.sherwood | last post: by
3 posts views Thread by Brad | last post: by
13 posts views Thread by alvinwoon | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.