这样OK不?
<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow() {
if (confirm("打开新窗口")) {
if (var newpage=prompt("打开新窗口","http://www.imooc.com/")){
window.open(newpage,'_blank',"width=400px,height=500px,menubar=no,toolbar=no,scrollbars=no,status=no");
}
else{
alert("你选择了取消");
}
}
else {
alert("你选择了取消");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>