parent和top

function show(){
 //parent是获取本窗口的父窗口  
 //window.parent.location.href="http://www.baidu.com"; 
 //top是获取本窗口的最顶端窗口
 window.top.location.href="http://www.baidu.com"; 
 }

原文地址:https://www.cnblogs.com/danmao/p/3819179.html