[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-13 Thread flughund
Thx a lot. Doesn't work. Have this now: var lang = all; var liveStream; Event.observe(window, 'load', function() { livestart('all'); }); function livestart(lang,liveStream){ if(liveStream){ liveStream.stop(); liveStream = undefined;

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-13 Thread Walter Lee Davis
It seems to me that by using 'var liveStream' inside this function you are setting a new private variable rather than touching the existing public one. So while you may call stop on the bare variable liveStream, any further attempts to stop the actual running liveStream will fail, because

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-13 Thread flughund
hm, ok. But how can I change a runnig PUpdaters options? Is there a better way? btw: http://osdir.com/ml/lang.ruby.rails.spinoffs/2006-07/msg00269.html I don't understand the article, but maybe... --~--~-~--~~~---~--~~ You received this message because you are

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-13 Thread Walter Lee Davis
That's a pretty old article and bug, from over a year and a major version ago. As far as I know, you can't change a PU mid-stream, and I also fight with it from time to time to try to get it to live-update any variables, but that seems to run counter to how it works. What you can do is

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-13 Thread pradeep
Dear Walter , I am also facing the same problem. Ajax Periodical updater stop() function is not working properly.but it is very incosistent..certain number of times it works fine..but most of the times it does not work.,... could u please explain liveStream = undefined; ??? about the

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-08 Thread flughund
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',

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-08 Thread T.J. Crowder
Hi, var liveStream = ; ... Value undefined (result of expression liveStream.stop) is not object. It sounds like langChange is being called before livestart is being called; the string object doesn't have a stop method. You'll want to code defensively against the possibility that liveStream

[Proto-Scripty] Re: Can't stop and start Ajax.PeriodicalUpdater

2009-03-07 Thread T.J. Crowder
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