Abs
Abs

Reputation: 57946

How to know if a window is a child or parent window?

How can a browser window know if it is a parent window or a child window using JavaScript?

I was hoping to make use of this in a conditional.

if(parentWindow){//..

Thank you for any help.

Upvotes: 3

Views: 3293

Answers (1)

geowa4
geowa4

Reputation: 41833

if( window !== top ) 
    //then you are a child of something

Upvotes: 11

Related Questions