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

½áºÏcanvas½øÐÐjavascriptÐÔÄܲâÊÔ

ÔÚ¶Ô³ÌÐò½øÐÐÐÔÄܲâÊÔʱÐèÒª¿¼Âǵ½²»Í¬¹æÄ£ÒÔ¼°²»Í¬Ëã·¨µÄЧÂʵIJ»Í¬
ÏÂÃæµÄÍøÒ³ÊÇÒ»¸ö¶ÔÅÅÐòËã·¨µÄÐÔÄܲâÊÔ£¬¹æÄ£¾ÍÊÇÊý×éµÄ³¤¶È£¬¶ø²âÊÔµÄÁ½¸öº¯Êý·Ö±ðÊÇÊÖ¶¯ÊµÏֵĿìËÙÅÅÐòËã·¨ºÍjavascriptÄÚÖõÄÅÅÐòº¯Êý¡£
<!DOCTYPE window PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Performance</title>
<mce:script type="text/javascript"><!--
var $ = function(id) {
return document.getElementById(id);
};
$.extend = function(target, object) {
for (var i in object) {
target[i] = object[i];
}
return target;
};
// --></mce:script>
<mce:script type="text/javascript" src="performance.js" mce_src="performance.js"></mce:script>
<mce:script type="text/javascript"><!--
var a;
function qsort(l, u) {
if (l >= u) {
return undefined;
}
var i = l, j = u - 1, v = a[u], t;
while (1) {
while (a[i] < v) { i += 1; }
while (a[j] > v) { j -= 1; }
if (i >= j) {
break;
}
t = a[i];
a[i] = a[j];
a[j] = t;
i += 1;
j -= 1;
}
t = a[i];
a[i] = v;
a[u] = t;
qsort(l, j);
qsort(i + 1, u);
};
performance({
// resetº¯ÊýÔÚÿ´Î¸Ä±ä¹æģʱ±»µ÷Ó㬲ÎÊýxÊǹæÄ£
// Éú³ÉÒ»¸ö³¤¶ÈΪxµÄËæ»úÊý×é
reset: function(x) {
a = [];
while (x--) {
a[x] = ~~(Math.random() * x);
}
},
func: [
function quicksort(x) {
qsort(0, x);
},
function nativesort(x) {
a.sort();
}
],
dimensionStart: 1,
dimensionEnd: 1000,
dimensionIncrement: 1,
});
// --></mce:script>
</head>
<body>
<canvas id="canvas" width="1400" height="800"></canvas>
</body> 
performance.js°üº¬Ö÷ÒªµÄ½øÐвâÊԵĴúÂë¡£ÔÚ¿ØÖÆ̨ÖÐÊäÈëperformance.start()¿ªÊ¼½øÐвâÊÔ£¬¿ÉÒÔ¿´µ½canvasÉÏ´Ó×óµ½ÓÒ³öÏÖºÚÉ«ÓëºìÉ«µÄµã£¬ºÚÉ«´ú±íquicksort£¬¶øºìÉ«´ú±ínativesort
¿ÉÒÔËæʱperformance.end()ÖÕÖ¹²âÊÔ
ͼÏñÖеĺáÖá±íʾ¹æÄ££¬¶ø×ÝÖá±íʾÔËÐеÄ


Ïà¹ØÎĵµ£º

javascriptÖÐevent.keycode´óÈ«

keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
keycode 33 = Prior
keycode 34 ......

JavaScript»ù±¾Êý¾Ý½á¹¹ [2]

JavaScriptÌṩ½Å±¾ÓïÑԵıà³ÌÓëC++·Ç³£ÏàËÆ£¬ËüÖ»ÊÇÈ¥µôÁË£ÃÓïÑÔÖÐÓйØÖ¸ÕëµÈÈÝÒײúÉúµÄ´í
Î󣬲¢ÌṩÁ˹¦ÄÜÇ¿´óµÄÀà¿â¡£¶ÔÓÚÒѾ­¾ß±¸£Ã++»ò£ÃÓïÑÔµÄÈËÀ´Ëµ£¬Ñ§Ï°JavaScript½Å±¾ÓïÑÔÊÇÒ»¼þ·Ç³£ÇáËÉÓä¿ìµÄÊ¡£
Ò»¡¢JavaScript´úÂëµÄ¼ÓÈë
¡¡¡¡JavaScriptµÄ½Å±¾°üÀ¨ÔÚHTMLÖУ¬Ëü³ÉΪHTMLÎĵµµÄÒ»²¿·Ö¡£ÓëHTML±êʶÏà½áºÏ£¬ ......

ÔÚJavaScriptÖд´½¨Ð¶ÔÏó [5]

ʹÓÃJavaScript¿ÉÒÔ´´½¨×Ô¼ºµÄ¶ÔÏó¡£ËäÈ»JavaScriptÄÚ²¿ºÍä¯ÀÀÆ÷±¾ÉíµÄ¹¦ÄÜÒÑÊ®·ÖÇ¿
´ó£¬µ«JavaScript»¹ÊÇÌṩÁË´´½¨Ò»¸öжÔÏóµÄ·½·¨¡£Ê¹Æä²»±ØÏñ³¬Îı¾±êʶÓïÑÔÄÇÑù£¬ÇóÓÚ»òÆäËü¶àýÌ幤¾ß£¬¾ÍÄÜÍê³ÉÐí¶à¸´ÔӵŤ×÷¡£
¡¡
¡¡ÔÚJavaScriptÖд´½¨Ò»¸öеĶÔÏóÊÇÊ®·Ö¼òµ¥µÄ¡£Ê×ÏÈËü±ØÐ붨ÒåÒ»¸ö¶ÔÏ󣬶øºóÔÙΪ¸Ã¶ÔÏó´´½¨Ò» ......

JavaScript ¼¼ÇÉ

ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type ²¶»ñÊÍ·Å
event.srcElement.setCapture();  
event.srcElement.releaseCapture();  Ê¼þ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey ʼþ·µ»ØÖµ
event.returnValue Êó±êλÖÃ
event.x
event.y ´°Ìå ......

ÓÐ¹Ø JavaScript µÄ 10 ¼þÈÃÈ˷ѽâµÄÊÂÇé

JavaScript ¿ÉËãÊÇÊÀ½çÉÏ×îÁ÷Ðеıà³ÌÓïÑÔ£¬ËüÔø±» Web ¿ª·¢Éè¼ÆʦÌùÉÏجÃεıêÇ©£¬ËäÈ»ÕæÕýµÄجÃÎÆäʵÊÇ DOM
API£¬Õâ¸ö±»´óÁ¿µÄ¿ª·¢ÓëÉè¼ÆʦËæÊÖÄéÀ´ÔöÇ¿ËûÃÇµÄ Web Ç°¶ËµÄ½Å±¾ÓïÑÔ£¬Èç½ñÔ½À´Ô½±»ÖØÊÓ£¬ËäÔòÈç´Ë£¬JavaScript
ÈÔȻӵÓкܶàÈÃÈ˷ѽâµÄ¶«Î÷¡£
1. ËüÒÔ Java ÃüÃû£¬µ«²¢²»ÊÇ Java
Ëü×î³õ½Ð Mocha£¬ ½Óן ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ