<P><B>This page contains a JavaScript that open a new window with a specified size and contents</B></P>
<P>
The JavaScript functions in this page lets you open a file in a new window - you can also specify the size of the window and if the toolbar and other parts of the windows user interface should be displayed.</P>
<P>
We use it to create a small remote control that will let you choose between some of the other JavaScript Examples included with PageSpinner. The source of the remote control page is in the <A HREF="remote.html">remote.html</A>.</P>
<P>
Since the window size is specified in pixels, it is recommended to use a table with a preset size in pixels or images as the contents of the page. In our example we can't be sure that the full table will be visible in the window, so we choose to let the scrollbars be visible, but disables most other user-interface parts of the window.</P>
<P>1) Copy the entire script section in the beginning of this document and place it inside the script section in your page.</P>
<P>
When we create a window, a window name is not required. But to be able to refer to the window by name from another window, we name the window "displayWindow". When referring to the window from this document, we can use the variable "msgWindow" to access the window directly though. This is the code that performs the work:</P>
2) Change the setting of the window options by editing the text, most options accepts the values <I>yes</I> or <I>no</I>. Please note that some browsers, like Navigator 2.0 and 3.0, will not use all specified options.</P>
<P>
The following options and values can be specified when opening a new window:</P>
<UL>
<LI>toolbar[=yes|no]|[=1|0]
<LI>location[=yes|no]|[=1|0]
<LI>directories[=yes|no]|[=1|0]
<LI>status[=yes|no]|[=1|0]
<LI>menubar[=yes|no]|[=1|0]
<LI>scrollbars[=yes|no]|[=1|0]
<LI>resizable[=yes|no]|[=1|0]
<LI>width=pixels
<LI>height=pixels
</UL>
<HR>
<P>
3) Replace the filename, <CODE>"remote.html"</CODE>, with the name of the page that contains your remote control. You can of course put other contents in the window that is opened, e.g., a guided tour of your site, (see the <A HREF="../Miscellaneous Examples/Autoload.html">autoload</A> example) or you can use it as status window.</P>
<HR>
<P>
4) Then use code similar to this to let the audience show or hide the window by clicking on a <B>link</B>:<BR></P>
is repeated twice. This is necessary to work around a bug in version 2.0.x of Navigator. If there only is a single <CODE>"window.open"</CODE> statement, the created window will be empty in Navigator 2.0.x. </P>
<P>
Also note that Navigator 2.0.1 and 3.0.1 always will display a size box regardless which value <CODE>resizable</CODE> is set to. Navigator 4.0.1 and Internet Explorer 3.01 handles the resizable setting correctly.</P>