Click here to Skip to main content
15,902,777 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Whenever a webpage is opened how do i make sure that it is the parent window. So that i can add a certain functionality to my webpage.


Thanks
Posted

1 solution

Try something like:
if(parent.frames.length==0)
{
  // no parent
}


OR
if (window.opener == null) 
{
  // no parent
}
 
Share this answer
 
Comments
Espen Harlinn 13-Mar-11 6:03am    
My 5, nice and simple :)
Sergey Alexandrovich Kryukov 13-Mar-11 15:24pm    
Agree, same vote.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900