Forums
This topic is locked
auto window close?
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>
<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function openWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body onLoad="window.name='home'">
<a href="javascript:void(0);" onClick="openWindow('apage.htm','myLink','width=200,height=200')">myLink</a>
</body>
</html>
<b>on the page that will be opened</b>
<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function closeWindow() {
opener.close();
}
//-->
</script>
</head>
<body onLoad="closeWindow()">
...
</body>
</html>
Edited by - ANIMESHRINE1134 on 13 Dec 2002 02:59:14
<b>on the main page</b>
<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function openWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body onLoad="window.name='home'">
<a href="javascript:void(0);" onClick="openWindow('apage.htm','myLink','width=200,height=200')">myLink</a>
</body>
</html>
<b>on the page that will be opened</b>
<html>
<head>
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function closeWindow() {
opener.close();
}
//-->
</script>
</head>
<body onLoad="closeWindow()">
...
</body>
</html>
Edited by - ANIMESHRINE1134 on 13 Dec 2002 02:59:14