代码运行结果略奇怪,不懂。
var mywin=window.open("http://www.imooc.com");
var close=confirm("are u sure to close it?");
if(close==true)
{
mywin.close();
alert("closed already.");
}
else(close==false)
{
alert("stay open.");
}
为啥我的这段代码,提示框选择了“TRUE”,先跳出"closed already."的提示框,点击“确定”,又跳出“stay open.”?