<!-- Part of javalessons.com (c)2007 SEMM(NL) All rights reserved Author:P.Hamaker For educational purposes only.-->
<html>
<head>
<style type="text/css">
.jls {
font-family: sans-serif;
font-size: large;
margin-left: 20;
margin-top: 30 }
</style>
<script type="text/javascript">
function doit( w )
{
 if ( !w )
   window.location.href = 'jsmtest.html?par=59';
 else
 {
   var str = 'width=xxx, height=yyy, resizable=yes ';
   str = str.replace( /xxx/, screen.width/2 );
   str = str.replace( /yyy/, screen.height/2 );
   var otherwin = window.open( 'jsmtest2.html', 'windowname', str );
   otherwin.moveTo( 100, 50 );
 }
}
function brow( )
{
 var elm = document.getElementById('ta1');
 elm.value = '' ;
 elm.value += '-appCodeName :\n ' + navigator.appCodeName + '\n' ;
 elm.value += '-appName :\n ' + navigator.appName + '\n' ;
 elm.value += '-userAgent :\n ' + navigator.userAgent + '\n' ;
 elm.value += '-javaEnabled :\n ' + navigator.javaEnabled() + '\n' ;
}
</script>
</head>
<body class="jls">
JavaScript Lesson window.location and navigator
<form>
<input id="bt1" type="button" value="Other page" onclick="doit(false)">
<input id="bt2" type="button" value="Page in other window" onclick="doit(true)">
<br>
<input id="bt3" type="button" value="Refresh this page"
     onclick="window.location.reload(true)">
<input id="bt4" type="button" value="Browser specs" onclick="brow()">
<textarea id="ta1" rows="7" cols="50" style="position: absolute;right: 10px;top: 10px"></textarea>
</form>
<hr><a href="http://javalessons.com"><tt>JavaLessons.com</tt></a>
</body></html>

<!-- jsmtest.html ===============
<html><head><title>Learn Javascript</title></head>
<body style="font-size: large;background-color: silver;">
Hello there, the Back button or
<a href="javascript:window.history.back()">this</a>
will take you back.<br>
The query string, passed in the URL :<tt>
<script type="text/javascript">
document.write( window.location.search.substring(1) );
</script></tt><br>
<p>And the URL :<br>
<script type="text/javascript">
document.write( window.location.href );
</script>
<hr>
<a href="http://javalessons.com"><tt>JavaLessons.com</tt></a>
</body></html>
-->
<!-- in jsmtest2.html : ...
<input type="button" value="Press this button"
onclick="window.close()">
-->