windowName = window.open(URL, window name, features list)
FEATURES:
width=
height=
toolbar=no/yes
scrollbars=no/yes
status=no/yes
An example of opening a document in a new window:
|
|
To open a new window, select this link.
Once you create a new window, you can control the display of the document with JavaScript commands:
The location object can be used to specify a new URL to be displayed in the window. The location.hash property can be set to a specific location within the document.
Select this link to move to a specific part of the other window ("Growth of Computers in Society").
This link opens a new file in the other window.
To close the window, select this link.
The following fragment is set up to run a JavaScript function when the link is clicked. Complete the function to open a new window and write some text to that window. Note that the first thing you must write to the window is "<HTML><BODY>" to indicate an HTML document.
New WindowThis example writes text to a new window. Click here to start. |
Here is one way to do it.