<!doctype html>
<!--小小鱼儿小小林-->
<html>
<head>
<body>
<script language="javascript">
<!--
loopy();
function loopy() {
var sWord = prompt("输入正确密码才能登陆!","");
var password = "123456789";
var isCancle = false;
while(sWord!=password){
if(sWord==null){
isCancle = true;
break;
}else{
sWord = prompt("输入正确密码才能登陆!","");
}
}
if(!isCancle){
alert("密码正确谢谢你的光临!");
}else{
location.replace("about:blank");
window.close();
}
}
//-->
</script>
</body>
</html>
直接复制代码即可使用