开发者

How can you check if your document is opened in an IFrame?

开发者 https://www.devze.com 2023-01-20 10:14 出处:网络
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

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 Javascri开发者_JAVA百科pt's window.open() function.


if (window.top != window.self)
 {
}
0

精彩评论

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