How do you make a Countdown timer?
When the user loads the page, clock starts counting down, it reaches time, it redirects browser to a new page.
Found this, it was not too useful. http://encosia.com/2007/07/25/display-data-updates-in-real-time-with-ajax/
Something like this?
<div id="countDiv"></div>
<script>
function countDown (count) {
if (count > 0) {
var d = document.getElementById("countDiv");
d.innerHTML = count;
setTimeout (function() { countDown(count-1); }, 1000);
}
else
document.location = "someotherpage.html";
}
countDown(5);
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With