function checkParent(){ if (window.parent.length > 0 ){ window.parent.location = " login.html " ; }} < body onload = " checkParent(); " > …… < / body> 在login.html里面加上这个就可以了. 转载于:https://www.cnblogs.com/jlydboy/articles/1561891.html