Check if parent window is iframe or not

This is true if a window is not a frame/iframe:

if(self==top)

If you like to see if the parent window of the given window is a frame, use:

if(parent==top)

It’s a simple comparision of top (the most top window of the window hierarchy) and another window object (self or parent).

Leave a Comment