[thelist] Javascript Windows ?

Timothy Martens timfm at hawaii.rr.com
Thu Mar 7 20:52:00 CST 2002


I have a fairly straight forward pop-up script which centers a window on
screen. Everything is working as it should in IE5+, but Netscape6
doesn't seem to resize the two windows according to the width/height
arguments. In fact IE opens a 2nd different and sizes it correctly
whereas N6 loads the 2nd window's contents into the 1st shell without
resizing. Even if I close the first window in N6 and then click to open
the 2nd -- it doesn't resize, but simply keeps the original dimensions?

<body>
<script language="JavaScript" type="text/javascript">
<!--
var win = null;
function popCenter(theURL, winName, w, h) {
	if (window.screen) {
var fromLeft= screen.availWidth;
var fromTop= screen.availHeight;
var settings= 'width =' + w + ',height =' + h + ',left=' + ((fromLeft -
w - 10) * .5) + ',top=' + ((fromTop - h - 30) * .5) +
'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resi
zable=1';
	win= window.open(theURL, winName, settings);
	}
	if (window.focus) {
	win.focus();
	}
}
//-->
</script>
<p><a href="javascript:popCenter('charactermap.html', 'pop1', '724',
'266');">Launch the Complete Character Map</a><br />
<a href="javascript:popCenter('charactermap2.html', 'pop2', '488',
'249');">Launch the Common Character Map</a></p>
</body>

Any ideas. I think it has something do with the client not knowing var =
null when the window's been closed?

//t




More information about the thelist mailing list