I just noticed that top
, window
and parent
variables are giving me the same value. I was testing this at gmail inbox page. Does anybody know what is the difference between these three values?
The Window. parent property is a reference to the parent of the current window or subframe. If a window does not have a parent, its parent property is a reference to itself.
Description. An object. The topmost window in the hierarchy of windows in the current browser window.
Inside a frame, window refers to current frame's window while top refers to the outermost window that contains the frame(s). So: window. location.
It is a property of the object 'window'. It returns the location of the topmost window in the window hierarchy. If a window has no parent, top is a reference to itself (window === window.top)
If you are within a frame:
window
refers to the current frame.parent
refers to the parent of the current frame.top
refers to the outermost frame.If you're not within any frame, these will all just be a reference to the current window. If you're only within one level of frame, parent
and top
will both be a reference to the same thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With