JS:window.close()&alert()
有劳您用宝贵的时间替我解答;
问题如下:打开新窗口后无论输入mypage的值是1或0,输出的值都是1?
<!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");
var mypage=confirm("是否关闭新页面");
if (mypage=true){
mywin.close();
alert("已关闭页面!");
}
else
{
alert("未关闭页面!");
}
</script>
</head>
<body>
<script>
document.write(mypage);
</script>
</body>
</html>