Loading another html page from javascript and push to history - Javascript Browser Object Model

Javascript examples for Browser Object Model:History

Description

Loading another html page from javascript and push to history

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body onload="triggerJS();"> 
      <script>
        function triggerJS(){/*from www.j a  v a 2 s  .c om*/
        location.replace("http://www.java2s.com");
        /*
        location.assign("http://www.java2s.com");
        //Use assign() to have the first page in the history
        */
        }
    
      </script>  
   </body>
</html>

Related Tutorials