怎么能让消息对话框prompt点击取消后不跳转网页
<!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 a=confirm("是否打开?");
if(a==true)
{var b=prompt("确定打开的网址","http://www.imooc.com/");window.open('http://www.imooc.com/','_blank',width=400,height=500)}
else
{document.write("再见");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
现在prompt点击取消也会跳出网页,怎么能不跳出网页?