Hi everyone! I''m tearing my hair out over an RJS problem. I''ve used it before without issue, but I''ve no idea what is going wrong here. I''m trying to display a div which starts off invisible defined with: <div id="block1" style="display: none;">...</div> In my .rjs I have: page.call("$(''block1'').show()") When I run this, Firefox displays block1 but then gives me two errors: 1. "Type error $("block1").show() is not a function" 2. $("block1").show()() Any help would be appreciated! Chav --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve discovered that an easier way to do this is: page.show(''block1'') No idea why my first attempt half worked. On Mar 8, 2:34 pm, lindsay <lindsay...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi everyone! > > I''m tearing my hair out over an RJS problem. I''ve used it before > without issue, but I''ve no idea what is going wrong here. I''m trying > to display a div which starts off invisible defined with: > > <div id="block1" style="display: none;">...</div> > > In my .rjs I have: > > page.call("$(''block1'').show()") > > When I run this, Firefox displays block1 but then gives me two errors: > > 1. "Type error $("block1").show() is not a function" > 2. $("block1").show()() > > Any help would be appreciated! > Chav--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Also, page[''block1''].show works as well. I often prefer the proxied commands like that one. i.e page[''block1''].replace_html vs page.replace_html ''block1'' -- 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 -~----------~----~----~----~------~----~------~--~---