如何在打开的新的窗口里用弹出confirm对话框关闭窗口
<!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",_top);
var close=confirm("关闭页面?")
if(close!=null){
if(close==true){
mywin.close();
}
else{}
}
</script>
</head>
<body>
</body>
</html>