RJS: hide element problem

Hi,

I am trying to hide a “intro” text shown to user the first time after he
has
made a search, in the website with RJS/Prototype “hide”.

I get the following error:
RJS Error:
Type Error: element has no properties.

The text I would like to hide is in a div called “intro” and in my RJS I
tried:

  • page.hide[:intro] as well as
  • page.hide ‘intro’

But I get the above error.

I guess I miss something. Any hints are appreciated!

Thanks,
Hari

View this message in context:
http://www.nabble.com/RJS%3A-hide-element-problem-tf2028301.html#a5578175
Sent from the RubyOnRails Users forum at Nabble.com.

The text I would like to hide is in a div called “intro” and in my RJS I
tried:

  • page.hide[:intro] as well as
  • page.hide ‘intro’
  1. Are you sure there is only one element with the id ‘intro’ in your
    final rendered view? (i.e after iterating records)

  2. If you’re doing the following, I can’t imagine what might be wrong…

render(:update) do |page|
page.hide ‘intro’
end

Hope it helps, sounds rather strange though :slight_smile:
Goodluck

Gustav P.
[email protected]
itsdEx.com

Thanks Gustav for the tip.

I just found what mistake I did:

duh!

Regards, Hari

View this message in context:
http://www.nabble.com/RJS%3A-hide-element-problem-tf2028301.html#a5578618
Sent from the RubyOnRails Users forum at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs