Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine if page is being viewed in iFrame

Status
Not open for further replies.

Peppi

Programmer
Apr 9, 2001
205
CA
Hi,

Is there a way to determine whether or not a page is being displayed inside of an iFrame? I need to take certain actions depending on whether or not it is.

Thx.
 
in javascript - you can attach to your body onload of the iframe.

if (parent.window.location == document.location)
{
//then this iframe has been loaded outside of
//the page you put it in.
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top