splendidbob
08-11-2003, 01:20 PM
Hi folks, this has been baffling me for a while now, I have a (what should be) simple problem to solve. My HTML page opens a popup window via a form button, the user then can click another button and this window will close. V simple, should work, but i get an error in ie and it doesnt close. Heres the code:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
var swindow;
function winmess()
{
swindow = window.open('message.html', 'smallWindow', 'width=200,height=200');
}
function winclose()
{
if(swindow)
{
swindow.close();
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" value="Open" id=button1 name=button1 onClick=winmess()>
<INPUT type="button" value="Close" id=button2 name=button2 onClick = winclose()>
</BODY>
</HTML>
So, (since i see nothing wrong with this code) does anybody have any suggestions as to why it doesnt work on my comp?
thanks in advance
Bob
http://www.luminate.org.uk
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
var swindow;
function winmess()
{
swindow = window.open('message.html', 'smallWindow', 'width=200,height=200');
}
function winclose()
{
if(swindow)
{
swindow.close();
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<INPUT type="button" value="Open" id=button1 name=button1 onClick=winmess()>
<INPUT type="button" value="Close" id=button2 name=button2 onClick = winclose()>
</BODY>
</HTML>
So, (since i see nothing wrong with this code) does anybody have any suggestions as to why it doesnt work on my comp?
thanks in advance
Bob
http://www.luminate.org.uk