Friday, January 6, 2012

Detect if the current page is running in an iframe

This is a code snippet to detect if the current page is running in a frame or not.
if (top === self) {
//not in an iframe
} else {
//in an iframe
}