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

JavaScriptÖÐnull, undefined µÄÉîÈë̽ÌÖ

 null, undefined
Ïàͬ£º
µ±Ò»¸ö±äÁ¿µÄÖµÊÇnull, undefinedʱ£¬±íʾ£ºÎÒÃÇÉùÃ÷²¢¶¨ÒåÁËÒ»¸ö±äÁ¿£¬½ö½öÊÇÕâ¸ö±äÁ¿µÄÖµÊÇnull, undefined.
±»µ÷ÓÃÕߣº
½«null, undefined×÷Ϊ²ÎÊý´«Èë"JavaScriptÄÚÖú¯Êý"ʱ£¬²»»á³öÏÖÒì³££¬ÄÚÖú¯Êý·µ»Ø£ºnull -> null,  undefined->undefined
µ«typeofº¯Êý³ýÍâ¡£
µ÷ÓÃÕߣº
ÔÚnull, undefinedÉϵ÷ÓÃÊôÐÔ£¬·½·¨»á³öÏÖÒì³£¡£
²»Í¬£º
ÌØÊâµÄtypeofº¯Êý£¬ typeof null  -> "object"              typeof undefined    ->  "undefined"
Ìرð×¢Ò⣺
ÔÚJavaScriptÖУ¬Èç¹ûÒ»¸ö±äÁ¿Ã»ÓÐÉùÃ÷£¬Ò²¾ÍÊDz»´æÔڵġ£
±»µ÷ÓÃÕߣº
½«Ã»ÓÐÉùÃ÷µÄ±äÁ¿×÷Ϊ²ÎÊý´«Èë"ÈÎÒâµÄJavaScriptº¯Êý"ʱ£¬»á³öÏÖÒì³££¬µ«typeofº¯Êý³ýÍâ¡£
µ÷ÓÃÕߣº
ÔÚûÓÐÉùÃ÷µÄ±äÁ¿Éϵ÷ÓÃÊôÐÔ£¬·½·¨»á³öÏÖÒì³£¡£
ÌØÊâµÄtypeofº¯Êý£¬ ¶ÔÒ»¸öûÓÐÉùÃ÷µÄ±äÁ¿£¬ÀýÈ磺undeclared,  typeof undeclared : ·µ»Ø "undefined".
Òò´Ë¶ÔÒ»¸ö±äÁ¿µ÷ÓÃtypeof ·½·¨ÊÇ×î±£Ïյġ£ÀýÈç±È½ÏÒ»¸ö±äÁ¿book, µ÷Óà book == null , book == undefined £¬
Èç¹ûbook±äÁ¿Ã»ÓÐÉùÃ÷£¬Ôò³öÏÖÒì³££¬µ«ÊÇtypeof book  Ôò²»»á³öÏÖÈκÎÒì³£¡£
º¯ÊýµÄ²ÎÊý£¬ºÍ¶ÔÏóµÄÊôÐÔ£¬ÊôÓÚÒѾ­ÉùÃ÷µÄ±äÁ¿¡£
¶ÔÓÚûÓÐÉùÃ÷µÄ±äÁ¿£¬³ýtypeofº¯ÊýÖ®Í⣬ ÆäËüµÄÈκβÙ×÷£¬¶¼»á³öÏÖÒì³£¡£
¶ÔÓÚÒѾ­ÉùÃ÷µÄ±äÁ¿£¬Êµ¼ÊËüÒѾ­ÊÇ´æÔÚ£¬ÆäÖµÐèÒªÇø·Önull, undefined, instance(ʵÀý)¡£
µ÷ÓÃÕߣº
ÔÚnull, undefinedÉϵ÷ÓÃÊôÐÔ£¬·½·¨»á³öÏÖÒì³£¡£
ÔÚinstanceÉϵ÷Óò»´æÔÚµÄÊôÐÔ£¬²»»á³öÏÖÒì³££¬ÒòΪ¶ÔÏóµÄÊôÐÔ¶¼ÊÇÒѾ­ÉùÃ÷µÄ±äÁ¿£¬
µ«Êǵ÷Óò»´æÔڵķ½·¨£¬Ôò³öÏÖÒì³£¡£


Ïà¹ØÎĵµ£º

´Ó¡¶JavaScript Dom ±à³ÌÒÕÊõ¡·¿´µ½µÄ

     Ç°¼¸Ì죬ÔÚͼÊé¹Ý¿´ÁËÒ»±¾Êé½Ð¡¶JavaScript Dom ±à³ÌÒÕÊõ¡·´ÓÖг¢µ½ºÜ¶à֪ʶ»òÕß³ÆÆäΪ·½·¨£¬ÓÉÓÚÒ»Ö±ÔÚ棬ûÓÐʱ¼äд³öÀ´·ÖÏí¸ø´ó¼Ò£¬½ñÌìÕýºÃÓеãʱ¼äËùÒÔ¾Íд³öÀ´°É£¬Õâ±¾ÊéµÄ×÷ÕßJeremy Keith ÎÒÒÔǰûÓÐÌýµ½¹ýÕâ¸öÈË£¬´ËÊéÖоÍÒ»¶Î»°ÊÇ˵“ÎÞÂÛºÎʱµØ£¬¶¼Òª°Ñ‘Ñ­Ðò½¥½ø’ºÍ ......

JavaScriptÈÕÆÚУÑé

 //ÓÉÒ³ÃæÔªËØdate_string(YYYY-MM_DD¸ñʽ)µÃµ½Êý×édate_array
 //ÊäÈë²ÎÊý£ºdate_string:ÈÕÆÚ´®£»marker:ÈÕÆÚ´®date_stringÀïµÄ·Ö¸ô·û£¬Èç¹ûûÓÐÔòΪ""£»
 //·µ»ØÖµ£º Êý×飺date_array
 //            Êý×éÔªËØdate_array.year=YYYY£»dat ......

JavascriptÖÐURL±àÂë·½·¨µÄ±È½Ï

URL±àÂë·½·¨µÄ±È½Ï javascriptÖдæÔÚ¼¸ÖÖ¶Ô Technorati ±êÇ©: JavaScript,url,±àÂë URL×Ö·û´®½øÐбàÂëµÄ·½·¨£ºescape()£¬encodeURI()£¬ÒÔ¼°encodeURIComponent()¡£Õ⼸ÖÖ±àÂëËùÆðµÄ×÷Óø÷²»Ïàͬ¡£ escape() ·½·¨£º ²ÉÓÃISO Latin×Ö·û¼¯¶ÔÖ¸¶¨µÄ×Ö·û´®½øÐбàÂë¡£ËùÓеĿոñ·û¡¢±êµã·ûºÅ¡¢ÌØÊâ×Ö·ûÒÔ¼°ÆäËû·ÇASCII×Ö· ......

Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â

ugmbbc·¢²¼ÓÚ 2009-11-14 09:41:43| 7628 ´ÎÔĶÁ ×ÖÌ壺´ó С ´òÓ¡Ô¤ÀÀ
var ReTitle = '»Ø¸´:Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â';
¸ÐлCOMSHARP CMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ