November 7, 1999 - Window References
![]() |
November 7, 1999 Window References Tips: November 1999
Yehuda Shiran, Ph.D.
|
window object. The window object of a child frame is actually a property of the parent's window object.
The self property retrieves a reference to the current window or frame. The parent property retrieves the parent of the window in the object hierarchy. Finally, the top property retrieves the topmost ancestor window, which is its own parent. In other words, if self is equal to self.parent, then the current window doesn't have a parent, meaning it is the topmost window. In this case, self is also equal to self.top. The following diagram illustrates the usage of these window references:

Note that recursive references are possible. For example, window.window.window evaluates to window, which is also equivalent to self.self.self.



