javascript setInterval

前端 未结 8 1604
时光说笑
时光说笑 2020-11-30 12:30

a question. If i use setInterval in this manner:

setInterval(\'doSome();\',60000);

am i safe that the doSome() function is tri

8条回答
  •  攒了一身酷
    2020-11-30 12:53

    Yes it will be called as long as the page is open, regardless the tab is switched or even the browser is minimized.

    However make sure you pass the function not a string to setInterval

    it should be >

    setInterval(doSome, 60000)

提交回复
热议问题