Countdown and Redirect Script

Occasionally, you may wish to have a redirect page that pauses for a few seconds before sending the visitor off to the destination. For example, there may be important text on the redirect page you wish the visitor to get a chance to read, or a banner ad to see.before proceeding. This redirect script understands that, and pauses for any given seconds before navigating to the target page!

Example

Click here for an example.

Code

<form name="redirect">
<center>
<font face="Arial"><b>You will be redirected to the page in<br><br>
<form>
<input type="text" size="3" name="redirect2">
</form>
seconds</b></font>
</center>

<script>
<!-- 
/* Count down then redirect script by DeanLJBirch (https://deanljbirch.com) */

//change below target URL to your own
var targetURL="https://deanljbirch.com"

//change the second to start counting down from
var countdownfrom=10

var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>