You are here: irt.org | FAQ | JavaScript | Window | Q198 [ previous next ]
In Netscape Navigator 4 the screenX and screenY attributes were introduced. In Internet Explorer 4 the top and left attributes were introduced. By combining the two both Netscape Navigator 4 and Internet Explorer 4 will allow you to position the window:
<script language="JavaScript"><!--
function openWindow() {
msgWindow = window.open('','newWin','width=100,height=100,screenX=400,screenY=400,top=400,left=400');
msgWindow.location.href = 'apage.html';
}
//--></script>
<form>
<input type="button" onClick="openWindow()" value="Click Me">
</form>