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
-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
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
: [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