怎么能让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/");if (b!=null){window.open('http://www.imooc.com/','_blank',width=400,height=500);}else{alert("bye");}}
else
{document.write("再见");}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
但怎么能让prompt仅仅输入该网址时才跳转网页,输入别的都无效呢