Bonsoir, j'ai un petit soucis avec la fonction setTimeout. En effet je souhaiterai faire le meme principe que sur ce site. Exécuté une redirection apres l'enregistrement. Donc voila ce que je voulais faire mais apparement ça ne fonctionne pas :.
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>...</title> <link rel="stylesheet" type="text/css" title="" href="style/formulaire.css" /> </head> <body> <div id="corps"> Votre inscription a bien été effectué. Vous serez redirigé dans 5 secondes ou sinon cliquez sur ce lien.<br /> <script language=\"javascript\">setTimeout(\"<a href='test.html'\"></a>, 5000)</script>"; </div> <div id="pied"> <?php include("date.php"); ?> </div> </body> </html>
Ou dois-je faire comme cela :Sachant qu'avec la methode php cela fonctionne mais ne peut ton pas le faire avec directement du html?
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>...</title> <link rel="stylesheet" type="text/css" title="" href="style/formulaire.css" /> </head> <body> <div id="corps"> Votre inscription a bien été effectué. Vous serez redirigé dans 5 secondes ou sinon cliquez sur ce lien.<br /> <?php echo "<script language=\"javascript\">setTimeout(\"location.href='test.html'\", 3000)</script>"; ?> </div> <div id="pied"> <?php include("date.php"); ?> </div> </body> </html>
Partager