window.self
JavaScript1.0+, JScript1.0 Nav2+, IE3+, Opera3+ Syntax
window.self.method window.self.property
Description
The self property of the Window object contains a reference to the current window. This allows you to invoke functions or call properties on the current window without any confusion when multiple windows are displayed.
Example
Listing 7.582 shows how to close the current window through the self reference.
Listing 7.582 Using the self Property to Reference the Current Window
<script language="JavaScript"> <!-- Hide // Define a function to close the current window function closeWin(){ self.close() // End hide ---> </script> |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.