如何检查当前窗口是否为父窗口 [英] How to check whether the current window is parent or not

查看:77
本文介绍了如何检查当前窗口是否为父窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论何时打开网页,我如何确保它是父窗口.这样我就可以在网页中添加某些功能.


谢谢

Whenever a webpage is opened how do i make sure that it is the parent window. So that i can add a certain functionality to my webpage.


Thanks

推荐答案

尝试类似的方法:
Try something like:
if(parent.frames.length==0)
{
  // no parent
}






OR

if (window.opener == null) 
{
  // no parent
}


这篇关于如何检查当前窗口是否为父窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆