js判断当前页面是顶级窗口

<script>  
    if(top.location!=self.location){  
        alert("不是顶层窗口");
    }else{  
        alert("是顶层窗口");
    }  
</script>  

就是判断 当前这个页面是否嵌套在iframe框架中。

猜你喜欢

转载自www.cnblogs.com/coder-lzh/p/9082967.html
今日推荐