<!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 newc = confirm("是否打开新窗口:");
if(newc)
{
var newurl = prompt("输入URL:","http://www.baidu.com")
if(newurl!='')
{
window.open(newurl,'_blank','width=400,height=100,top=100,left=100,toolbar=no,scrolbar=no');
}
else
{
window.open('http://www.baidu.com','_blank','width=400,height=100,top=100,left=100,toolbar=no,scrolbar=no')
}
}
else
{
document.write("byebye")
}
}
</script>
</head>
<body>
<form>
<input type="button" value="新窗口打开网站" onclick="openWindon()" />
</form>
</body>
</html>