Open a URL when page is loading - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window open

Description

Open a URL when page is loading

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Index Page</title> 
      <script type="text/javascript">
   function poponload()/*from w  w  w.  j ava2s.co m*/
    {
      testwindow = window.open("you want to open.html", "mywindow","location=1,status=1,scrollbars=1,width=600,height=600");
    }
  
      </script>
   </head>  
   <body onload="javascript: poponload()"> 
      <h1>Hello this can Work</h1>  
   </body>
</html>

Related Tutorials