<!DOCTYPE html>
<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindon()
{
var a=confirm("是否打开一个新网站");
if(a==true){
var d1=prompt("请输入网址","www.imooc.com");
if(d1!=null)
{
window.open("http://"+d1,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
</script>
</head>
<body>
<form>
<input type="button" value="新窗口打开网站" onclick="openWindon()" />
</form>
</body>
</html>没想到那么有趣啊。