最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can you check if your document is opened in an IFrame? - Stack Overflow

programmeradmin3浏览0评论

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.

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.

Share Improve this question asked Oct 12, 2010 at 20:36 leviklevik 117k28 gold badges75 silver badges92 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 25
if (window.top != window.self)
 {
}
发布评论

评论列表(0)

  1. 暂无评论