a.rebholz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-10 14:35 UTC
Ajax.PeriodicalUpdater: Parameters Handling
Hello, I am haveing a problem with the Ajax.PeriodicalUpdater. What the script should do is updating an image every 5 seconds. The ticker.php should receive an id and depending on that id deliver the next image (which does have another id). So I want the script to do is grabbing the current id and posting it via Ajax.PeriodicalUpdater. The problem is, that the id doesn''t seem to get updated. If I look into Firebug it is always the id from the start of the script. It doesn''t seem the problem of the ticker.php script because this does deliver a new picture with a new id This is the Script: var AjaxUpdateSidebar = Class.create(); AjaxUpdateSidebar.prototype = { initialize: function() { this.container = $(''ticker''); new Ajax.PeriodicalUpdater(this.container, ''/ticker.php'', { method: ''post'', parameters: this.getParams(), frequency: 5 }); }, getParams: function() { this.imgId = this.container.down(''img'').id; return ''id='' + this.imgId; } } So how can I pass a new parameter depending on the updated html block? TIA, Alex --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---