<SCRIPT language=JavaScript>
function password() {
var testV = 1;
var pass1 = prompt('请输入密码:','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "cy0575") {
alert('密码正确!');
break;
}
testV+=-1;
var pass1 = prompt('你好密码错误!请重新输入:');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
document.write(password());
</SCRIPT>
```
只需要把此代码放入到〈/head〉标签前即可"/
挺不错的分享给大家。 |