Reply to Closing HTML window from child frame

Your name:

Reply:


Posted by jd on 12/12/06 13:11

Hi guys, I'm trying to create an HTML page that contains two frames.
The bottom frame should simply be some website, but the top frame needs
to have a close link to kill the window. I tried calling
'document.window.close()' from the child frame, but without success. I
then tried putting the 'close()' call in the parent page and calling it
from the child, but still without success.

Can anyone take a look at the HTML/Javascript below and let me know
where I'm going wrong?

* * * * PARENT.HTML * * * *

<HTML>
<HEAD>
<TITLE>Parent page</TITLE>
</HEAD>
<SCRIPT LANGUAGE="javascript">
function doClose() {
alert('I have been called!');
document.window.close();
}
</SCRIPT>
<FRAMESET ROWS="5%,95%">
<FRAME SRC="child.html">
<FRAME SRC="http://news.bbc.co.uk">
</FRAMESET>
</HTML>

* * * * CHILD.HTML * * * *

<HTML>
<HEAD>
<TITLE>Child frame</TITLE>
</HEAD>
<BODY>
<P ALIGN="RIGHT">
<A HREF="javascript:parent.doClose();">
<B>
<BIG> [ CLOSE WINDOW ] </BIG>
</B>
</A>
</P>
</BODY>
</HTML>

* * * * END * * * *

Many thanks in advance

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация