[removed] get code to run every minute

前端 未结 2 1320
星月不相逢
星月不相逢 2020-11-28 06:34

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 w

2条回答
  •  醉酒成梦
    2020-11-28 06:59

    You could use setInterval for this.

    
    

    Disable the timer by setting clearInterval(interval).

    See this Fiddle: http://jsfiddle.net/p6NJt/2/

提交回复
热议问题