[Proto-Scripty] Binding functions to $$ directly

2010-05-10 Thread Phonethics
How come I got to this $$('#div1 p span.someclassName').each(function(el) { Event.observe(el, 'click', function(event) { alert('a'); }); }); instead of something like this ? $$('#div1 p span.someclassName').observe('click', function(el) { alert('b'); }); Any way to get

RE: [Proto-Scripty] Binding functions to $$ directly

2010-05-10 Thread Jonathan Rosenberg
-scriptacul...@googlegroups.com] On Behalf Of Phonethics Sent: Monday, May 10, 2010 10:43 AM To: Prototype script.aculo.us Subject: [Proto-Scripty] Binding functions to $$ directly How come I got to this $$('#div1 p span.someclassName').each(function(el) { Event.observe(el, 'click', function

Re: [Proto-Scripty] Binding functions to $$ directly

2010-05-10 Thread Walter Lee Davis
jQuery conflates the meaning of $ and $$ in a useful manner, but Prototype provides the invoke function to shortcut what you are doing here. $$('#div1 p span.someclassName').invoke('observe','click', function(el) { alert('b'); }); To my mind, it's a little less magic and a lot more

Re: [Proto-Scripty] Binding functions to $$ directly

2010-05-10 Thread Alex McAuley
: [Proto-Scripty] Binding functions to $$ directly jQuery conflates the meaning of $ and $$ in a useful manner, but Prototype provides the invoke function to shortcut what you are doing here. $$('#div1 p span.someclassName').invoke('observe','click', function(el) { alert('b'); }); To my mind