如何判断当前页面是否在iframe中螃蟹就是横着走4年前更新关注24 通过如下代码: if(window!=window.top) { alert("在iframe中"); } 或: if(self!=top) { alert("在iframe中"); } THE END日积月累 收藏