pdebruic at gmail.com
Wed Feb 2 00:40:46 UTC 2011
Thanks for the replies and pointers. I went ahead and made this jQuery
and then added it to the jQuery Widget Box on squeaksource.com. It
stores the interval ID in the .data() function of a DOM element and then
retrieves from the DOM element when you want to clear the interval.
In the example I uploaded to SqueakSource there are three counters that
update independently of each other at different speeds using
setInterval. Each can be started and stopped independently. It does
what I want for now.
I wanted to have this as I'm using Futures for some stuff and need to
poll for results from multiple tabs on the same page and didn't want to
do a full page refresh when each tab had results. It seems to work for
that purpose. I need to poll for results rather than let the Futures
block because I want to port what I've done to Gemstone and Dale's
recommendation was to poll for results rather than block.
I've read it'd be a better idea to use setTimeout recursively rather
than setInterval but I haven't gotten my head around that yet.
More information about the seaside