window.top引用顶层框架 if(top!=self){ //当当前非顶层框架,当前页面跳转 top.location.href=self.location.href; } 转载于:https://www.cnblogs.com/hangsarea/p/6869831.html