<script type="text/javascript">
//判断如果当前页面不为主框架,则将主框架进行跳转
var tagert_URL = "<%=request.getContextPath()%>/loginController/login";
if(self==top){
alert("aa");
window.location.href = tagert_URL;
}else{
alert("bb");
top.location.href = tagert_URL;
}
</script>
说明:
taget_URL:需要退出请求的controller
self:window.self 返回对当前窗口的引用。等价于 Window 属性
top: window.top 返回最顶层的先辈窗口。
若发现即self又是top 说明是全屏的,急需要window.location.href跳转即可
若不是则top.location.href 最外层跳转即可