这样可以运行
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
function rec(){
var mymessage=confirm("是否打开?");
if (mymessage==true) {
var score=prompt("请输入网址!");
var mywin=window.open("http://www.imooc.com","width=300,height=200,top=100,left=0");
}
else{
document.write("");
}
}
</script>
</head>
<body>
<input type="button" name="button" onclick="rec()" value="点击打开新窗口"/>
</body>
</html>