# RJS problem

**URL:** <https://www.ruby-forum.com/t/rjs-problem/131344>\
**Category:** Rails\
**Created:** [March 8, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/rjs-problem/131344 "2008-03-08T15:35:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 8, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/rjs-problem/131344/1 "2008-03-08T15:35:51Z")

</div>

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:

...

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 8, 2008, 3:42pm UTC](https://www.ruby-forum.com/t/rjs-problem/131344/2 "2008-03-08T15:42:18Z")

</div>

I’ve discovered that an easier way to do this is:

page.show(‘block1’)

No idea why my first attempt half worked.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 8, 2008, 3:45pm UTC](https://www.ruby-forum.com/t/rjs-problem/131344/3 "2008-03-08T15:45:43Z")

</div>

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’
