Variables in the global scope are automatically exposed as the DOM properties of their containing window object.
It means that
var foo = 'bar';
similarly
window.foo = 'bar';
This means that you can read the global area of ββany window object that you can reference. Here we can also imply that the use of window implicit. Even when you do not explicitly enter a "window", it is all the same.
And since the frames themselves are also automatically displayed as DOM properties of the current window object, this means that you can also access any other window object.
The parent property of window objects contains a reference to the window object of this window parent (if any). Since the iframe certainly has a parent window, then all of these things that I just printed boil down to this
// set the global variable 'foo' in the parent global scope parent.foo = 'bar';
Peter Bailey Aug 19 '09 at 18:05 2009-08-19 18:05
source share