HTML and CSS Reference
EXAMPLE 13.7 ( CONTINUED )
A user-defined function, called newWindow() , will create a new window object
with the window object's open() method, specified with a number of options to
further define the window.
The new window object contains an image called summertime.jpg .
The new window is moved to the left corner of the screen, pixel position (0,0).
The new window gets focus. It will be on top of all the other windows.
This user-defined function is responsible for closing the new window.
The close() method of the window object causes the new window to be closed.
When the user clicks this button, the onClick event handler is triggered, and a new
window will be opened.
When the user clicks this button, the onClick event handler is triggered, and the
new window will be closed. The output is shown in Figures 13.7 and 13.8.
Figure 13.7 The parent window.
Figure 13.8 The new window is in focus and will appear on top of its parent window.