How can I test fi the element has the property before removing it I tested page[''mypropCity''].removeClassName(''wrong'') if page[''mypropCity''].hasClassName(''wrong'') but it doesn''t work.. thanks kad -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kad Kerforn wrote:> How can I test fi the element has the property before removing it > > I tested > page[''mypropCity''].removeClassName(''wrong'') if > page[''mypropCity''].hasClassName(''wrong'') > > but it doesn''t work.. > > thanks > > kadGot it : need to write plain JS in my page to perform this check... as JS is not aware of the Rails ''if'' -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
removeClassName and hasClassName are not rails prototype helper methods, so that''s why it''s not working. also, you don''t need to check if the classname exists, just remove it. if it exists it will be removed. page.call ''Element.removeClassName'', ''element_id'', ''classname'' On 2/9/07, Kad Kerforn <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > How can I test fi the element has the property before removing it > > I tested > page[''mypropCity''].removeClassName(''wrong'') if > page[''mypropCity''].hasClassName(''wrong'') > > but it doesn''t work.. > > thanks > > kad > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---