Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2988771.dbgypaU67u@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Fri, 06 Apr 2012 22:22:25 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Event Bubbling: Bubble, Bubble, Toil, and Trouble Newsgroups: comp.lang.javascript References: <497sn7hj3iepoc4r9940di8l10ed8bvhl6@4ax.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 50 NNTP-Posting-Date: 06 Apr 2012 22:22:27 CEST NNTP-Posting-Host: 20c2660c.newsspool3.arcor-online.net X-Trace: DXC=ch>98P;dA9iOKO]LCQ@0g`McF=Q^Z^V3h4Fo<]lROoRa8kFK`fQ>EOE\[m`k0NUmTeIAnga X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:13265 Matt McDonald wrote: > On 12-04-05 04:36 PM, Gene Wirchenko wrote: >> I have added onfocus and onblur clauses to my page's tag, >> but the events rarely fire. I have the event code add a line to the >> innerHTML of a debug out table element. >> >> My debug output routine works fine. The test messages get >> written. The only control that the bubbling messages work on is the >> Quit button. It does not work for any other buttons or any of the >> input controls. > > Both the `onfocus`[0] and `onblur`[1] events do not bubble in > most environments. I'd advise against relying on that behavior. For that, please see (and update) . > However, both the `onfocusin`[2] and `onfocusout`[3] events have > been observed to bubble—though the corresponding MSDN > documentation says otherwise—in Internet Explorer. You may want > to consider those two events. I've provided a test[4]¹ that > confirms my suspicions. However, one should always take the MSDN Library with a handful of salt and should not subscribe to Microsoft's proprietary/outdated¹ redefinition of what is an event. The referred names are the names of _event handlers_; the corresponding (W3C DOM) event( type)s are `focus' and `blur'. There is no standard equivalent for `onfocusin' and `onfocusout' yet, although there is work in progress aiming to standardize them as the event handlers for the `focusin' and `focusout' events, respectively. (LC WD) (Editor's Draft) PointedEars ___________ ¹ It is curious that even though IE 9 finally supports the W3C DOM event model as evident by the support of EventTarget::addEventListener() in Standards Mode, the MSDN Library editors have still not managed to fix their – at best misleading – terminology. -- > If you get a bunch of authors […] that state the same "best practices" > in any programming language, then you can bet who is wrong or right... Not with javascript. Nonsense propagates like wildfire in this field. -- Richard Cornford, comp.lang.javascript, 2011-11-14