<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>密码</title>
</head><body>
<script language="javascript">
function checkpassword () {
var count = 1;
var password = prompt("请输入密码(密码是password):","");
while (count < 3) {
if (!password) {
window.history.back(1);
return;
} else if (password =="password") {
alert ("密码正确!");
break;
}
count += 1;
password = prompt("密码错误,请重新输入:", "");
}
if (count == 3) {
alert("三次错误");
window.history.back(1);
return;
}
return "OK";
}
document.write(checkpassword());
</script>
<p align="center"><font size="6"><b>欢迎访问我的网站</b></font></p>
</body>
</html>
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>密码</title>
</head><body>
<script language="javascript">
function checkpassword () {
var count = 1;
var password = prompt("请输入密码(密码是password):","");
while (count < 3) {
if (!password) {
window.history.back(1);
return;
} else if (password =="password") {
alert ("密码正确!");
break;
}
count += 1;
password = prompt("密码错误,请重新输入:", "");
}
if (count == 3) {
alert("三次错误");
window.history.back(1);
return;
}
return "OK";
}
document.write(checkpassword());
</script>
<p align="center"><font size="6"><b>欢迎访问我的网站</b></font></p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>密码</title>
<script language="javascript">
function checkpassword () {
var count = 1;
var password = prompt("请输入密码(密码是password):","");
while (count < 3) {
if (!password) {
window.history.back(1);
return;
} else if (password =="password") {
alert ("密码正确!");
break;
}
count += 1;
password = prompt("密码错误,请重新输入:", "");
}
if (count == 3) {
alert("三次错误");
window.history.back(1);
return;
}
return "OK";}
document.write(checkpassword());
</script>
</head>
<body>
<p align="center"><font size="6"><b>欢迎访问我的网站</b></font></p>
</body>
</html>