JavaScriptѧϰ±Ê¼Ç£¨Èý£©
1.°Ñ¶ÔÏóµÄËùÓÐÒýÓö¼ÉèÖÃΪnull£¬¿ÉÒÔÇ¿ÖÆÐԵķϳý¶ÔÏ󣨼´Í¨Öª´æ´¢µ¥ÔªÊÕ¼¯³ÌÐòÏú»Ù¶ÔÏóÀ´ÊÍ·ÅÄڴ棩¡£ÕâÊǸöºÃÏ°¹ß¡£
2.ArrayÀ༴Êý×éÀ࣬¿ÉÒÔÈç϶¨Ò壺
var aColors=new Array();
aColors[0]="blue";
aColors[1]="red";
alert(aColors.length); //µ¯³ö“2”
JavaScriptÖеÄÊý×é¿ÉÒÔ¶¯Ì¬Ôö³¤¡£»¹¿ÉÒÔÓÃ×ÖÃæÁ¿À´¶¨ÒåÊý×飬È磺
var aColors=["blue","red","green"];
join()£ºÀûÓòÎÊý×÷Ϊ·Ö¸ô·û£¬·µ»ØÓÐÐòµÄÊý×éÔªËØÖµµÄ×Ö·û´®¡£¶ÔÓ¦µÄ£¬StringÀàÖÐÓÐsplit()·½·¨×÷Ϊ½«×Ö·û´®×ª»»ÎªÊý×éµÄ¹¤¾ß¡£
push()£ºÔÚArrayβ²¿Ìí¼ÓÔªËØ
pop()£ºÉ¾³ýArray×îºóÒ»¸öÔªËØ
unshift()£ºÔÚArrayÍ·²¿Ìí¼ÓÔªËØ
shift()£ºÉ¾³ýArrayµÚÒ»¸öÔªËØ
NB
£ºÀûÓÃpush()ºÍpop()·½·¨¿ÉÒÔÄ£ÄâÕ»£¬ÀûÓÃpush()ºÍunshift()·½·¨¿ÉÒÔÄ£Äâ¶ÓÁС£
reverse()£ºµßµ¹Êý×éÏîµÄ˳Ðò
sort()£º¸ù¾ÝÊý×éÏîµÄÖµ°´ÉýÐòÅÅÐò
NB
£ºsort()·½·¨Êǽ«Êý×éÏîÏÈת»»Îª×Ö·û´®£¬ÔÙÅÅÐò¡£Òò´Ëµ±Êý×éÏîΪNumberÀàÐÍʱ£¬Ê¹ÓÃsort()·½·¨¿ÉÄÜ»á³öÏÖÄÑÒÔÀí½âµÄ´íÎó¡£
3.GlobalÀà
JavaScriptµÄËùÓк¯Êý¶¼±ØÐëÊÇij¸öÀàµÄ·½·¨¡£ËùνÄÚÖ÷½·¨£¬ÈçparseInt()ºÍparseFloat()·½·¨Êµ¼ÊÉ϶¼ÊÇGlobalÀàµÄ·½·¨¡£
undefined¡¢NaNºÍInfinityµÈÌØÊâÖµÒ²ÊÇGlobalÀàµÄÊôÐÔ¡£
4.MathÀà°üÀ¨Ò»ÏµÁÐÓÃÓÚÊýѧ¼ÆËãµÄ·½·¨ºÍÊôÐÔ£¬ÇÒ·½·¨¾ùΪÀà·½·¨£¬ÊôÐÔÒ²ÊÇÀàÊôÐÔ¡£
exp()£º¼ÆËãeµÄÖ¸¶¨´ÎÃÝ
log()£º¼ÆËãÖ¸¶¨µÄ×ÔÈ»¶ÔÊý
pow()£º¼ÆËãÖ¸¶¨´ÎÊýµÄÖ¸¶¨´ÎÃÝ
min()¡¢max()£ºÅжÏÒ»×éÊýÖеÄ×îСֵ¡¢×î´óÖµ
sqrt()£º¼ÆËãÖ¸¶¨ÊýµÄƽ·½¸ù
random()£º·µ»ØÒ»¸ö0µ½1Ö®¼äµÄËæ»úÊý£¬²»°üÀ¨0ºÍ1
5.ECMAScriptÖеÄËùÓÐÀàµÄËùÓÐÊôÐÔ¶¼Êǹ«Óõġ£
¿ª·¢ÕßÖƶ¨ÁËÒ»¸ö¹æÔ¼£¬±»ÈÏΪÊÇ˽ÓеÄÊôÐÔÃû»ò·½·¨ÃûӦǰºó¼ÓÏ»®Ïߣ¬Èçobj._color_
6.¹Ø¼ü×Öthis×ÜÊÇÖ¸Ïòµ÷Óø÷½·¨µÄ¶ÔÏó¡£ÒòΪÔÚʵÀý»¯¶ÔÏóʱ£¬×ÜÊDz»ÄÜÈ·¶¨¿ª·¢Õß»áʹÓ
Ïà¹ØÎĵµ£º
ÔÚJavaScriptÀ×ÖÃæÁ¿°üÀ¨£º×Ö·û´®×ÖÃæÁ¿£¬Êý×é×ÖÃæÁ¿£¬º¯Êý×ÖÃæÁ¿ºÍ¶ÔÏó×ÖÃæÁ¿¡£
1.×Ö·û´®×ÖÃæÁ¿
var str = "Hello World£¡";
&ldquo ......
Chrome ÓµÓиü¿ìËÙµÄJavaScript£»
±àдÈçÏÂС³ÌÐò£º
<html>
<script language = "javascript">
var sum = 0;
var start = new Date;
for(var i = 0; i < 1000001; i++){
sum+=i;
}
var stop = new Date;
document.write("´Ó1µ½1000000µÄÀÛ¼Ó½á¹û£º" + sum + ";" + "<br/> ......
¼ò½é
ÔÚjavascript
ÖÐÎÒÃÇ×îͨ³£µÄ×ö·¨ÊǶ¨ÒåÒ»¸öÒ»¸öµÄ·½·¨(function)
£¬È»ºóͨ¹ý¸ö¸öfunction
Ö®¼äµÄµ÷ÓÃÀ´ÊµÏÖij¸ö¹¦ÄÜ£¬Ò²¾ÍÊÇ¿ÉÒÔÕâÑù½²£¬function
ËƺõÊÇjs
ÖеÄÒ»¸ö×îС×éÖ¯µ¥Ôª,
ÎÒÃÇÒѾÊìϤÁ˸÷ÖÖÃæÏò¶ÔÏó¶ÔÏóÓïÑÔ(java,c#..),
ÎÒÃÇÒѾϰ¹ßÁËʹÓø÷¸÷ÀàÀ´·â×°¸÷¸ö²Ù×÷£¬Èúóͨ¹ý¸÷¸ö¶ÔÏóÖ®¼äµÄ½» ......
¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI
¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË 15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI
¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
LivePipe
LivePipe
UI
»ùÓÚ Prototype Javascript ¿ò¼Ü
£¬°üº ......
WPFµÄWebBrowserºÍWinFormµÄWebBrowserÓÐÒ»¶¨Çø±ð¡£
ÒªÏòÆäÖÐ×¢Èëjavascript½Å±¾£¬¾¹ý±¾ÈËÊÔÑ飬ÏÂÃæÒ»Ìõ·¿ÉÒÔ×ßͨ£º
mshtml.HTMLDocument htmlDoc = Browser.Document as mshtml.HTMLDocument;
var head = htmlDoc.getElementsByTagName("head").Cast<HTMLHeadElement>().First();
var script = (IHTMLS ......