views:

38

answers:

1

I just noticed that top, window and parent variables are giving me the same value. I was testing this at gmail inbox page. Any body knows what is the difference between these three values?

+7  A: 

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, the second two will both be a reference to the same thing.

thomasrutter