Redirect the page by using the timer

Saratvaddilli
Posted by Saratvaddilli under JavaScript category on | Points: 40 | Views : 2153
<script language="JavaScript" type="text/javascript">
var count =6
var redirect="http://www.code-sucks.com"

function countDown(){
if (count <=0){
window.location = redirect;
}else{
count--;
document.getElementById("timer").innerHTML = "This page will redirect in "+count+" seconds."
setTimeout("countDown()", 1000)
}
}
</script>

Our webpage has moved. Please update your bookmarks for the new site.

<span id="timer">
<script>
countDown();
</script>
</span>

Comments or Responses

Login to post response