javascript / IE 6/7: check if within an iframe
I have a page which needs to check whether it is contained within an iframe or not in effect whether the page is the top page.
I tried doing 开发者_如何学Pythonthis: if(window == window.parent)
and it works for Opera, FF, and Chrome but not for IE. is there some trick in IE I should use?
if (top != self)
{
// I'm in an iframe
}
精彩评论