js iframe 最顶层显示

如果当前窗口不是最上层窗口(比如是在Iframe中),那么就把自己变为最上层窗口。

 <script language="javascript" type="text/javascript">
        if (window.top != null && window.top.location != window.location) {
            window.top.location = window.location;
        }
    </script>

这样就不会在长时间不动,页面会嵌套在iframe中

原文地址:https://www.cnblogs.com/wanglaowu/p/9306114.html