---
title: "(转)解决IE6底下，后台Response.Redirect被迫中断的问题 "
author: "grey2"
date: "2012-05-29T13:10:30Z"
tags: []
categories: ["Web前端"]
slug: "ie6-response-redirect"
draft: false
lastmod: "2012-05-29T13:10:30Z"
id: 1543823
url: "https://grey2.iteye.com/blog/1543823"
---

**1、&lt;ahref="javascript:void(0);"onclick="if(xxx){location.href='a.aspx';}"&gt;xx&lt;/a&gt;**  
**如果a.aspx里Response.Redirect302跳转，在IE6下会出现无法跳转的问题，**  
**因为IE6，会在执行完onclick代码再执行href里的内容，void(0)会取消后面的跳转，所以虽然服务器收到请求，但是此时ie已经取消连接了**  
**解决方案：**  
**1、改成href="#0"，用#0而不是#，是因为#会跳转到页首，#0则不会**  
**2、onclick改成：if(xxx){location.href='a.aspx';}returnfalse;//加个returnfalse**  
**3、取消href，或使用其它非a的标签**  
**4、改成href="javascript:if(xxx){location.href='a.aspx';}void(0);"//js里不能引用this，href里的this指document，而不是a标签**