Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.javascript > #8027
| From | M_M <spam@the.hell> |
|---|---|
| Newsgroups | it.comp.lang.javascript |
| Subject | date server |
| Date | 2016-04-29 13:13 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <nfvfe9$4bm$1@dont-email.me> (permalink) |
Vorrei mettere nell'homepage un orologio con la data ed ora del server
aggiornandola continuamente (mi bastera` ogni minuto), per cui, credo ma
me ne intendo veramente poco..., che occorra usare anche PHP.
Prendendo spunto da questo esempio di orologio lato client, in
javascript,:
http://www.elated.com/articles/creating-a-javascript-clock/
ho provato a fare uno script che richiama la data del server tramite PHP:
<html>
<head>
<script type="text/javascript">
<!--
function updateClock()
{
var currentTimeString = "<?php echo date('l jS \of F Y h:i:s A'); ?>"
document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}
-->
</script>
</head>
<body onload="updateClock(); setInterval('updateClock()', 1000 )">
<span id="clock"> </span>
</body>
</html>
ma stampa la data ma poi non si aggiorna.
Potete darmi un aiuto per risolvere per favore?
Ho provato a togliere dal body
onload="updateClock(); setInterval('updateClock()', 1000 )"
e ad aggiungere nello script:
window.onload=function(){
setInterval("updateClock()", 1000)
}
ma purtroppo anche cosi` nulla e` cambiato.
Back to it.comp.lang.javascript | Previous | Next — Next in thread | Find similar
date server M_M <spam@the.hell> - 2016-04-29 13:13 +0200
Re: date server Alessandro Pellizzari <shuriken@amiran.it> - 2016-04-29 14:14 +0100
Re: date server M_M <spam@the.hell> - 2016-04-29 17:12 +0200
Re: date server M_M <spam@the.hell> - 2016-04-29 19:25 +0200
Re: date server M_M <spam@the.hell> - 2016-04-30 09:26 +0200
Re: date server M_M <spam@the.hell> - 2016-05-03 14:15 +0200
Re: date server Alex <tommaso5ita@yahoo.it> - 2016-04-29 16:57 +0200
csiph-web