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
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.
In the browser, all JavaScript code is aborted when you leave the page, and run when you open the page. So timeouts will be cleared and set again when you reload a page.
If you want to persist a timeout, you could:
localStorage
(which allows you to persist data on the client's computer) to keep track of when the function was last called, and set the timeout appropriately on loadWhen page is reloaded the "previous" timer is discarded and a new one will start.