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


Groups > comp.lang.javascript > #22391 > unrolled thread

DOM attributes on listener scope chain

Started byRobG <rgqld@iinet.net.au>
First post2013-12-25 11:04 +1000
Last post2014-01-07 19:42 +0100
Articles 10 — 5 participants

Back to article view | Back to comp.lang.javascript


Contents

  DOM attributes on listener scope chain RobG <rgqld@iinet.net.au> - 2013-12-25 11:04 +1000
    Re: DOM attributes on listener scope chain "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-24 19:38 -0800
      Re: DOM attributes on listener scope chain Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-12-25 10:23 -0200
      Re: DOM attributes on listener scope chain RobG <rgqld@iinet.net.au> - 2013-12-26 09:49 +1000
      Re: DOM attributes on listener scope chain RobG <rgqld@iinet.net.au> - 2013-12-26 11:05 +1000
    Re: DOM attributes on listener scope chain "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-24 19:47 -0800
      Re: DOM attributes on listener scope chain Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-25 22:42 +0100
        Re: DOM attributes on listener scope chain "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-12-25 13:52 -0800
    Re: DOM attributes on listener scope chain Andreas Bergmaier <andber93@web.de> - 2014-01-07 19:27 +0100
      Re: DOM attributes on listener scope chain Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-07 19:42 +0100

#22391 — DOM attributes on listener scope chain

FromRobG <rgqld@iinet.net.au>
Date2013-12-25 11:04 +1000
SubjectDOM attributes on listener scope chain
Message-ID<4-KdnZdprtC0sifPnZ2dnUVZ_rKdnZ2d@westnet.com.au>
It seems that for an inline listener, the attributes of the DOM element 
its attached to are included as variables on a kind of variable object 
inserted as the first object on the listener's scope chain (like the 
behaviour of _with_), e.g.

     <button id="foo" onclick="alert(id);">Show ID</buton>

Clicking the above button shows "foo".

This behaviour is included in the whatWG's "HTML Living Standard" 
section 7.1.5.1[1], which indicates that it's sufficiently well 
supported to be considered current browser behaviour.

Does anyone know the history of this feature? It seems little used and 
rarely documented, I know PointedEars has looked into it in the past but 
I can't find references.

1. 
http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handler-attributes

-- 
Rob

[toc] | [next] | [standalone]


#22395

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2013-12-24 19:38 -0800
Message-ID<3dcadb95-700a-4ae4-84d6-767eaadc3f89@googlegroups.com>
In reply to#22391
On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
> It seems that for an inline listener, the attributes of the DOM element 
> its attached to are included as variables on a kind of variable object 
> inserted as the first object on the listener's scope chain (like the 
> behaviour of _with_), e.g.
> 
>      <button id="foo" onclick="alert(id);">Show ID</buton>
> 
> Clicking the above button shows "foo".
> 
> This behaviour is included in the whatWG's "HTML Living Standard" 
> section 7.1.5.1[1], which indicates that it's sufficiently well 
> supported to be considered current browser behaviour.
> 
> Does anyone know the history of this feature? It seems little used and 
> rarely documented, I know PointedEars has looked into it in the past but 
> I can't find references.

Thomas, Brendan Eich, and myself discussed this on Twitter not long ago:

https://twitter.com/mlhaufe/status/405024792627007488

[toc] | [prev] | [next] | [standalone]


#22397

FromJoao Rodrigues <groups_jr-1@yahoo.com.br>
Date2013-12-25 10:23 -0200
Message-ID<l9einl$eu6$1@speranza.aioe.org>
In reply to#22395
On 25/12/2013 01:38, Michael Haufe (TNO) wrote:
> On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
>> It seems that for an inline listener, the attributes of the DOM element
>> its attached to are included as variables on a kind of variable object
>> inserted as the first object on the listener's scope chain (like the
>> behaviour of _with_), e.g.
>>
>>       <button id="foo" onclick="alert(id);">Show ID</buton>
>>
>> Clicking the above button shows "foo".
>>
>> This behaviour is included in the whatWG's "HTML Living Standard"
>> section 7.1.5.1[1], which indicates that it's sufficiently well
>> supported to be considered current browser behaviour.
>>
>> Does anyone know the history of this feature? It seems little used and
>> rarely documented, I know PointedEars has looked into it in the past but
>> I can't find references.
>
> Thomas, Brendan Eich, and myself discussed this on Twitter not long ago:
>
> https://twitter.com/mlhaufe/status/405024792627007488
>

Watching Thomas repeating one of his mantras ("your argument is flawed") 
to Brendan Eich is priceless!

-- 
Joao Rodrigues

[toc] | [prev] | [next] | [standalone]


#22406

FromRobG <rgqld@iinet.net.au>
Date2013-12-26 09:49 +1000
Message-ID<52BB6F07.6010205@iinet.net.au>
In reply to#22395
On 25/12/2013 1:38 pm, Michael Haufe (TNO) wrote:
> On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
>> It seems that for an inline listener, the attributes of the DOM element
>> its attached to are included as variables on a kind of variable object
>> inserted as the first object on the listener's scope chain (like the
>> behaviour of _with_), e.g.
[...]
>> Does anyone know the history of this feature? It seems little used and
>> rarely documented, I know PointedEars has looked into it in the past but
>> I can't find references.
>
> Thomas, Brendan Eich, and myself discussed this on Twitter not long ago:
>
> https://twitter.com/mlhaufe/status/405024792627007488

Thanks, your link lead me to eventually find a Thomas post on StackOverflow:

http://stackoverflow.com/questions/9158238/why-js-function-name-conflicts-with-element-id


-- 
Rob

[toc] | [prev] | [next] | [standalone]


#22407

FromRobG <rgqld@iinet.net.au>
Date2013-12-26 11:05 +1000
Message-ID<52BB80CF.3000905@iinet.net.au>
In reply to#22395
On 25/12/2013 1:38 pm, Michael Haufe (TNO) wrote:
> On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
>> It seems that for an inline listener, the attributes of the DOM element
>> its attached to are included as variables on a kind of variable object
>> inserted as the first object on the listener's scope chain (like the
>> behaviour of _with_), e.g.
[...]
>> Does anyone know the history of this feature? It seems little used and
>> rarely documented, I know PointedEars has looked into it in the past but
>> I can't find references.
>
> Thomas, Brendan Eich, and myself discussed this on Twitter not long ago:
>
> https://twitter.com/mlhaufe/status/405024792627007488

Thanks, your link lead me to eventually find a Thomas post on StackOverflow:

http://stackoverflow.com/questions/9158238/why-js-function-name-conflicts-with-element-id


-- 
Rob

[toc] | [prev] | [next] | [standalone]


#22401

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2013-12-24 19:47 -0800
Message-ID<7b387e55-5dda-4c72-a4b2-ae4daf9404a3@googlegroups.com>
In reply to#22391
On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
...
> Does anyone know the history of this feature? It seems little used and 
> rarely documented, I know PointedEars has looked into it in the past but 
> I can't find references.

IIRC this was initially a "feature" of IE due to document.all + VBScript. There is still a significant community around the latter which rely on this "feature". I'll try to dig up some old articles...

[toc] | [prev] | [next] | [standalone]


#22402

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-12-25 22:42 +0100
Message-ID<2531419.sRAszf16aN@PointedEars.de>
In reply to#22401
Michael Haufe (TNO) wrote:

> On Tuesday, December 24, 2013 7:04:35 PM UTC-6, RobG wrote:
> ...
>> Does anyone know the history of this feature? It seems little used and
>> rarely documented, I know PointedEars has looked into it in the past but
>> I can't find references.
> 
> IIRC this was initially a "feature" of IE due to document.all + VBScript.

No; as I wrote on Twitter [1], referring to my answer at Stack Overflow [2], 
that scope chain augmentation was part of the original JavaScript makeup 
already – in order to make it easier for beginners –, when there was no 
distinction between language and AOM/DOM.  References are at Stack Overflow 
as well.

[1] <https://twitter.com/PointedEars2/status/404987315061149696>
[2] <http://stackoverflow.com/a/9160009/855543>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#22417

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2013-12-25 13:52 -0800
Message-ID<ae4ecefb-966e-4019-8868-b42d534b5bb7@googlegroups.com>
In reply to#22402
On Wednesday, December 25, 2013 3:42:15 PM UTC-6, Thomas 'PointedEars' Lahn wrote:
> 
> No; as I wrote on Twitter [1], referring to my answer at Stack Overflow [2], 
> that scope chain augmentation was part of the original JavaScript makeup 
> already – in order to make it easier for beginners –, when there was no 
> distinction between language and AOM/DOM.  References are at Stack Overflow 
> as well.
> 
> [1] <https://twitter.com/PointedEars2/status/404987315061149696>
> [2] <http://stackoverflow.com/a/9160009/855543>

Thanks

[toc] | [prev] | [next] | [standalone]


#22536

FromAndreas Bergmaier <andber93@web.de>
Date2014-01-07 19:27 +0100
Message-ID<lahgv8$bv0$1@news.albasani.net>
In reply to#22391
RobG schrieb:

> It seems little used and rarely documented, I know PointedEars has
 > looked into it in the past but  I can't find references.

I found <http://jibbering.com/faq/names/event_handler.html> quite useful

[toc] | [prev] | [next] | [standalone]


#22537

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-01-07 19:42 +0100
Message-ID<3414133.ZbqarTrTka@PointedEars.de>
In reply to#22536
Andreas Bergmaier wrote:

> RobG schrieb:
>> It seems little used and rarely documented, I know PointedEars has
>  > looked into it in the past but  I can't find references.
> 
> I found <http://jibbering.com/faq/names/event_handler.html> quite useful

To be corrected and updated on 
<http://PointedEars.de/faq/names/event_handler.html>.

-- 
PointedEars, ed.

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web