輸入正確進入密碼保護頁
發(fā)布時間:2008-12-19 閱讀數: 次 來源:網樂原科技
--------------------------------------------------------------------------------
腳本說明:
把如下代碼加入區(qū)域中:
<script LANGUAGE="JavaScript">
function password() {
var testV = 1;
var pass1 = prompt('請輸入密碼(密碼是welcome):','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "welcome") {
alert('密碼正確!');
break;
}
testV+=1;
var pass1 =
prompt('密碼錯誤!請重新輸入:');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
document.write(password());
</script>
--------------------------------------------------------------------------------