August 1999
Intermediate to advanced
1488 pages
72h 53m
English
window.close()
The close() method of the Window object is used to close browser windows. Even though this method was first introduced in JavaScript 1.0, there have been some changes. In the first version, this method could be used to close any window. In JavaScript 1.1, it was restricted to close only windows opened using JavaScript. In JavaScript 1.2, you must have the UniversalBrowserWrite privilege to unconditionally close a window.
Listing 7.531 has a button that opens a window. Within the opened window there is a Close button. Clicking this button invokes the close() method and closes the browser window.
Read now
Unlock full access