Hi Jan-erik,
You need to initialize your global counter to 0 so that counter+1
would increment correctly.
Also you need to move myAjax to be a global variable, to be able to
access myAjax.stop()

--
mona
[EMAIL PROTECTED]

On Fri, Nov 14, 2008 at 9:56 AM, jeaswe <[EMAIL PROTECTED]> wrote:
>
> How do I apply a stop to a running periodic updater?
> The below does not stop it!
> var counter;
> function periodic()
>        {
>        var myAjax = new Ajax.PeriodicalUpdater
>
>        ('meny','../TJx/meny.php'+'?rand='+new Date().getTime(),{method:
> 'post',frequency:10.0,decay:2, onSuccess: function(transport)
>        {
>        new Ajax.Updater('pagang','../TJx/pagang.php');
>        counter=counter+1;
>                if(counter==120) {
>                        this.myAjax.stop();
>                        counter=0;
>                        new Ajax.Updater('meny','../TJx/meny.php');
>                                  } }}
>
> best regards
> jan-erik
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to