Hi,

the setTimeout will only be called once. If you want to do a endless
loop you need to use setInterval. If you want to change parameters
later then you can delete an interval using its token which is
returned when you create it:

// Create:
var myInterval = setInterval(function, refreshRate);
// Delete:
clearInterval(myInterval);

Best regards,
Benjamin

Greg Suvalian wrote:
> Hi,
> I have experience in C# and .NET programming and trying to write simple
> gadget which will retrieve image from specified URL periodically. How do I
> create properly endless loop in program?
> Right now I have that on application start it calls a function with last
> line of function is SetTimeout which calls function itself.
> function RefreshImage(URL, RefreshRate)
> {
> img1.src = URL;
> setTimeout (RefreshImage, RefreshRate);
> }
> Problem here is that how do I exit loop say in case if options are modified?
>
> Thanks,
> G
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to