In an unknown time the variable it deals with get a new value. I would like to refresh the output at the page withoout reloading it every 10 seconds.
How to? Please help.
In an unknown time the variable it deals with get a new value. I would like to refresh the output at the page withoout reloading it every 10 seconds.
How to? Please help.
you can use something like setInterval, https://www.w3schools.com/jsref/met_win_setinterval.asp
setInterval(function() {
//do what you need to with the variable here
}, 10 * 1000); //since millseconds
Use setInterval.
setInterval(function() {
}, 10*1000)
as said.
BUT... If the new value of the variable, has to do with time, you 'd better use a timestamp method too, instead of doing your calculations based on setInterval.