Redirect with a Timer

You can use JavaScript window.location to redirect a visitor to a required page. You may have seen this feature used by sites with full page ads, or to redirect visitors to the site's new domain name. You can add also a timer to the script that will allow the page to redirect and the visitors will not need to click a link or type in the new URL.

[View All Snippets]
Show Plain Text »
  1. <script type="text/javascript">
  2. var count = 6;
  3. var redirect = "";
  5. function countDown(){
  6.     var timer = document.getElementById("timer");
  7.     if(count > 0){
  8.         count--;
  9.         timer.innerHTML = "This page will redirect in "+count+" seconds.";
  10.         setTimeout("countDown()", 1000);
  11.     }else{
  12.         window.location.href = redirect;
  13.     }
  14. }
  15. </script>
  17. Our webpage has beed moved. Please update your bookmarks for the new site.
  18. <br>
  20. <span id="timer">
  21. <script type="text/javascript">countDown();</script>
  22. </span>
Create Your Free Account
Please remember that this information is essential to use our services correctly.
After creating the account you will be able to download all of our FREE products.
Fields marked with * are mandatory

Please send me information about updates, new products, specials and discounts from ApPHP!
We recommend that your password should be at least 6 characters long and should be different from your username/email. Please use only letters of the English alphabet to enter your name.

Your e-mail address must be valid. We use e-mail for communication purposes (order notifications, etc). Therefore, it is essential to provide a valid e-mail address to be able to use our services correctly.

All your private data is confidential. We will never sell, exchange or market it in any way. Please refer to Privacy Policy.

By clicking "Create Account", you are indicating that you have read and agree to the ApPHP Terms & Conditions.