Click to See Complete Forum and Search --> : closing main window


emcod
04-09-2003, 11:41 AM
hello,

I am using script that automatically opens a new window when the first window loads. What I need to know is if there is a way to have the first window -- NOT the new window -- close automatically after it launches the new window. Closing the new window appears easy enough, but can't find anything that will accomplish this for the first window.

Here's the script I'm using to open the new window:

<script language="JavaScript">
<!--

var screenW = screen.width, screenH = screen.height;
w = window.open('index.htm','newWindow','width=' + screenW + ',height='+ screenH +',top='+ 0 +',left='+ 0 +',scrollbars=no,toolbar=no,status=no,titlebar=no,resizable=yes');
-->
</SCRIPT>

Thanks!

gil davis
04-09-2003, 11:45 AM
window.close();but you will get a pop-up warning that the file is trying to close the window.

emcod
04-09-2003, 11:56 AM
Tried this, but not sure where to put it to make it work, and how to execute it. Could just add a link or a button to the page that the user would click to make the window close, but would rather the page closed automatically. I want to avoid the user ever seeing browser's address bar.