Print Page | Close Window

Help needed open/close automatically

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6954
Printed Date: 31 March 2026 at 3:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help needed open/close automatically
Posted By: Pegaso
Subject: Help needed open/close automatically
Date Posted: 03 November 2003 at 11:19am

I'm working on a new site, here is the testing site:

http://www.ticinorally.com/aap/newsite/ - http://www.ticinorally.com/aap/newsite/

how you can see when you enter in the index.html, the site open automatically a site with dimension of 800 x 600.

Now, when the 800 x 600 page is loaded that the index.html will be closed automatically.

Can anyone help me or suggest another good solution?



-------------



Replies:
Posted By: michael
Date Posted: 03 November 2003 at 1:39pm
with most browser settings you can only close pages you opened with window.close but you cannot close a user initiated window.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Flamewave
Date Posted: 03 November 2003 at 2:56pm
well, you can, but it will give the user a warning message saying that the page is trying to close itself.

-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: JoeP
Date Posted: 03 November 2003 at 3:39pm

Is it possible to redirect instead of reloading?  If so this script may be of use to you:

http://www.dhtmlshock.com/other/ResolutionSniffer/default.asp - http://www.dhtmlshock.com/other/ResolutionSniffer/default.as p

As stated above, only a popup can be closed with window.close().  Flamewave is also correct, and that warning message can not be turned off.



Posted By: Pegaso
Date Posted: 03 November 2003 at 3:48pm

Index.html is the blank site
Main.html is the site in 800 x 600 pixel (pop-up)

My idea was to insert in the index.html a Open Window command to open Main.html. That was not a problem.

Then, when main.html is loaded main.html will close index.html so that the system didn't show the warning message (that the page is trying to close itself).

I know that if it's possible, i need a javascript, but i didn't know javascript.



-------------


Posted By: zaboss
Date Posted: 03 November 2003 at 11:26pm
http://www.javascriptkit.com - www.javascriptkit.com . You'll find it most usefull. I know I do .

-------------
Cristian Banu
http://www.soft4web.ro - Soft 4 web


Posted By: Pegaso
Date Posted: 04 November 2003 at 1:25am

Wow thanks Zaboss. And for all the people that have the same problem, here you have the script:

Put in the <head> the following script:

<script language="JavaScript" type="text/JavaScript">
<!--
opener.opener = top; // or whatever, as long as opener.opener has a value;
opener.close()
//-->
</script>

And add to the <body> script this:

<body onLoad="opener.top.close()">

This script will automatically close the page that has loaded you "Pop-up".



-------------



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net