-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Fuchs wrote:
> function hideElements(){
>     $A(arguments).each(Element.hide);
> }
Ugly :))
Let's not forget that "$()" accepts multiple arguments:
  $('e1', 'e2', 'e3').each(Element.hide);

"$$()" could also be used for that _when_ it will be able to parse
things like "#a, #b, #c":
  $$('#e1, #e2, e3').each(Element.hide);

> Personally, I prefer calling the .each construct directly, as in  
> Martin's reply.
"function(){}" it's already to long for our sweety-pie. We have "invoke"
as a more concise sweetener. ;-)
Even more - for our specific context - directly invoking "class" methods
(OK, triple quotes should be used :))) should become deprecated at some
point, as this is getting uglier every day (Element vs Element.Methods).

So, let's "invoke":
  $('e1', 'e2', 'e3').invoke('hide');

Currently, my preferred way to doing things like this is:
  $(qw('e1 e2 e3')).invoke('hide');

("qw" is like Perl's string to array sweetener)

Maybe I'll switch to:
  $$('#e1, #e2, #e3').invoke('hide');
when it becomes generally available. ;-)

> Am 03.12.2006 um 15:19 schrieb Martin Ström:
>> ['element1', 'element2', 'elemen3'].each(Element.hide);
>>
>> On 11/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>> I posted earlier about this but think google groups was screwed up.
Google Groups works after all, even if sometimes has huge delay and
makes discussions go crazy (remember the "old messages "storm" a week
ago or so) ;-)

cheers
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----

iD8DBQFFdvf5tZHp/AYZiNkRAkKwAJ926bKRFnN0WPJhnjSwRCwvh/KP/wCgoc7D
UqEE2FoY8eVgamfslDe5ebs=
=jdQZ
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to