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
ÖÐÎÒÃÇ×îͨ³£µÄ×ö·¨ÊǶ¨ÒåÒ»¸öÒ»¸öµÄ·½·¨(function)
£¬È»ºóͨ¹ý¸ö¸öfunction
Ö®¼äµÄµ÷ÓÃÀ´ÊµÏÖij¸ö¹¦ÄÜ£¬Ò²¾ÍÊÇ¿ÉÒÔÕâÑù½²£¬function
ËƺõÊÇjs
ÖеÄÒ»¸ö×îС×éÖ¯µ¥Ôª,
ÎÒÃÇÒѾÊìϤÁ˸÷ÖÖÃæÏò¶ÔÏó¶ÔÏóÓïÑÔ(java,c#..),
ÎÒÃÇÒѾϰ¹ßÁËʹÓø÷¸÷ÀàÀ´·â×°¸÷¸ö²Ù×÷£¬Èúóͨ¹ý¸÷¸ö¶ÔÏóÖ®¼äµÄ½» ......
1.×î³õÒýÈëJavaScriptµÄÖ÷ҪĿµÄÊÇÔÚ¿Í»§¶Ë´¦ÀíһЩÊäÈëµÄÓÐЧÐÔÑéÖ¤¡£¶øÔÚ´Ë֮ǰҪ½øÐÐÓÐЧÐÔÑéÖ¤£¬¾Í±ØÐëÓë·þÎñÆ÷½øÐÐÍù·µµÄ½»»¥¡£
2.Ò»¸öÍêÕûµÄJavaScriptʵÏÖÊÇÓÉÒÔÏÂ3¸ö²»Í¬²¿·Ö×é³ÉµÄ£º
ºËÐÄ£¨ECMAScript£©
Îĵµ¶ÔÏóÄ£ÐÍ£¨DOM£©
ä¯ÀÀÆ÷¶ÔÏóÄ£ÐÍ£¨BOM£©
ECMAScript×÷ΪJavaScriptµÄºËÐÄ£¬ÃèÊöÁ˸ÃÓï ......
1.ÀûÓÃJavascriptʵÏÖ²âÊÔä¯ÀÀÆ÷ÀàÐÍÔÙµ÷ÓÃÏàÓ¦µÄÖ÷Ò³
¡¡¡¡ÓÉÓÚIEºÍNetscapeµÄijЩ²»¼æÈÝ£¬Ê¹µÃÖ÷Ò³ÖÆ×÷³öÀ´ºóÔÚÁ½ÕßÖÐÓнϴó²î±ð£¬ÓеÄÉõÖÁ²»ÄÜʹÓá£Îª±ãÓÚ¹ÜÀí£¬×î¼ÑµÄ·½·¨¾ÍÊÇÏȲâÊÔä¯ÀÀÆ÷ÀàÐÍ£¬ÔÙµ÷ÓÃÏàÓ¦µÄÖ÷Ò³¡£
¡¡¡¡ËüµÄ×ö·¨¾ÍÊÇÔÚ´ËÒ³ÉÏÉèÖÃÈ磺
¡¡¡¡£¼html£¾
¡¡¡¡£¼head£¾
¡¡¡¡£¼title£¾¼ì²âä¯ÀÀÆ÷£¼/title£ ......
ͨ¹ýWMIÀ´ÊµÏÖ»ñÈ¡¿Í»§¶Ë¼ÆËã»úÓ²¼þ¼°ÏµÍ³ÐÅÏ¢:
1//ϵͳÐÅÏ¢»ñÈ¡
2function getSysInfo(){
3 var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
4 var service = locator.ConnectServer(".");
5 //CPUÐÅÏ¢
6 var cpu = new Enumerator (service.ExecQuery("SELECT * from Win32_Processor")).item(); ......