弹出第一个询问框,点击取消为什么还会自动跳转网页。 求解答谢谢
<!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 dakai=confirm("是否打开该网页?");
if (dakai==true)
{var b=prompt("确定打开的网址","http://www.imooc.com/");
if(b=true)
{window.open('http://www.imooc.com/','_blank',width=400,height=500)}
else
{document.write("拜拜");}
}
else
{document.write("拜拜");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>