<!DOCTYPE html>
<html>
<head>
<title> fuck window </title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script type="text/javascript">
function openWindow(){
var wid=confirm("要不要打开新窗口蛮?");
if(wid==true){
var url=prompt("确认网址哦",'http://www.imooc.com');
if(url===null){
alert("你取消个毛线");
}else{
window.open(url,'_target','width=600,height=450,left=400,top=100');
}
}else{
alert("不打开就算了嘛");
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openWindow()" />
</body>
</html>
ok!