Javascript - Page Redirect

<html>
   <head>
      <script type = "text/javascript">
         <!--
            function Redirect() {
               window.location = "https://www.tajau.com";
            }
         //-->
      </script>
   </head>
 
   <body>
      <p>Click the following button, you will be redirected to home page.</p>
     
      <form>
         <input type = "button" value = "Redirect Me" onclick = "Redirect();" />
      </form>
     
   </body>
</html>

<html>
   <head>
      <script type = "text/javascript">
         <!--
            function Redirect() {
               window.location = "https://www.tajau.com";
            }           
            document.write("You will be redirected to main page in 10 sec.");
            setTimeout('Redirect()', 10000);
         //-->
      </script>
   </head>
 
   <body>
   </body>
</html>

You will be redirected to tutorialspoint.com main page in 10 seconds!

<html>
   <head>   
      <script type = "text/javascript">
         <!--
            var browsername = navigator.appName;
            if( browsername == "Netscape" ) {
               window.location = "http://www.location.com/ns.htm";
            } else if ( browsername =="Microsoft Internet Explorer") {
               window.location = "http://www.location.com/ie.htm";
            } else {
               window.location = "http://www.location.com/other.htm";
            }
         //-->
      </script>     
   </head>
 
   <body>
   </body>
</html>

No comments:

Post a Comment

Welcome

Lets learn java script