D
Derek Ross
Hello,
Say I have a server that's saving the CPU temperature to
'temperature.js' once a second. The contents of the file is one single
line:
var temperature = "35.5";
And it changes as the temperature changes.
Is it possible to have an HTML file in the same directory as the
"temperature.js" file, that's reading the file once a second and then
provides a crude realtime update of the temperature value?
The HTML result would look something like:
TEMPERATURE:
35.5
35.6
35.4
35.7
36.1
....etc, page continues appending temperature by the second...
I know how to used .innerHTML to append values to a list, but I'm having
trouble getting my "temperature.js" script to reload and execute once a
second, so that the "temperature" variable is always up-to-date. It
seems that the temperature is reloaded only when the whole HTML page is
loaded.
Any assistance would be appreciated,
Thanks,
Derek.
Say I have a server that's saving the CPU temperature to
'temperature.js' once a second. The contents of the file is one single
line:
var temperature = "35.5";
And it changes as the temperature changes.
Is it possible to have an HTML file in the same directory as the
"temperature.js" file, that's reading the file once a second and then
provides a crude realtime update of the temperature value?
The HTML result would look something like:
TEMPERATURE:
35.5
35.6
35.4
35.7
36.1
....etc, page continues appending temperature by the second...
I know how to used .innerHTML to append values to a list, but I'm having
trouble getting my "temperature.js" script to reload and execute once a
second, so that the "temperature" variable is always up-to-date. It
seems that the temperature is reloaded only when the whole HTML page is
loaded.
Any assistance would be appreciated,
Thanks,
Derek.