Wednesday, 20 March 2013

Auto-Redirect Page After Certain Time Period Using Javascript


Auto-Redirect Page After Certain Time Period Using Javascript


Well We always get into situation when we  have to redirect the older page to a new URL after displaying a custom message. This is useful in situations when we purchase a new domain and want to redirect the page to the new domain.

So Here I am with a solution to the above mentioned problem using Javascript:



<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Auto-Redirect</title>
    <script type="text/javascript">
    function moveTo() {
  location.href = "http://www.dotnetvishal.com";
}
window.onload=setTimeout('moveTo()', 5000);
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    This page has moved. You shall now be automatically redirected to our new page. If you are not automatically moved <a href="http://www.dotnetvishal.com">Click Here!</a>
    </div>
    </form>
</body>
</html>






No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top