Forum: Ruby on Rails Call RJS after page render

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
75ae2e039c201d882f0f8c7d31758ad8?d=identicon&s=25 Tony (Guest)
on 2007-05-12 14:03
(Received via mailing list)
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.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2007-05-12 19:02
(Received via mailing list)
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 <body onload=''> 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 <select onchange=''> event.

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

--
  Phlip
  http://www.oreilly.com/catalog/9780596510657/
  "Test Driven Ajax (on Rails)"
  assert_xpath, assert_javascript, & assert_ajax
This topic is locked and can not be replied to.