Click to See Complete Forum and Search --> : Close FRAMED Windows


dcjones
01-10-2003, 03:45 AM
Hi all,

Please help if you can.

I have a Framed Page with TOP_FRAME and BOTTOM_FRAME.

I need to add a CLOSEWINDOW Function which will close the FRAMESET. I can write the script to close the TOP_FRAME and the BOTTOM_FRAME but not both together.

THE FRAMESET.

<html>
<head>
<title>External Link</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="74,*" frameborder="NO" border="0" framespacing="0" cols="*">
<frame name="topFrame1" scrolling="NO" noresize src="TOPFRAME.htm" >
<frame name="mainFrame" src="http://www.hmce.gov.uk">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes>
</html>

TOPFRAME.

<html>
<head>
<title>External Link Top Frame</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function closewindow(curcon) {
window.close();
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" background="../images/Background.gif">
<table width="100%" border="3" bordercolor="#990000">
<tr>
<td width="68%"><img src="../images/retrun.gif" width="251" height="44" usemap="#Map" border="0"></td>
<td width="32%">
<div align="right"><img src="../images/homepage.gif" width="236" height="33" align="top"></div>
</td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="106,24,155,35" href="javascript:closewindow()">
</map>
</body>
</html>

BOTTOM FRAME.

This is an external link.


Can you help please.



Regards,

Dereck

vickers_bits
01-10-2003, 04:14 AM
not sure exactly what you're on about but i think you want to close the top frame, but leave the bottom frame in the window.

i think it will reload the bottom frame but...

function closewindow(){
//if your frameset is within a 3rd party frameset, only breakout of yours
if (top==parent)
top.location.href=top.mainFrame.location.href;
else
parent.location.href=parent.mainFrame.location.href;
};

dcjones
01-10-2003, 04:17 AM
Hi and thanks for your reply.

I want to close the complete FRAMESET, both top and bottom.

Can you help please


Regards


Dereck

dcjones
01-10-2003, 08:19 AM
Originally posted by dcjones
Hi and thanks for your reply.

I want to close the complete FRAMESET, both top and bottom.

Can you help please


Regards


Dereck