View Full Version : How to identify if a window is within an iframe

02-21-2005, 09:37 AM
I have jsp1.jsp with an iframe iframe1.jsp within. Once the http session is expired any page is redirected to a logout1.jsp page.

If the iframe1.jsp was loaded and httpsession expired the logout1.jsp is displayed inside the iframe .... but I want it to be displayed on the full screen.

My idea is to check once loading the logout1.jsp if it is inside an iframe and to reload it's parent. I tried following lines within the logout.jsp. It worked well, but caused an infinite loop ...

if (window.parent != null )

I guess it is not the correct way to check if a window is within an iframe...

02-21-2005, 01:21 PM
Have you tried using window.frameElement