怎样判断当前窗口是否嵌套了不止一层框架窗口 if (window.top !== window.parent) { console.log("当前窗口嵌入了不止一层"); } 注意, 上面的代码需要在框架窗口中执行;