archi57 | Bjr,
Voici le code d'une page HTML
il contient le script d'un "compte à rebours" que j'aimerai récupérer
mais je ne sais pas quoi extraire ??
pouvez vous m'aider ??
merci
bye
Voici le code:
Code :
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <!-- saved from url=(0039)http://www.fftt-idf.com/old/accueil.htm -->
- <HTML><HEAD><TITLE>Ligue IdF - Accueil</TITLE>
- <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><DBHEAD>
- <SCRIPT language=JavaScript src="accueil_fichiers/lastModDate.js"></SCRIPT>
- </DBHEAD>
- <SCRIPT language=JavaScript>
- <!-- Hiding script from old browsers
- var dat = new Array(); var cmp = new Array();
- var M = 5;
- var i=M;
- cmp[i] = "L'assemblée générale de la Ligue,";
- dat[i] = "September, 24 2007 09:00";
- i--;
- cmp[i] = "Le début des Championnats de France des Régions,";
- dat[i] = "February, 27 2007 10:00";
- i--;
- cmp[i] = "La reprise du chpt d'IdF par équipes,";
- dat[i] = "January, 12 2007 20:30";
- i--;
- cmp[i] = "La nouvelle année,";
- dat[i] = "January, 1 2007 00:00";
- i--;
- cmp[i] = "La reprise du Chpt de France R2 masculine,";
- dat[i] = "September, 22 2006 15:00";
- i--;
- var N = 1 ;
- var ok = 'c';
- if ( i!=0 ) ok = 'C'; // ==> M est incorrect
- //*****************************************************
-
- var timerID;
- var timerRunning = false;
- var today = new Date();
- var enday = new Date();
- var totime, entime, diff = 0;
- var secs, mins, hous, days = 0;
- var timeRemain, dbg = 0;
-
- function calcmes()
- {
- today = new Date();
- totime = today.getTime();
- for ( i=1; i<=M; i++ )
- {
- enday = new Date( dat[i] );
- entime = enday.getTime();
- diff = Math.round( (entime - totime) / 1000 );
- if (diff > 0) break;
- } // for
- N = i;
- document.write( cmp[N]+" "+ok+"'est dans" );
- } // calcmes()
-
- function stopclock (){
- if (timerRunning) clearTimeout(timerID);
- timerRunning = false;
- }
- function startclock () {
- stopclock();
- showtime();
- } // startclock()
-
- function showtime () {
- today = new Date( );
- totime = today.getTime();
-
- enday = new Date( dat[N] );
- entime = enday.getTime();
-
- diff = Math.round( (entime - totime) / 1000 );
-
- secs = diff % 60;
- diff = (diff - secs) / 60;
- mins = diff % 60;
- diff = (diff - mins) / 60;
- hous = diff % 24;
- diff = (diff - hous) / 24;
- days = diff;
-
- timeRemain = (days==0) ? " " :
- " " + days + " jour" + ((days<2) ? " " : "s" ) + ", ";
- timeRemain = timeRemain + ( (days==0 && hous==0) ? " " :
- ((hous<10) ? " " : "" ) + hous + " heure" + ((hous<2) ? " " : "s" ) + ", " );
- timeRemain = timeRemain + ( (days==0 && hous==0 && mins==0) ? " " :
- ((mins<10) ? " " : "" ) + mins + " minute" + ((mins<2) ? " " : "s" ) + ", " );
- timeRemain = timeRemain + ((secs<10) ? " " : "" ) + secs;
- timeRemain = timeRemain + " seconde" + ((secs<2) ? " " : "s" );
-
- document.clock.face.value=timeRemain;
- timerID = setTimeout("showtime()",1000);
- timerRunning=true;
- if ( today.getDate()*100+today.getMonth()
- == enday.getDate()*100+enday.getMonth()
- && entime < totime )
- {
- clearTimeout(timerID);
- timerRunning=false;
- document.clock.face.value = "rien du tout. C'e'tait aujourd'hui !";
- }
- } // showtime()
- //*****************************************************
- // end hiding contents from old browsers -->
- </SCRIPT>
-
- <META content="Namo WebEditor v5.0" name=GENERATOR></HEAD>
- <BODY onload="startclock();">
- <TABLE width="95%" border=0>
- <TBODY>
- <TR align=middle>
- <TD>
- <TABLE border=0>
- <TBODY>
- <TR vAlign=top>
- <TD align=middle>
- <FORM name=clock onsubmit=0>
- <TT><FONT size=+1><B><SCRIPT language=JavaScript>
- calcmes();
- </SCRIPT>
- </B></FONT></TT><BR><INPUT style="FONT-SIZE: 9pt" size=45
- value="un peu de patience ..." name=face>
- </FORM></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
- </BODY></HTML>
|
Message édité par archi57 le 01-11-2006 à 18:20:23
|