[Javascript] Re: ComboBox

Chris Tifer christ at saeweb.com
Fri Mar 21 14:27:46 CST 2003


> Indeed, that will work, but the penalty is that every keystroke event will
> poke the searchSelect routine.  I usually rig it so that a CR, tab, or a
> blur event triggers the parsing, just to keep the overhead down.  However,
> keystrokes are usually pretty minimal in the interrupt department, so I
> don't imagine it would hurt anything to do it your way.  [Plus you can
> correct them at the moment the syntax starts to go south, rather than
making
> them retype part of their entry].

True this will get called on every keystroke, but that's sort of the point.
Unless
you have a list of THOUSANDS of options or a 386, you're not going to see
any noticable delay in this script, but I know it helps to instantly see if
something
matches as soon as you press a key rather than having to perform some other
action
such as a CR (carraige return? Might submit form), tab and onblur (no need
for the
extra step)

Also, I really don't see a problem when this is used on the client-side.  If
it was
server side and some action was taken repeatedly, it'd be wise to optimize
since
there could be many concurrent connections, but I'm not a big proponent of
worrying about client-side speed as that's going to be less and less of an
issue
as time passes.

Chris Tifer
http://www.emailajoke.com



More information about the Javascript mailing list