Noble reader,
My goal is to obtain the current time on the web server and display it in
the client's browser. I want the server time displayed independent of the
client's current clock setting, but use the client clock to refresh the
displayed time every second. To compensate for drift, I want to
periodically calibrate the page with the server time by refreshing the page,
say every ten minutes or so.
I have a servlet '/apps/clock' that returns the current (server) time as
XML, i.e.
<milliseconds>1086478233003</milliseconds>
I can strip away the XML tags with XSLT, leaving the value '1086478233003'.
I need a way to read the value into a JavaScript variable, so I can use it
to create a Date object, increment the variable, etc.
So, does anyone know a way to assign an external value to a JS variable?
Best,
Harry