模拟病毒
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function openWin(num){
var count = parseInt(num);
count++;
if(count<=8){
window.open("display.html","","width=370,height=300");
tiner=setTimeout("openWin("+count+")",1000);
}else{
clearTimeout(tiner);
alert("恭喜您,中奖了!!!!!");
}
}
</script>
</head>
<body>
<p>
<input type="button" name="Submit" value="开始 " οnclick="openWin(1)">
</p>
</body>
</html>