You are here: irt.org | FAQ | JavaScript | Window | Q1053 [ previous next ]
The following simply opens a window two thirds the width and height of the main window in Netscape Navigator 4+ and Internet Explorer 4+:
<script language="JavaScript"><!-- var windowHandle; function myOpen(url) { if(document.all) { var width = document.body.offsetWidth*2/3; var height = document.body.offsetHeight*2/3; } else if (document.layers) { var width = window.innerWidth*2/3 var height = window.innerHeight*2/3 } else { var width=640; var height=480; } windowHandle = window.open(url,'windowName','width=700,height=400,align=left,width='+width+'height='+height); } //--></script> <a href="javascript:startToolbar('http://www.irt.org/')">text link</a>