Does a JavaScript setTimeout function stop when page reloaded?

前端 未结 3 1085
南旧
南旧 2021-01-13 23:51

If I initiate a setTimeout function from the trigger, will the function stop when the page is reloaded?

I initiate a setTimeout function \"periodic_update()\" on th

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 00:32

    When you reload the browser, the html, css and javascript are re-evaluated as part of building the DOM and render trees. Consequently, each instance of the timer function is disposed on page reload. So, no, you will not end up with multiple instances of that function.

提交回复
热议问题