<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function p()
{var open=confirm("确认新建窗口打开网站吗?");
if(open==true)
{var ur=prompt("通过输入对话框,确定打开的网址","http://www.imooc.com");
if(ur!=null)
window.open("ur""blank""width=400px,heighr=500px,menubar=no,toolbar=no");
else
alert("再见!");
}
else
{alert("再见!");}
}
</script>
</head>
<body>
<input type="button"onclick="p()" value="新窗口打开新网站" />
</body>
</html>
为什么运行不了??????????????????明明挺对的,求大神解答
window.open("ur""blank""width=400px,heighr=500px,menubar=no,toolbar=no");
改为window.open(ur,"_blank","width=400px,heighr=500px,menubar=no,toolbar=no");