[Javascript] Question about prototype library, but more to the point about Javascript

Terry Riegel riegel at clearimageonline.com
Mon Oct 26 07:39:47 CDT 2009


Hola,

Thanks for taking time to respond. I wasn't clear in my question. I  
will attempt to clarify.


I execute this function...


function checkIn(l,p){
  checkIn = new PeriodicalExecuter(
   function(pe){
    new Ajax.Request(l,{
      method: 'GET',
      parameters: 'ajaxrequest=TRUE',
      encoding: 'UTF-8',
      onComplete: function(t){
       logit('checkin()',t.responseText);
       if (returnErrorCheck(t.responseText)) {this.stop;}
       clearImage="undefined";
      }
     });
     return false;
   },
   p);
}

And it starts this thing that happens every p seconds. Fine enough.  
Now At some point in the future I want to stop that thing that is  
firing every p seconds.

How do I reference the local variable checkIn to stop it. I would like  
to do this without making checkIn a global variable as there may be  
more than one checkIn's running.

Any ideas?

Terry


On Oct 23, 2009, at 4:24 PM, john saylor wrote:

> hola
>
> On Fri, Oct 23, 2009 at 3:56 PM, Terry Riegel
> <riegel at clearimageonline.com> wrote:
>> I am trying to figure out how to take the PeriodicalExecuter and stop
>> it after it is started. Any ideas?
>
> setInterval()
> clearInterval()
>
> [maybe setTimeout()]
>
> use the search engine of your choice.
>
> -- 
> \js  [  - . .  .   ]
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript




More information about the Javascript mailing list