请问:为什么按取消键还是弹出新窗口,而不是弹出alert的内容?
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow()
{
var openorno=confirm("是否打开网址?");
if (openorno=true)
{
var openwhich=prompt("打开网址为:","http://www.imooc.com/")
if (openwhich=null){window.open("openwhich","_blank","width=400,height=500,menubar=no,toolbar=no");}
else{alert("已关闭!");}
}
else{alert("不打开网页!");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>