The prototype documentation shows the following example: new Ajax.PeriodicalUpdater(''items'', ''/items'', { method: ''get'', frequency: 3, decay: 2 }); Now, I may have quite a few PU''s running at any one time. How can I iterate through the currently running PU''s in order to call stop() on the ones I''ve finished with? Thanks for any help --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
If you start each one as a named variable: var foo = new Ajax..., then you can call foo.stop() later and end it that way. Walter On Apr 24, 2008, at 9:58 AM, smurgy wrote:> > The prototype documentation shows the following example: > > new Ajax.PeriodicalUpdater(''items'', ''/items'', { method: ''get'', > frequency: 3, decay: 2 }); > > Now, I may have quite a few PU''s running at any one time. How can I > iterate through the currently running PU''s in order to call stop() on > the ones I''ve finished with? > > Thanks for any help >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yes thanks for that - its what I''m doing at the moment. I then store the instances in a hash list so I can find them later, giving me the option of stopping and restarting a Periodical Updater at any time. The only thing is that I need to remember to add each new PU to the hash list as I go, and remember to remove them later, and it seemed to me that since prototype already keeps track of them, myabe I can get at them through there. But my JS isnt good enough to understand Prototype code. I also tried registering reponders, but it creates new responders each time the PU is fired again, so doesnt really help me manage it. Thanks again --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---