Say I want to perform an ajax action every 10 seconds. Is there a timer function in the built-in JavaScript libraries that will let me do this? -- Chris Stewart compiledmonkey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org compiledmonkey.com --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Stewart wrote:> Say I want to perform an ajax action every 10 seconds. Is there a timer > function in the built-in JavaScript libraries that will let me do this? > > -- > Chris Stewart > compiledmonkey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > compiledmonkey.comYes there is. Can''t remember it right now, but i''ve used it before... -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here it is: periodically_call_remote(options = {}) Periodically calls the specified url (options[:url]) every options[:frequency] seconds (default is 10). Usually used to update a specified div (options[:update]) with the results of the remote call. The options for specifying the target with :url and defining callbacks is the same as link_to_remote. -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Stewart wrote:> Say I want to perform an ajax action every 10 seconds. Is there a timer > function in the built-in JavaScript libraries that will let me do this?periodically_call_remote ? -- Phlip oreilly.com/catalog/9780596510657 "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How can I prevent the loading of /test/blank in this example? <%= periodically_call_remote(:url => "/test/blank", :complete =>''addRow("something");return false;'', :frequency => 3) %> All I want to do here is call the javascript function addRow, however I could not figure out how to accomplish this with out leveraging :complete Any idea? I don''t really want to call /test/blank Thanks in advance On Jun 26, 11:52 pm, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Chris Stewart wrote: > > Say I want to perform anajaxaction every 10 seconds. Is there a timer > > function in the built-in JavaScript libraries that will let me do this? > > periodically_call_remote ? > > -- > Phlip > oreilly.com/catalog/9780596510657 > "Test DrivenAjax(on Rails)" > assert_xpath, assert_javascript, & assert_ajax--~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
neutek wrote:> How can I prevent the loading of /test/blank in this example? > > <%= periodically_call_remote(:url => "/test/blank", :complete > =>''addRow("something");return false;'', :frequency => 3) %> > > All I want to do here is call the javascript function addRow, however > I could not figure out how to accomplish this with out > leveraging :complete > > Any idea? I don''t really want to call /test/blankI suspect if you leave the :url out, and leverage :complete, your browser will periodically call raw JavaScript without hitting a server. I formerly posted that you could right after I discovered it, but I have since retired that code, so Google for the topic and my street name if you get stuck. -- Phlip oreilly.com/catalog/9780596510657 "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---