Forums

This topic is locked

auto window close?

Posted 12 Dec 2002 23:10:14
1
has voted
12 Dec 2002 23:10:14 G VW posted:
I am wondering if there is a way to set up a page to automatically close. I am using a Chromless Window Extension and when the index page is loaded, the new chromless window loads immediately, but I would like the index page to close automatically, so the person viewing the web page will not have to close that window as well, if this is possible. I hope someone has some suggestions for me. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Thanks in advance,

Glen.

Replies

Replied 13 Dec 2002 01:34:26
13 Dec 2002 01:34:26 Dan The Man replied:
this will do the trick

<b>on the main page</b>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script language="JavaScript" type="text/JavaScript"&gt;
&lt;!--
function openWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onLoad="window.name='home'"&gt;
&lt;a href="javascript:void(0);" onClick="openWindow('apage.htm','myLink','width=200,height=200')"&gt;myLink&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;

<b>on the page that will be opened</b>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;script language="JavaScript" type="text/JavaScript"&gt;
&lt;!--
function closeWindow() {
opener.close();
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onLoad="closeWindow()"&gt;
...
&lt;/body&gt;
&lt;/html&gt;

Edited by - ANIMESHRINE1134 on 13 Dec 2002 02:59:14

Reply to this topic