Switch to full style
JavaScript code examples
Post a reply

redirect after countdown

Thu Sep 15, 2011 8:09 pm

Code:

<html>
<
head>
<
title>Redirect after time</title>
<
script language="JavaScript" type="text/javascript">
var seconds =5;
var url="http://www.codemiles.com";

function redirect(){
 if (seconds <=0){
 // redirect to new url after counter  down.
  window.location = url;
 }else{
  seconds--;
  document.getElementById("pageInfo").innerHTML = "redirect after "+seconds+" seconds."
  setTimeout("redirect()", 1000)
 }
}
</script>
</head>
 

<div id="pageInfo">
<script>
 redirect();
</script>

</div>
</html>




Post a reply
  Related Posts  to : redirect after countdown
 Time countdown     -  
 Redirect to a URL     -  
 How do you 301 redirect a dynamic URL?     -  
 redirect to another page     -  
 redirect webpage using meta tag     -  
 How can i redirect to a one servlet from a two jsp page?     -  
 Redirect to a New Page javascript code     -  
 redirect page based on user selection radio button     -  

Topic Tags

JavaScript Time