I need to test whether an element exists before I do some RJS thing to it. I currently have a small RJS snippet that looks like this: page << "if $(''foo'') {" page[''foo''].visual_effect :appear page << "}" This would make sense: if page[''foo''] page[''foo''].visual_effect :appear end But since that is executed as ruby the javascript "if" is not rendered. Is there prettier, pure ruby, and better way to say this with RJS? -- Posted via http://www.ruby-forum.com/.