| Author |
Topic Search Topic Options
|
Pegaso
Mod Builder Group
Joined: 13 February 2003
Location: Switzerland
Status: Offline
Points: 138
|
Post Options
Thanks(0)
Quote Reply
Topic: Help needed open/close automatically 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/
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?
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
Flamewave
Senior Member
Joined: 19 June 2002
Location: United States
Status: Offline
Points: 376
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |
JoeP
Newbie
Joined: 10 October 2003
Location: United States
Status: Offline
Points: 38
|
Post Options
Thanks(0)
Quote Reply
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.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.
Edited by JoeP
|
 |
Pegaso
Mod Builder Group
Joined: 13 February 2003
Location: Switzerland
Status: Offline
Points: 138
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2003 at 11:26pm |
www.javascriptkit.com. You'll find it most usefull. I know I do  .
|
|
|
 |
Pegaso
Mod Builder Group
Joined: 13 February 2003
Location: Switzerland
Status: Offline
Points: 138
|
Post Options
Thanks(0)
Quote Reply
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".
|
|
|
 |