<!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 abc=confirm("确定要打开窗口吗?")
if(abc==true);// 新窗口打开时弹出确认框,是否打开
{var abcd=prompt("请输入你的网址","www.baidu.com");
if(abcd==true);
{window.open('www.baidu.com','_blank','hight=400,width=500,toolbar=no');
}
else
{document.wirte("呵呵!");}
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
相关分类