RJS on page load

Hi,

How can i call some RJS as soon as the page loads. For example i want
to create a news ticker with the latest news items so it waits x amount
of seconds before replacing the news item with the next in the
collection. See Below:

list.rhtml
<% for article in @articles %>



<% i want call my rjs somewhere in here passing next article in
collection %>
<% end %>

show_article.rjs
page.delay(3.0)do
page.replace ‘latest_article’, :partial => ‘article’, :object =>
@article
end

Is this even possible or am i going about this the wrong way?

JB