November 2001
Intermediate to advanced
936 pages
68h 43m
English
Window.close( ) — close a browser window
JavaScript 1.0
window.close( )
The close( ) method
closes the top-level browser window specified by
window. A window can close itself by
calling self.close( ) or simply close( ).
In JavaScript 1.1, only windows opened by JavaScript can be closed by JavaScript. This prevents malicious scripts from causing the user’s browser to exit.
There is no meaningful way to close a frame within a window. Thus,
the close( ) method should be invoked only for
Window objects that represent top-level browser windows, not for
those that represent frames.
Window.open( ), the closed and
opener properties of Window