# Call RJS after page render

**URL:** <https://www.ruby-forum.com/t/call-rjs-after-page-render/103991>\
**Category:** Rails\
**Created:** [May 12, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/call-rjs-after-page-render/103991 "2007-05-12T14:03:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@tony](https://www.ruby-forum.com/u/tony)\
**Post date:** [May 12, 2007, 2:03pm UTC](https://www.ruby-forum.com/t/call-rjs-after-page-render/103991/1 "2007-05-12T14:03:28Z")

</div>

Is there any way (either from within rails or via JS on the rendered  
page) to call RJS after a page has rendered?

I have a form with a bunch of dynamic pulldown menus with dependancies  
on each other and several other factors. The selects automatically  
update via observe\_field when a selection is made and it would be nice  
to simply call the same functions from the page just after it is  
rendered.

Thanks.

---

<div class="post-metadata">

**Author:** ![tony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@tony](https://www.ruby-forum.com/u/tony)\
**Post date:** [May 12, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/call-rjs-after-page-render/103991/2 "2007-05-12T19:02:06Z")

</div>

Tony wrote:

> Is there any way (either from within rails or via JS on the rendered  
> page) to call RJS after a page has rendered?

Put raw JavaScript into your event

> I have a form with a bunch of dynamic pulldown menus with dependancies  
> on each other and several other factors.

Put raw JavaScript into your event.

I think you don’t need all that RJS overhead just to do browser-side  
things.

–  
Phlip  
[Test Driven Ajax (on Rails) [Book]](http://www.oreilly.com/catalog/9780596510657/)  
“Test Driven Ajax (on Rails)”  
assert\_xpath, assert\_javascript, & assert\_ajax
