gustavopaes
5/21/2011 - 4:40 PM

A better javascript setInterval

A better javascript setInterval

(function(time) {
   function again() {
        var procede = yourActionFunction();
        if(procede)
            setTimeout(again, time);
   }
   again(time);
})(5000);