[Javascript] JSON element has no properties - how to validate?
Michael Borchers
list at tridemail.de
Mon Nov 26 02:12:53 CST 2007
----- Original Message -----
From: "David Lovering" <dlovering at gazos.com>
To: "JavaScript List" <javascript at lists.evolt.org>
Sent: Thursday, November 22, 2007 4:15 PM
Subject: Re: [Javascript] JSON element has no properties - how to validate?
> My guess is that the multiple triggers are being caused by a failure of
> the
> keyboard event handler, either in the browser or in the
> system's window-manager. I suspect this may hearken back to a buggy
> "auto-key-repeat" glitch in the OS, but of course that is pure
> speculation.
>
> One way to (possibly) beat the problem is to assign a state-value to "foo"
> that remains null until such time as the function is invoked, and then
> change state upon first return from the AJAX handler. Reset this flag
> only
> when the form or field is scrubbed, so that you won't get phantom
> triggers.
> If the flag is set when the function foo triggers, simply exit without
> further action.
>
> The alternative strategy is to see if the false triggering occurs
> before/after the AJAX call, as you may be seeing a fast response on one
> event/call and some appreciable latency on the other. Obviously, the
> pairing will only work as fast as the slowest part of the whole while the
> fast portion will fire off like a machine gun.
>
> One of the headaches of using keyboard event handlers to deal with calls
> to
> AJAX is that each browser tends to handle onkeyup, onkeypress, onchange
> events differently - some are quite bizarre.
>
> -- Dave Lovering
Great info and some good ideas! Thanks very much, Dave!!
More information about the Javascript
mailing list