---
title: "session过期跳转到登陆页面并跳出iframe框架"
author: "kabuka"
date: "2012-04-06T17:17:45Z"
tags: []
categories: ["Web前端"]
slug: "session-iframe"
draft: false
lastmod: "2012-04-06T17:17:45Z"
id: 1441547
url: "https://kabuka.iteye.com/blog/1441547"
---

可以用javaScript解决   
在你想控制跳转的页面，比如login.jsp中的&lt;head&gt;与&lt;/head&gt;之间加入以下代码： 

```
<script type="text/javaScript"> 
if (window != top) 
top.location.href = location.href; 
</script> 


```

 

则在系统超时想在框架中打开登录页时，则login.jsp自身进行判断后跳出iframe等框架要。