为何在prompt语句时点取消还是会弹出空白网页?prompt那章不是说点取消返回null么?
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow(){
var ow = confirm("是否打开网站");
if(ow==true){
var ew = prompt("确认打开的网址","http://www.imooc.com/");
if(ew!=null){
window.open(ew,'_blank','width=400,hight=500,left=100,top=50,menubar=no,toolbar=no');
}else{
alert("输入无效");
}
}else{
alert("操作结束");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>