javascript countdown modifizieren! bitte um hilfe!
Verfasst: 09.03.2007, 12:50
hallo!!
ich habe im Internet einen countdown gefunden, den ich etwas modifizieren möchte, ich "spreche" aber leider kein javascript, könnte mir hier bitte jemand einen Tipp geben, wie man nach ablauf des countdowns automatisch auf einen anderen link springt? (statt des ausgabefelds)!
Code:
<html>
<head>
<script language="JavaScript">
var x=10;
var timer;
function countDown() {
if(x!=-1) {
if (document.all) {
document.all.blub.innerHTML = x;
} else if ((!document.all) && (document.getElementById)) {
document.getElementById('blub').innerHTML = x;
} else if (document.layers) {
document.layers.blub.document.open();
document.layers.blub.document.write(x);
document.layers.blub.document.close();
}
x--;
timer=setTimeout("countDown()", 1000);
} else {
clearTimeout("timer");
########################
alert("COUNTDOWN beendet!");
HIER
########################
}}
</script>
</head>
<body onload="countDown()">
<div id="blub">10</div>
</body>
</html>
danke für eure hilfe
lg wurli
ich habe im Internet einen countdown gefunden, den ich etwas modifizieren möchte, ich "spreche" aber leider kein javascript, könnte mir hier bitte jemand einen Tipp geben, wie man nach ablauf des countdowns automatisch auf einen anderen link springt? (statt des ausgabefelds)!
Code:
<html>
<head>
<script language="JavaScript">
var x=10;
var timer;
function countDown() {
if(x!=-1) {
if (document.all) {
document.all.blub.innerHTML = x;
} else if ((!document.all) && (document.getElementById)) {
document.getElementById('blub').innerHTML = x;
} else if (document.layers) {
document.layers.blub.document.open();
document.layers.blub.document.write(x);
document.layers.blub.document.close();
}
x--;
timer=setTimeout("countDown()", 1000);
} else {
clearTimeout("timer");
########################
alert("COUNTDOWN beendet!");
HIER
########################
}}
</script>
</head>
<body onload="countDown()">
<div id="blub">10</div>
</body>
</html>
danke für eure hilfe
lg wurli