Et oui c'est surement basique mais je ne comprend pas pourquoi mon petit script tout bete ne fonctionne pas ... Un compte à rebours ...
Code : Tout sélectionner
<script language="JavaScript">
function redirect() {
window.location.href='menu4.php'
}
function delai() {
setTimeout("delai()",1000);
tps=123
var j=Math.floor(tps/3600/24);
tps=tps % (3600*24);
var h=Math.floor(tps / 3600);
tps=tps % 3600;
var m=Math.floor(tps/60);
tps=tps % 60
var s=Math.floor(tps);
if (j < 10) {
var j="0"+j;
}
if (h < 10) {
var h="0"+h;
}
if (m < 10) {
var m="0"+m;
}
if (s < 10) {
var s="0"+s;
}
if (j != 0) {
var txt=j+":"+h+":"+m+":"+s+"\"";
} else {
if (h != 0) {
var txt=h+":"+m+":"+s+"\"";
} else {
if (m != 0) {
var txt=m+":"+s+"\"";
} else {
if (s != 0) {
var txt=s+"\"";
} else {
var txt="...";
setTimeout('redirect()',950);
};
};
};
};
document.write(txt);
}
</script>Merci d'avance