Hm, thx for quick answer. Now I tried to set only one PeriodicalUpdater like this:
var liveStream = ""; Event.observe(window, 'load', function() { livestart(); }); function livestart(){ var liveStream = new Ajax.PeriodicalUpdater('live_buehne', '/inc/ live.php?lang=all', { method: 'get', frequency: 5, decay: 2, onComplete: blinken }); } function langChange(lang){ liveStream.stop(); liveStream = new Ajax.PeriodicalUpdater('live_buehne', '/inc/live.php? lang='+lang, { method: 'get', frequency: 5, decay: 2, onComplete: blinken }); } ** But then I get from the console: "Value undefined (result of expression liveStream.stop) is not object." ???? What I wish to have ist that: 1. start a periodicalUpdate AFTER the page has load 2. have the PU in a global variable that I can stop it, change a parameter and run it again Maybe thats not possible? Thx + Regards, Dave On Mar 8, 7:42 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote: > Hi, > > Assuming you are calling livestart() at some point, you're creating > two PeriodicalExecuters [one at initialization time and another in > livestart()]. The second one overwrites the reference to the first, > so if you later call langChange(), my guess is that you are succeeding > in stopping the second one; the first one continues. > > FWIW, you're also ignoring the 'lang' parameter in livestart(). > > HTH, > -- > T.J. Crowder > tj / crowder software / com > Independent Software Engineer, consulting services available > > On Mar 7, 8:39 pm, fruehjahr <fruehj...@gmail.com> wrote: > > > Yes, I searched right here and @ Google for a solution. But I spent > > now over an hour with debugging and I can't find the solution. Please > > help! > > > Ok, here's my script: > > > var liveStream = new Ajax.PeriodicalUpdater('live_buehne', '/inc/ > > live.php?lang=all', { method: 'get', frequency: 5, decay: 2 }); > > > function livestart(lang){ > > var liveStream = new Ajax.PeriodicalUpdater('live_buehne', '/inc/ > > live.php?lang=all', { method: 'get', frequency: 5, decay: 2 }); > > > } > > > function langChange(lang){ > > liveStream .stop(); > > liveStream = new Ajax.PeriodicalUpdater('live_buehne', > > '/inc/live.php? > > lang='+lang, { method: 'get', frequency: 5, decay: 2 }); > > > } > > > But stop() won't stop! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---