Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.javascript > #8029
| Path | csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!news.netfront.net!not-for-mail |
|---|---|
| From | Alex <tommaso5ita@yahoo.it> |
| Newsgroups | it.comp.lang.javascript |
| Subject | Re: date server |
| Date | Fri, 29 Apr 2016 16:57:22 +0200 |
| Organization | Netfront http://www.netfront.net/ |
| Lines | 52 |
| Message-ID | <nfvsoh$hnm$1@adenine.netfront.net> (permalink) |
| References | <nfvfe9$4bm$1@dont-email.me> |
| Reply-To | tommaso5ita@yahoo.it |
| NNTP-Posting-Host | 2.156.222.183 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="iso-8859-15"; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | adenine.netfront.net 1461941843 18166 2.156.222.183 (29 Apr 2016 14:57:23 GMT) |
| X-Complaints-To | news@netfront.net |
| NNTP-Posting-Date | Fri, 29 Apr 2016 14:57:23 +0000 (UTC) |
| X-Newsreader | MesNews/1.08.06.00-it |
| X-ICQ | 1931503972 |
| Xref | csiph.com it.comp.lang.javascript:8029 |
Show key headers only | View raw
Scriveva M_M venerdì, 29/04/2016:
> 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.
Ehh, ti tocca interrogare sempre il server per avere la data.
Chiamate ajax.
Bye
--
Alex
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Back to it.comp.lang.javascript | Previous | Next — Previous 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