10

Is there a way to know if your page is opened inside of an IFrame?

An idea I had was to see if the window object has a .parent property, but this apparently is also true of standalone windows which are opened by Javascript's window.open() function.

levik
  • 114,835
  • 27
  • 73
  • 90

1 Answers1

24
if (window.top != window.self)
 {
}
John Hartsock
  • 85,422
  • 23
  • 131
  • 146