You are here: irt.org | FAQ | JavaScript | Window | Q1399 [ previous next ]
Try the following which works in JavaScript 1.2:
<script language="JavaScript"><!--
function openWindow(width,height) {
x = (640 - width)/2, y = (480 - height)/2;
if (screen) {
y = (screen.availHeight - height)/2;
x = (screen.availWidth - width)/2;
}
window.open('nextpage.htm','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
//--></script>
<form>
<input type="button" onClick="openWindow(100,200)" value="Click Me">
</form>