Is there a way to make some JS code be executed every 60 seconds? I’m thinking it might be possible with a while loop, but is there a neater solution? JQuery welcome, as always.
Is there a way to make some JS code be executed every 60 seconds?
Share
Using setInterval:
The function returns an id you can clear your interval with clearInterval:
A “sister” function is setTimeout/clearTimeout look them up.
If you want to run a function on page init and then 60 seconds after, 120 sec after, …: