---
title: "支持IE6、IE7的关闭页面的函数"
author: "wangyu"
date: "2009-03-17T16:40:10Z"
tags: []
slug: "ie6-ie7"
draft: false
lastmod: "2009-03-17T16:40:10Z"
id: 350449
url: "https://wangyu.iteye.com/blog/350449"
---

```js
function closeWin() {   
    var isIE6 = (window.navigator.userAgent.indexOf("MSIE 6") != -1);   
    if(isIE6) {   
        window.opener=null;   
    } else {   
        window.open('','_self','');   
    }   
    window.close();   
}
```