[Javascript] Re: Windows

Rodney Myers rodney at aflyingstart.net
Tue May 14 13:48:02 CDT 2002


The script to close a window is window.close() or self.close()

But this will only work immediately on windows that were opened by javascript.

The user's default window can only be closed after an OK/Cancel dialog is displayed -
which the browser arranges for you. You do not have to script it and nor can you prevent
it from appearing.

You might try resizing the window, and putting a message in it to explain. Or just create
a blank coloured screen.

hth

Rodney

phumes1 wrote:

> Hi,
>
> I have a index.htm file that I want to open without all the toolbars and
> menubars etc.etc...
>
> I' can't seem to get it to work. I have a "load.htm" which has some JS that
> loads my index.htm file into another window without all the toolbar crud at
> the top. I can't seem to get the previous window (load.htm) file to close.
>
> Whats the best way of going about this?
>
> Help Please!
>
> load.htm
> ------------
>
> <head>
>          <title></title>
>
> <SCRIPT LANGUAGE="JavaScript">
>
> <!-- Begin
> function popupPage() {
> var page = "index.htm";
> windowprops = "height=620,width=800,location=no,"
> + "scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
> window.open(page, "Popup", windowprops);
> }
> //  End -->
> </script>
>
> </head>
>
> <BODY onLoad="setTimeout('popupPage()', 1000);">
>
> </body>
>
> index.htm
> -------------
>
> <head>
> <title></title>
> </head>
>
> <body>
>
> <p>This is a test</p>
>
> </body>
>
> +-----------------------------------------------------------------------------------+
>
> Philip Humeniuk
> phumes1 at rogers.com
> phil.humeniuk at rogers.com
> +------------------------------------------------------------------------------------+
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list