Hey there,
Daniel Eben Elmore a écrit :>
this.selections.invoke(''addClassName'',''note'');
This is correct.
>
this.selections.invoke(''addClassName(\''note\'')'');
This makes no sense: there is no method named
"addClassName(''note'')"...
My guess is this.selections contains unextended DOM elements (which
means you''re likely trying this on MSIE ;-)).
You will have to either extend on the fly (if you needed those elements
extended for other reasons, too):
this.selections.each(Element.extend).invoke(''addClassName'',
''note'');
(We avoid using collect/map as there''s no need to build an array of
the results: Element.extend will alter elements in-place).
...or use a each loop if you don''t need to extension overhead:
this.selection.each(function(e) {
Element.addClassName(e, ''note'');
});
--
Christophe Porteneuve aka TDD
tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---