<!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 chuang=confirm("您要打开一个新的窗口吗?");
// 新窗口打开时弹出确认框,是否打开
var website;
if(chuang==true)
{ website=prompt("请确认要访问的网址并确认"
,"http://www.imooc.com" );
}
else{}
if(website!=null)
{
window.open("website","_blank","width=100
,height=500,menubar=no,toolbar=no")
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
Perona