Forum Moderators: open
<script language="Javascript">
function subwinopen(pageurl,winname){
pointer=window.open(pageurl,winname,
"width="+(700)+",height="+(384)+",toolbar=yes,directories=yes,
menubar=yes,status=yes,resizable=yes,location=yes,scrollbars=1,copyhistory=no");
pointer.focus();
return pointer;
}
</script>
and it is working fine in both IE and NN.
However, when I also use the window.close function it stops working (but the window.close function works fine)in NN! In IE, both functions work.
I have the following in my code:
<a href='javascript:;' OnClick='subwinopen("http://www.xxx.xx","",450,550);'>Click here
to visit the xxx web site</a>
</td>
</tr>
<tr>
<td width="250" height="50" valign="top" align="right"><a href='javascript:;' OnClick='window.close();'>Close this window</a>
</td>
Any ideas what could be wrong? I am using NN 4.7.
Cheers
:-)Isa
[edited by: tedster at 6:48 am (utc) on Mar. 19, 2003]
to
<a href='javascript:subwinopen("http://www.xxx.xx","",450,550);'>
or this may work?
<a href='javascript:;' OnClick='subwinopen("http://www.xxx.xx","",450,550);return false;'>
and this line:
<a href='javascript:;' OnClick='window.close();'>
to
<a href="JavaScript:window.close()">
Cheers
:-)Isa
subwinopen("http://www.xxx.xx","window1")
Also, I notice that the function you've defined already sets the size of the new window as 700x384. You could turn height and width into variables and pass them as parameters whenever you call the function, but you can't expect to override them.
For some examples, see the Generic Javascript [webmasterworld.com] thread, message number 4.