这个代码正确吗?
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function rec(){
var open=confirm("是否在新网页打开网站?");
if(open==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
else
{alert("再见"); }
else
{
var open=confirm("是否在新网页打开网站?");
if(open==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
}
}
</script>
</head>
<body>
<input type="button" value="跳转到其他网页" onclick="rec()" />
</body>
</html>