Javascript examples for Browser Object Model:Window open
Open a page with window open function and change URL
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww . jav a 2 s .c om*/ function doSomething() { window.open("http://www.google.com"); window.location.replace("http://java2s.com"); return false; } } </script> </head> <body> <a href="#" onclick="doSomething();">Test</a> </body> </html>