This is another name for the window.window property in this context. However, self is useful because you can build reusable scripts with it that can be used with a variety of object types and instances. Don't forget that this can also refer to a frame as well as a window since they are both represented by the window object.
The self property can be used without the window prefix because it belongs to the global object in a web browser window. Using the self keyword like this makes no difference to the functionality of your script but it does make it easier to understand. For the same reason, you may want to use the window property in the same way.
See also: | Frame object, self, Window object, Window.frame, Window.window |
Prev | Home | Next |
Window.secure | Up | Window.setHotkeys() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |