开发者

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
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜