<!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 open=confirm("打开网页吗?");
if (open==true){
var openit=prompt("需要打开什么网址?","http://www.imooc.com")
if (openit!=null){
window.open('http://www.imooc.com','width=400,height=500,toolbar=no,menubar=no');
}
else{}
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
很厉害