Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScript¼üÅÌ

JavaScript¼üÅÌʼþÕìÌý
ÔÚʹÓÃJavaScript×öWEB¼üÅÌʼþÕìÌý²¶»ñʱ£¬Ö÷Òª²ÉÓÃonkeypress¡¢onkeydown¡¢onkeyupÈý¸öʼþ½øÐгöÀ´¡£¸ÃÈý¸öʼþµÄÖ´ÐÐ˳ÐòÈçÏ£ºonkeydown -> onkeypress ->onkeyup¡£ÔÚÒ»°ãÇé¿öÏ£¬²ÉÓÃÈýÖÖ¼üÅÌʼþ¾ù¿É¶Ô¼üÅÌÊäÈë½øÐÐÓÐЧµÄÏìÓ¦¡£µ±ÔÚʵ¼ÊʹÓÃÖУ¬»á·¢ÏÖÕ⼸ÕßÓÐЩ²»Í¬µÄ²î±ð¡£
        onkeypressʼþ²»ÄܶÔϵͳ¹¦Äܼü(ÀýÈ磺ºóÍË¡¢É¾³ýµÈ£¬ÆäÖжÔÖÐÎÄÊäÈë·¨²»ÄÜÓÐЧÏìÓ¦)½øÐÐÕý³£µÄÏìÓ¦£¬onkeydownºÍonkeyup¾ù¿ÉÒÔ¶Ôϵͳ¹¦Äܼü½øÐÐÓÐЧµÄÀ¹½Ø£¬µ«Ê¼þ½Ø»ñµÄλÖò»Í¬£¬¿ÉÒÔ¸ù¾Ý¾ßÌåµÄÇé¿öÑ¡Ôñ²»Í¬µÄ¼üÅÌʼþ¡£
        ÓÉÓÚonkeypress²»ÄܶÔϵͳ¹¦Äܼü½øÐⶻñ£¬µ¼ÖÂwindow.event¶ÔÏóµÄkeyCodeÊôÐÔºÍonkeydown£¬onkeyup¼üÅÌʼþÖлñÈ¡µÄkeyCodeÊôÐÔ²»Í¬£¬Ö÷Òª±íÏÖÔÚonkeypressʼþµÄkeyCode¶Ô×ÖĸµÄ´óСдÃô¸Ð£¬¶øonkeydown¡¢onkeyupʼþ²»Ãô¸Ð£»onkeypressʼþµÄkeyCodeÎÞ·¨Çø·ÖÖ÷¼üÅÌÉϵÄÊý×Ö¼üºÍ¸¶¼üÅÌÊý×Ö¼üµÄ£¬¶øonkeydown¡¢onkeyupµÄkeyCode¶ÔÖ÷¸¶¼üÅ̵ÄÊý×Ö¼üÃô¸Ð¡£
×¢£ºÔÚMaxthonä¯ÀÀÆ÷ÖУ¬onkeydownºÍonkeyupÓÐÁ¬ÐøÏìÓ¦Á½´Î¼üÅÌʼþµÄBUG£¬onkeydown²»ÄÜÕý³£µØ¶ÔF1~F12µÄ¹¦Äܼü½øÐÐÕý³£µÄ½Ø»ñ(onkeyupûÓз¢ÏÖ¸ÃÎÊÌâ)£¬¾ßÌåÔ­Òò²»Ã÷¡£²»ÖªµÀÒÔºóÊÇ·ñ»á½øÐж©Õý¡£
=========================================================
Javascript ¼üÅÌ keyCode ¼üÂëÖµ±í
1.×ÖĸºÍÊý×Ö¼üµÄ¼üÂëÖµ(keyCode)
°´¼ü
¼üÂë
A
65
B
66
C
67
D
68
E
69
F
70
G
71
H
72
I
73
J
74
K
75
L
76
M
77
N
78
O
79
P
80
Q
81
R
82
S
83
T
84
U
85
V
86
W
87
X
88
Y
89
Z
90
0
48
1
49
2
50
3
51
4
52
5
53
6
54
7
55
8
56
9
57
2.Êý×Ö¼üÅÌÉϵļüµÄ¼üÂëÖµ(keyCode) ¹¦Äܼü¼üÂëÖµ(keyCode)
°´¼ü
¼üÂë
0
96
1
97
2
98
3
99
4
100
5
101
6
102
7
103
8
104
9
105
*
106
+
107
Enter
108
-
109
.
110
/
111
F1
112
F2
113
F3
114
F4
115
F5
116
F6
117
F7
118
F8
119
F9
120
F10
121
F11
122
F12
123
 3.¿ØÖƼü¼üÂëÖµ(keyCode)
°´¼ü
¼üÂë
BackSpace
8
Esc 
27
Right Arrow
39
Left Arrow 
37
Down Arrow
40
Up Arrow
38
-_
189
.> 
190 
Spacebar
32&n


Ïà¹ØÎĵµ£º

Javascript code prettifier ÖÐÎÄ°ïÖúÎĵµ

Javascript code prettifier
Javascript ´úÂëÃÀÈÝʦ
°²×°Ê¹ÓÃ
ÏÂÔØ Îļþ
ÔÚÄãµÄÎļþÖаüº¬Õâ¶ùµÄ½Å±¾ºÍÑùʽ±í(ÄãÒª±£Ö¤Õâ¶ùµÄ css ºÍ js Îļþ°´ÔÚÄãµÄ·þÎñÆ÷ÉÏ, ²¢ÇÒµ÷ÕûÔÚ script ºÍ link±êÇ©ÖеÄ·¾¶)
<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" sr ......

JavaScript ×Ö·û´®×ª»»Êý×Ö

À´Ô´£ºhttp://blog.csdn.net/yjq8116/archive/2008/11/04/3219993.aspx
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ» ......

javascriptʵÏÖÕû¸öÒ³ÃæµÄ±³¾°ÑÕÉ«½¥±ä

Link:http://topic.csdn.net/u/20100317/15/687e21bc-40f3-4f0e-bc22-5f2a32ceb1a3.html?seed=1664090183&r=63989333#r_63989333
<HTML>
<head>
<title>sample</title>
<mce:script language="JavaScript"><!--
var c="FFFFFF";
window.onload=function (){
setInterval(s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ