// 如果页面被嵌入到iframe中,则以下条件必定不相等 if (window.top !== window.self) { window.location.href = '跳转到另外一个页面的地址'; }