I have an .rjs file in which I want to check if ‘notice’ is there
(whether hidden or visible) then it should remove it’s DOM. And if there
is no ‘notice’, it shouldn’t do anything.
Please help.
Thanks
I have an .rjs file in which I want to check if ‘notice’ is there
(whether hidden or visible) then it should remove it’s DOM. And if there
is no ‘notice’, it shouldn’t do anything.
Please help.
Thanks
On 10 Apr 2008, at 13:21, Vapor … wrote:
I have an .rjs file in which I want to check if ‘notice’ is there
(whether hidden or visible) then it should remove it’s DOM. And if
there
is no ‘notice’, it shouldn’t do anything.
You can do things like
page << “if($(‘notice’)) {”
page[‘notice’].remove()
page << “}”
There’s a plugin that make this sort of thing easier
(http://www.railslodge.com/plugins/491-js-if-blocks
)
Fred
many thanks!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs