判断是否存在父页面

if(window.top === window.self) {//不存在

}

原文地址:https://www.cnblogs.com/liuswi/p/6840167.html