W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: ACTION-70: Define the scope chain of onFoo events reference issue-1

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 16 Mar 2006 11:40:39 +0100
To: Jonas Sicking <jonas@sicking.cc>
Cc: Web APIs WG <public-webapi@w3.org>
Message-ID: <t5fi129052bs104pjjvhdbrqhvq66fitkc@hive.bjoern.hoehrmann.de>

* Jonas Sicking wrote:
>I don't see a point in telling people not to use it. It's there and it's 
>never going to go away. So if people think it's practical, why not let 
>them use it.

If I were to write a tutorial for this, I'd say that returning values
from such scripts triggers confusing, non-interoperable HTML quirks in
some implementations, don't do that...

>So the resulting code would be something like:
>
>function(event)
>{
>   if (HTML_LISTENER.call(this, event) ==
>        (event.type == "error" || event.type == "mouseover"))
>      event.preventDefault();
>}

Note that some browsers allow to uncancel the event by returning other
values as the event bubbles up the tree. And onerror="" is different
from most other onfoo="" attributes, in Mozilla the script would be
called with three arguments instead of one, and none of those arguments
is an Event object, for example.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Thursday, 16 March 2006 10:40:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:53 GMT