Probleme affichage horloge
Résolu
hyoga40
Messages postés
13
Statut
Membre
-
hyoga40 Messages postés 13 Statut Membre -
hyoga40 Messages postés 13 Statut Membre -
Bonjour,
Je laisse ce message car j'ai un soucis avec mon horloge. En effet l'heure n'apparait plus pouvez vous m'aider à trouver la raison du problème merci d'avance ?
Voici le code que j'utilise :
Je laisse ce message car j'ai un soucis avec mon horloge. En effet l'heure n'apparait plus pouvez vous m'aider à trouver la raison du problème merci d'avance ?
Voici le code que j'utilise :
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Horloge</title> <SCRIPT LANGUAGE="JavaScript"> navvers = navigator.appVersion.substring(0,1); if (navvers > 3) navok = true; else navok = false; today = new Date; numero = today.getDate(); if (numero<10) numero = "0"+numero; mois = today.getMonth(); if (navok) annee = today.getFullYear(); else annee = today.getYear(); mois++; if (mois < 10) mois = "0" + mois; messageDate = numero + "/" + mois + "/" + annee; function HeureCheck() { krucial = new Date; heure = krucial.getHours(); min = krucial.getMinutes(); sec = krucial.getSeconds(); jour = krucial.getDate(); mois = krucial.getMonth()+1; annee = krucial.getFullYear(); if (sec < 10) sec0 = "0"; else sec0 = ""; if (min < 10) min0 = "0"; else min0 = ""; if (heure < 10) heure0 = "0"; else heure0 = ""; DinaHeure = heure0 + heure + ":" + min0 + min + ":" + sec0 + sec; which = DinaHeure if (document.all){ dynamic3.innerHTML='<center>00:00:00</center>' dynamic3.innerHTML='<FONT SIZE=2 FACE=" comic sans ms black "><B>'+which+'</B></FONT>'; } else if (document.layers){ document.dynamic1.document.dynamic2.document.write(''+which+'') document.dynamic1.document.dynamic2.document.close() } tempo = setTimeout("HeureCheck()", 1000) } </SCRIPT> </head> <body onLoad="HeureCheck()" onUnload="clearTimeout(tempo)"> <table border="0" cellspacing="0" cellpadding="0" width="50" height="50"> <tr> <td bgcolor="#000000" style="border: 1 solid #000000 " > <table summary="" border="0" width="100%" height="100%"> <tr> <!-- couleur fond et texte --> <td background="#000000"><CENTER> <font color="#FFFFFF"> <!-- fin couleur fond et texte --> <FONT SIZE=2 FACE="comic sans ms black"><B><SCRIPT LANGUAGE="JavaScript"> document.write(messageDate); </SCRIPT> </B></FONT> <!-- image ici --> <a title="Cartoons spirit" href="http://www.cartoons-spirit.fr/" rel="nofollow noopener noreferrer" target="_blank"> <img border="0" src=""quot;"quot;http://cartoons.spirit.free.fr/Monsite/Horloge/HORLOGE1.jpg" width="135" height="170"></a> <!-- fin image ici --> </a> <ilayer id="dynamic1" width=100% height=15><layer id="dynamic2" width=100% height=15><div id="dynamic3"></div></layer></ilayer> </font></CENTER> </td> </tr> </table> </tr> </table> </body> </html>
EDIT : Ajout des balises de code
Explications ici : https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code
A voir également:
- Probleme affichage horloge
- Appli horloge - Télécharger - Guide Android
- Horloge mondiale gratuite - Télécharger - Outils professionnels
- Horloge en ligne aesthetic - Télécharger - Thèmes & Fonds d'écran
- Affichage double ecran - Guide
- Problème affichage fenêtre windows 10 - Guide
2 réponses
Bonjour;
Ceci devrait fonctionner:
Cordialement,
Jordane
Ceci devrait fonctionner:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Horloge</title> <SCRIPT type="text/javascript"> var tempo; function get_date(){ navok = navigator.appVersion.substring(0,1) > 3 ? true : false ; today = new Date; numero = today.getDate(); numero = numero < 10 ? "0"+numero : numero; annee = navok ? today.getFullYear() : today.getYear(); mois = today.getMonth() + 1 < 10 ? "0" + (today.getMonth() + 1) :(today.getMonth() + 1) ; messageDate = numero + "/" + mois + "/" + annee; return messageDate; } function HeureCheck() { krucial = new Date; heure = krucial.getHours(); min = krucial.getMinutes(); sec = krucial.getSeconds(); jour = krucial.getDate(); mois = krucial.getMonth()+1; annee = krucial.getFullYear(); sec0 = sec < 10 ? "0" : ""; min0 = min < 10 ? "0" : ""; heure0 = heure < 10 ? "0" : ""; which = heure0 + heure + ":" + min0 + min + ":" + sec0 + sec; document.getElementById('dynamic3').innerHTML='<FONT SIZE=2 FACE=" comic sans ms black "><B>'+which+'</B></FONT>'; tempo = setTimeout("HeureCheck()", 1000); } </SCRIPT> </head> <body onLoad="HeureCheck()" onUnload="clearTimeout(tempo)"> <table border="0" cellspacing="0" cellpadding="0" width="50" height="50"> <tr> <td bgcolor="#000000" style="border: 1 solid #000000 " > <table summary="" border="0" width="100%" height="100%"> <tr> <!-- couleur fond et texte --> <td background="#000000"><CENTER> <font color="#FFFFFF"> <!-- fin couleur fond et texte --> <FONT SIZE=2 FACE="comic sans ms black"><B><SCRIPT LANGUAGE="JavaScript"> document.write(get_date()); </SCRIPT> </B></FONT> <!-- image ici --> <a title="Cartoons spirit" href="http://www.cartoons-spirit.fr/" rel="nofollow noopener noreferrer" target="_blank"> <img border="0" src=""apos;http://cartoons.spirit.free.fr/Monsite/Horloge/HORLOGE1.jpg' width="135" height="170"></a> <!-- fin image ici --> </a> <ilayer id="dynamic1" width=100% height=15><layer id="dynamic2" width=100% height=15><div id="dynamic3"></div></layer></ilayer> </font></CENTER> </td> </tr> </table> </tr> </table> </body> </html>
Cordialement,
Jordane
Merci Jordane pour ton aide mon horloge marche maintenant très bien.
N'étant pas un pro du codage informatique j'étais un peu perdu. J'ai un vieux site qui malgré son age à pas mal de visite et j'essaie de le garder compatible avec tous les navigateurs et l'horloge était l'un de mes problèmes avec les paragraphes de textes qui sont trop long sur Chrome et Android (Edge et internet explorer impeccable).
Merci encore pour ton aide et passe un bon week end.
N'étant pas un pro du codage informatique j'étais un peu perdu. J'ai un vieux site qui malgré son age à pas mal de visite et j'essaie de le garder compatible avec tous les navigateurs et l'horloge était l'un de mes problèmes avec les paragraphes de textes qui sont trop long sur Chrome et Android (Edge et internet explorer impeccable).
Merci encore pour ton aide et passe un bon week end.