Bonjour,
voici mon code
sous une certain condition, j'aimerai appeler ma fonction javascript (affiche un compt à rebour).. mon problème: je ne réussi pas à l'appeler!! ça marche seulement quand je met dans <body onLoad="delai(100)">..
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <SCRIPT LANGUAGE="JavaScript"> var date = 0; function delai(temp){ date=temp; disp_delai(); } function disp_delai(){ date=date-1; document.getElementById("digitalclock2").innerHTML=date setTimeout("disp_delai()",1000); } </SCRIPT> <html> <head> <title>Compte à rebours</title> </head> <body > <br> <? if(condition) { // déclencher timer en appelant fonction Delai(100) ?> <form name="mail" method=get action="delai(100)"> <span id="digitalclock2" class=listText style='font-weight: bold; '></span> <? } else echo "pas de timer"; ?> </body> </html>
ça doit surement être un truc très banale mais je galère depuis hier et j'ai rien trouvé
j'ai regardé dans les faq et j'ai rien trouvé..
merci d'avance







Répondre avec citation









Partager