<!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 myWin = comfirm("是否打开?");
if(myWin==true){
var myWeb=prompt("请输入你的网址","http://www.imooc.com/");
window.open(myWeb,'_blank','width=400,height=500,toolbar=no,menubar=no');
}
else{
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
var myWin = comfirm("是否打开?");
其中“comfirm”写错了
大哥,mywin的后面那个是confirm,不是comfirm,然后再将else那一整段删了,应该就可以了