<!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 a=confirm("确定要打开新的窗口吗?");
if(a==true)
{
var b=prompt("网址", "http://www.baidu.com/");
if(b!=null){
window.open( b,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
else{
alert("再见");
}
}
else{
alert("再见");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" οnclick="openWindow()" />
</body>
</html>
------------------------------------------------------------------------------------------------------------------------
1、新窗口打开时弹出确认框,是否打开
2、通过输入对话框,确定打开的网址,默认为 http://www.baidu.com/
3、打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。