if (top!= self) {//判断网页是否嵌套在框架中 } if (top.leftFrame == null) { //判断是否存在左侧框架 } 转载于:https://www.cnblogs.com/songling/archive/2012/02/16/2354619.html