I have a JavaScript that deals with with detection whether the page is in frames or not. I used top.frames[] etc. and everything works fine.
In this script I notice
From Javascript: The Definitive Guide:
The Window object defines a number of properties and methods that allow you to manipulate the web browser window. It also defines properties that refer to other important objects, such as the
documentproperty for the Document object. Finally, the Window object has two self-referential properties,windowandself. You can use either global variable to refer directly to the Window object.
In short, both window and self are references to the Window object, which is the global object of client-side javascript.