关闭已打开的窗口
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>关闭已打开的窗口</title>
</head>
<script type = "text/Javascript">
var window1 = window.open("http://www.imooc.com");
if(confirm("确定要关闭吗?")){
window1.close();
}
</script>
<body>
</body>
</html>我想实现的效果是:先打开慕课网,执行confirm(“确定要关闭么”)时点击“确定”后关闭!问题是为什么不会弹出confirm对话框?帮忙解决一下 谢谢啦