PDA

View Full Version : Open new window but close main one


rowantrimmer
12-15-2002, 08:54 PM
Hello,

I am simply trying to open a javascript window and then close down the main html window that it opened up in so that the javascript window is just sitting on the desk top.

Here is my html page. I just need to know how to close down the main html page and leave the javascript window open on the desktop. Need this all to be done automatically.....

I have tried a window.close() but it prompts you to close the main html doc and does not open up the javascript window.

Any ideas ????

Merry XMAS

<html>

<body name=main onLoad=window.open("teamconfig.html","newwin","width=100px,height=300px")></body>

</html>

scroots
12-15-2002, 09:08 PM
to close a window that is not created by a script is impossible, its like me trying to close down your browser as you are viewing my site

the only way to do it would be to manually click the close button on the main html manually.
scroots

rowantrimmer
12-15-2002, 09:17 PM
Would it be possible then to open up an html page but say how big the widow is to be and not have bars at the top etc like you can do with a javascript window.open()

Many thanks in advance


Rowan

cheesebagpipe
12-16-2002, 12:06 AM
Maybe:

<body onload="window.open('teamconfig.html','newwin','width=100,height=300');self.opener=self;self.close()">
.........
.........
</body>

merry XMAS 2u

tamago
12-16-2002, 01:06 AM
Originally posted by scroots:
to close a window that is not created by a script is impossibleWell, not quite. In MSIE, at least, "window.close()" will prompt the user to close the window. If you want to close it without prompting, try the method described at <http://www.webxpertz.net/forums/showthread.php3?s=&threadid=7854> (again, MSIE-only, but it is the world's most popular browser).

Cheers :o)