TS Moderator wrote:
> What standard talks ommouseover returning "true" or "false" and how it
> affects subsequent processing of the <a> element?
These are "DOM events", so their general behaviour is described in the
DOM standard.
In particular the concept of "event cancellation" is described in
general terms
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-cancelation
It doesn't talk about what happens when you cancel an event, it talks
vaguely about what doesn't happen, and even then it only says that "the
default action no longer happens". It certainly doesn't (correctly) try
to state _what_ this default action would have been. I'm not sure where
you'd even find any definition of what such a default action for a HTML
object would be -- it's even browser dependent, not standards based.
You might also notice that this standard for W3C DOM Level 2 bears
little relation to most live code! It talks about calling a
preventDefault() function to cancel events, when the usual approach is
to return false. This function return approach works fine, and it's the
DOM Level 0 definition put forward by Netscape somewhere back in the
mists of time. I don't have a good reference link for this, it's so
long ago.
In general, returning function values as false is simple and works
fine. The Level 2 approach is better because of another new feature it
added, that of registering multiple event handlers to a single event.
This is very useful when you start looking at window onload and similar
events, where you might have many event handlers all wanting a piece of
the action. It's too awkward to coordinate their function returns, so
the easiest approach is to use the preventDefault() function whenever
you need it (quite possibly more than once).
>> Stay informed about: Javascript / HTML Standard Question