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

JavaScript¾«´â¶ÁÊé±Ê¼Ç(6)

µÚ6ÕÂ
 
Êý×é
Êý×éÊÇÒ»¶ÎÏßÐÔ·ÖÅäµÄÄڴ棬Ëüͨ
¹ýÕûÊýÈ¥¼ÆËãÆ«ÒƲ¢·ÃÎÊÆäÖеÄÔªËØ¡£Êý×é¿ÉÒÔÊǺܿìµÄÊý¾Ý½á¹¹¡£²»ÐÒµÄÊÇ£¬
JavaScript
µÄÊý×é²»ÊÇÕâÑùµÄ¡£ËüÌṩÁËÒ»ÖÖÓµÓÐÀàËÆÊý×éÌØÐԵĶÔÏó¡£Ëü°ÑÊý×éµÄϱêת±ä³É×Ö·û´®£¬ÓÃÆä×÷ΪÊô
ÐÔ¡£ËüÃ÷ÏԵرÈÒ»¸öÕæÕýµÄÊý×éÂý£¬µ«Ëü¿ÉÒÔ¸ü·½±ãµØʹÓá£ÊôÐԵļìË÷ºÍ¸üеķ½Ê½Óë¶ÔÏóһģһÑù£¬³ýÁËÓÐÒ»¸ö¿ÉÒÔÓÃÕûÊý×÷ΪÊôÐÔÃûµÄÌØÐÔÍâ¡£Êý×éÓÐËüÃÇ×Ô
¼ºµÄ¶¨Òå¸ñʽ¡£Êý×éÒ²ÓÐÒ»Ì׷dz£ÓÐÓõÄÄÚÖ÷½·¨£¬ÎÒ½«ÔÚµÚ
8
ÕÂÃèÊöËüÃÇ¡£
6.1
  
Êý×鶨Òå
Êý×鶨ÒåÌṩÁËÒ»Öַdz£·½±ãµØ´´
½¨ÐÂÊý×éµÄ±íʾ·¨¡£Ò»¸öÊý×鶨ÒåÊÇÔÚÒ»¶Ô·½À¨ºÅÖаüΧÁã¸ö»ò¶à¸öÓöººÅ·Ö¸ôµÄÖµµÄ±í´ïʽ¡£Êý×鶨Òå¿ÉÒÔ³öÏÖÔÚÈκαí´ïʽ¿ÉÒÔ³öÏֵĵط½¡£Êý×éµÄµÚÒ»¸öÖµ½«
»ñµÃÊôÐÔÃû
’0’
£¬µÚ¶þ¸öÖµ½«»ñµÃÊôÐÔÃû
’1’
£¬ÒÀ´ÎÀàÍÆ£º
var empty=[];
var
numbers=[‘zero’,’one’,’two’,’three’,’four’,’five’,’six’,’seven’,’eight’,’nine’];
empty[1]                                  

//undefined
numbers[1]                               

//’one’
empty.length                           

//0
numbers.length                        

//10
¶øÒÔϵĶÔÏó¶¨Ò彫²úÉúÒ»¸öÏàËÆ
µÄ½á¹û£º
var numbers_object={
                    

‘0’:‘zero’,&rsqu


Ïà¹ØÎĵµ£º

JavaScript ʼþ


WEB ±à³Ì - DHTML - ʼþ
onabort
µ±Í¼Æ¬¼ÓÔر»ÖжÏʱ´¥·¢µÄʼþ
onactivate
µ±¶ÔÏó³ÉΪ»îÐÔÔªËØʱ´¥·¢µÄʼþ
onafterprint
µ±ÍøÒ³´òÓ¡½áÊøʱ´¥·¢µÄʼþ
onafterupdate
µ±¶ÔÏóµÄÊý¾Ý±»³É¹¦ÐÞ¸ÄÖ®ºó¶ø´¥·¢µÄʼþ
onbeforeactivate
µ±¶ÔÏó½«Òª±»ÉèÖóɻԪËØ֮ǰ´¥·¢µÄʼþ
onbeforecopy
µ±ÍøÒ³±»¿½±´Ö®Ç°¶ø ......

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

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

È¥³ýjavascriptÊý×éÖеÄÏàͬԪËØ

<script type="text/javascript">
function uniqueArr(arr)
{
    arr = arr || [];
    var a = {};
    for (var i=0; i<arr.length; i++)
    {
        var v = arr[i];
    &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ