begin process at 2012 02 14 09:09:01
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Date & Heure

 > AFFICHER L'HEURE DU NAVIGATEUR DANS LA BARE DE STATUS

AFFICHER L'HEURE DU NAVIGATEUR DANS LA BARE DE STATUS


 Information sur la source

Note :
7 / 10 - par 1 personne
7,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Date & Heure Niveau :Initié Date de création :13/01/2004 Vu :4 137

Auteur : Guechtouli_Madani

Ecrire un message privé
Commentaire sur cette source (2)
Ajouter un commentaire et/ou une note

 Description

Cliquez pour voir la capture en taille normale
Comment accéder à la bare de status du navigateur, en affichent son horaire actuel

Source

  • <html>
  • <Script LANGUAGE="JavaScript">
  • <!--
  • var timerID = null;
  • var TimerRunning = false;
  • function stop(){
  • if(TimerRunning)
  • clearTimeout(timerID);
  • TimerRunning = false;
  • }
  • function display() {
  • var thedate = new Date();
  • var hours = thedate.getHours();
  • var Min = thedate.getMinutes();
  • var Sec = thedate.getSeconds();
  • var TimeV = " il est exactement chez vous : " + hours
  • TimeV += ((Min < 10) ? ":0" : ":") + Min
  • TimeV += ((Sec < 10) ? ":0" : ":") + Sec
  • TimeV += (hours >= 12) ? " P.M." : " A.M."
  • window.status = TimeV;
  • timerID = setTimeout("display()",1000);
  • TimerRunning = true;
  • }
  • function start() {
  • stop();
  • display();
  • }
  • start();
  • // end hide -->
  • </Script>
  • <head>
  • <title> Titre de votre site </title>
  • <META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8">
  • </head>
  • <frameset rows="32,*,0" border=0>
  • <frame name="HEADER" src="header.html"
  • frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="no">
  • <frame name="MAIN" src="Corps.htm"
  • frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="auto">
  • <frame name="FOOTER" src="footer.html"
  • frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="no">
  • </frameset>
  • </html>
<html>
<Script LANGUAGE="JavaScript">
<!--
var timerID = null;
var TimerRunning = false;

function stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}

function display() {
var thedate = new Date();
var hours = thedate.getHours();
var Min = thedate.getMinutes();
var Sec = thedate.getSeconds();
var TimeV = " il est exactement chez vous : " +  hours
TimeV += ((Min < 10) ? ":0" : ":") + Min
TimeV += ((Sec < 10) ? ":0" : ":") + Sec
TimeV += (hours >= 12) ? " P.M." : " A.M."
window.status = TimeV;
timerID = setTimeout("display()",1000);
TimerRunning = true;
}

function start() {
stop();
display();
}

start();

// end hide -->
</Script>

<head>

     
<title> Titre de votre site </title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8">
</head>
  
<frameset rows="32,*,0" border=0>

  <frame name="HEADER"   src="header.html"
   frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="no">

  <frame name="MAIN"     src="Corps.htm"
   frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="auto">

  <frame name="FOOTER"   src="footer.html"
   frameborder=0 marginheight=0 marginwidth=0 noresize scrolling="no">

</frameset>


</html>

 Conclusion

On là met sur la page index du site


 Sources du même auteur

Source avec Zip Source avec une capture MENU DÉROULENT DANS UNE PAGE WEB
AVOIR UNE CALCULATRISE, SUR PAGE WEB.
Source avec une capture LA DURÉE DE VISITE D'UNE PAGE WEB.
Source avec Zip Source avec une capture UNE AMINATION AVEC AFFICHAGE D'UN SÉQUENCE D'IMAGES, UNE PAR...

 Sources de la même categorie

Source avec Zip CALENDRIER ANNUEL UNIVERSEL AVEC SAINTS DU CALENDRIER ET FÊT... par 007Julien
OBTENIR LE NOMBRE DE JOURS D'UN MOIS SUIVANT SON ANNÉE par hugolegrand
SAINT DU JOUR par tefa24600
Source avec Zip Source avec une capture NIPCLOCK 1.2 par neep
COMPTE À REBOURS POUR ÉVÉNEMENTS À RÉPÉTITION par CSIBern

Commentaires et avis

Commentaire de roro06 le 15/01/2004 11:43:06

Equivalent, mais peut-etre plus simple :

var dayAr=new Date();
var deb="Heure d'arrivée : " + dayAr.getHours() + ":" + ((dayAr.getMinutes()&lt;=9)?"0":"") + dayAr.getMinutes() + ":"+ ((dayAr.getSeconds()&lt;=9)?"0":"") + dayAr.getSeconds();
decompteStatus();

function decompteStatus()
{
today=new Date();
var dif=(today - dayAr) / 1000;
window.status=deb + " et il est " + today.getHours() + ":" + ((today.getMinutes()&lt;=9)?"0":"") + today.getMinutes() + ":"+ ((today.getSeconds()&lt;=9)?"0":"") + today.getSeconds() + " temps passé : " + dif + " s.";
setTimeout("decompteStatus()", 1000);
}

Commentaire de cbeyls le 22/01/2005 01:58:31

Concernant le code original, il est bien, mais le start est mal fait. J'enlèverais le

TimerRunning = true;

de la fonction display() et j'écrirais le start() comme cela:

function start() {
   if(! TimerRunning) {
      TimerRunning = true;
      display();
   }
}

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,530 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales