<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
<script type="text/javascript">
function Wopen(){
window.open('http://www.baidu.com','_blank','height=400,width=600,top=100dp,left=0dp');
window.close();
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
</body>
</html>
你这样关闭的是你原来的那个页面, 你应该关闭的是你打开的那个页面的对象
var mychar =window.open('http://www.baidu.com','_blank','height=400,width=600,top=100dp,left=0dp');
mychar.close();
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>close()</title>
<script type="text/javascript">
var mywin=window.open("http://www.imooc.com");
setInterval(function(){
mywin.close();
},3000);
</script>
</head>
<body>
</body>
</html>