---
title: "解决session过期跳转到登陆页面并跳出iframe框架一句话解决IE浏览器执行 window.location.href 跳转失"
author: "goodsense"
date: "2013-11-24T15:47:26Z"
tags: ["session失效"]
categories: ["Web前端"]
slug: "session-iframe-ie-window-location-href"
draft: false
lastmod: "2013-11-24T15:47:26Z"
id: 1979974
url: "https://goodsense.iteye.com/blog/1979974"
---

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

&lt;script language="JavaScript"&gt;   
if (window != top)   
top.location.href = location.href;   
&lt;/script&gt; 

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