0

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.

2 Answers2

1

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
Samip Suwal
  • 1,253
  • 11
  • 17
0

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.

treecon
  • 2,415
  • 2
  • 14
  • 28