I want to display a message from a list of messages and have it change
to the next message every 10 seconds.
I have achieved this by putting the following javascript into my rhtml
file...
<div id=''dynamic_message''></div>
<script type="text/javascript">
var messages=["Message One", "Message Two", "Message
Three"]
var message=0;
new PeriodicalExecuter(function() {$("dynamic_message").innerHTML
messages[message++%messages.length];}, 10);
</script>
Is there a railsy way of achieving the same thing?
The only thing I could find was periodically_call_remote which I
didn''t want to use because it would need to contact the server for
every update which isn''t efficient.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---