<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
function Wopen(){
var a=window.confirm("確定要打開百度");
if(a== true){
window.open('http://www.baidu.com');
}else{
var b=window.confirm("納尼?想打開片片?");
if(b==true){
var c=window.prompt("叫大哥");
if(c=="大哥"){
window.open('http://www.imooc.com');
}else{
var d=window.prompt("小子你想造反?");
if(d=="想"){
alert("哥不陪你玩了");
}else{
alert("自己慢慢聯繫吧");
}
}
}else{
alert("你是弄啥類????");
}
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >
</body>
</html>