Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13265

Re: Event Bubbling: Bubble, Bubble, Toil, and Trouble

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> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
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> <jllm22$udd$1@dont-email.me>
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<]lROoRa8kF<OcfhCOk^lTfTJk=GAfDZm8W4\YJNlJ`:FmdeL>K`fQ>EOE\[m`k0NUmTeIAnga
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:13265

Followups directed to: comp.lang.javascript

Show key headers only | View raw


Matt McDonald wrote:

> On 12-04-05 04:36 PM, Gene Wirchenko wrote:
>> I have added onfocus and onblur clauses to my page's<body>  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) 
<https://developer.mozilla.org/en/DOM_Client_Object_Cross-
Reference/DOM_Events>.

> 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.

<http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113>
<http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531> (LC WD)
<http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html> 
(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

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Event Bubbling: Bubble, Bubble, Toil, and Trouble Gene Wirchenko <genew@ocis.net> - 2012-04-05 15:36 -0700
  Re: Event Bubbling: Bubble, Bubble, Toil, and Trouble "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-05 22:50 +0000
  Re: Event Bubbling: Bubble, Bubble, Toil, and Trouble Matt McDonald <matt@fortybelow.ca> - 2012-04-05 20:57 -0600
    Re: Event Bubbling: Bubble, Bubble, Toil, and Trouble Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-06 22:22 +0200

csiph-web