js操作Iframe非当前最上层窗体

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


 <script language="javascript" type="text/javascript">
        if (window.top != null && window.top.location != window.location) {
            window.top.location = window.location;
        }
    </script>
原文地址:https://www.cnblogs.com/haofaner/p/3661977.html