✔ 最佳答案
將<head></head>內的照抄
========================================================
大家可以將以下橙色改成自己喜歡的!
var msg = "您輸入的密碼正確.";
var url = "那裡是輸入5、1、6、8後跳到那個網址的路徑";
var password = new initArray(53,49,54,56);藍色是代碼
輸入5、1、6、8後
到test.asp
========================================================
<head><SCRIPT Language="JavaScript">
var msg = "您輸入的密碼正確.";
var url = "test.asp";
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var password = new initArray(53,49,54,56);
var pass_count=0;
var cancel_key=27;
if (document.layers) document.captureEvents(Event.KEYPRESS)
function backhome(e){
if (document.layers){
//if (navigator.appName == "Netscape"){
if (e.which==password[pass_count]) {
checkpassword();
//return false;
}
else {
pass_count=0;
//return false;
}
}
else if (document.all){
if (event.keyCode==password[pass_count]){
checkpassword();
//return false;
}
else {
pass_count=0;
//return false;
}
}
}
document.onkeypress=backhome
function checkpassword() {
pass_count++;
if(pass_count>=password.length) {
if(confirm(msg)) window.location=url;
}
}
</SCRIPT></head>
代碼
鍵盤
代碼
鍵盤
代碼
鍵盤
代碼
鍵盤
代碼
鍵盤
27
ESC
48~57
0~9
65~90
A~Z
97~122
a~z
33
!
32
SPACE
34
"
35~37
#~%
39
'
40 , 41
( , )
45
-
43
+
46
,
47 , 92
/ , \
64
@
59
;
58
:
60 , 62
< , >
61
=
42
*
91 , 93
[ , ]
94
^
123 , 125
{ , }
124 , 126
| , ~
BYE
BYE