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

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

ת×Ô£ºhttp://news.csdn.net/a/20100217/217053.html
JavaScript ¿ÉËãÊÇÊÀ½çÉÏ×îÁ÷Ðеıà³ÌÓïÑÔ£¬ËüÔø±» Web ¿ª·¢Éè¼ÆʦÌùÉÏجÃεıêÇ©£¬ËäÈ»ÕæÕýµÄجÃÎÆäʵÊÇ DOM API£¬Õâ¸ö±»´óÁ¿µÄ¿ª·¢ÓëÉè¼ÆʦËæÊÖÄéÀ´ÔöÇ¿ËûÃÇµÄ Web Ç°¶ËµÄ½Å±¾ÓïÑÔ£¬Èç½ñÔ½À´Ô½±»ÖØÊÓ£¬ËäÔòÈç´Ë£¬JavaScript ÈÔȻӵÓкܶàÈÃÈ˷ѽâµÄ¶«Î÷¡£
1. ËüÒÔ Java ÃüÃû£¬µ«²¢²»ÊÇ Java
Ëü×î³õ½Ð Mocha£¬ ½ÓןÄÃûΪ LiveScript£¬×îºó²ÅÈ·¶¨ÃüÃûΪ JavaScript£¬¸ù¾ÝÀúÊ·¼Ç¼£¬Java µÄÃüÃûÓë Netscape ºÍ Sun Ö®¼äµÄºÏ×÷Óйأ¬×÷Ϊ½»»»Ìõ¼þ£¬Netscape ÔÚËûÃDZ¸ÊÜ»¶Ó­µÄä¯ÀÀÆ÷Öд´½¨ÁË Java ÔËÐÐʱ¡£ÖµµÃÒ»ÌáµÄÊÇ£¬Õâ¸öÃû×ֵijǫ̈¼¸½üÒ»¸öÍæЦ£¬ÒªÖªµÀ£¬LiveScript ºÍ Java ÔÚ¿Í»§¶Ë½Å±¾·½Ãæ´æÔڵжԹØϵ¡£
²»¹ÜÔõô˵£¬ÈËÃǺóÀ´²»µÃ²»Ò»ÔÙ³ÎÇåµÄÒ»¼þʾÍÊÇ£¬JavaScript ºÍ Java ºÁÎÞ¹Øϵ¡£
2. Null ÊǸö¶ÔÏó£¿
¿´¿´Õâ¶Î´úÂ룬Ëü·µ»ØµÄÊÇ object¡£
ÕâʵÔÚÁîÈ˷ѽ⣬¼ÙÈç null ±íʾ¿ÕÖµ£¬ËüÔõô¿ÉÒÔÊǶÔÏ󣿼òµ¥Ëµ£¬ËüÊÇ JavaScript ×î³õ°æ±¾µÄ´íÎó£¬Õâ¸ö´íÎóÉõÖÁ±»Î¢ÈíµÄ JScript Ö±½Ó½èÓá£
3. NaN !== NaN
NaN£¬±íʾһ¸ö·ÇÊý×ÖµÄÖµ£¬È»¶øÎÊÌâÊÇ£¬NaN²»µÈÓÚÈκζ«Î÷£¬ÉõÖÁ²»µÈÓÚËü×Ô¼º¡£
ÕâÏÔÈ»²»¶Ô£¬ÊÂʵÉÏ£¬Èç¹ûÒªÅжÏÒ»¸öֵȷʵÊÇ NaN£¬ÄãÐèÒªÓà isNaN() º¯Êý¡£
4. È«¾Ö±äÁ¿
¶ÔÈ«¾Ö±äÁ¿µÄÒÀÀµÒ»Ö±±»ÊÓΪ JavaScript ×µÄ²¿·Ö£¨ECMA µÄ JavaScript 5 ÒѾ­È¥µôÁËÈ«¾Ö±äÁ¿£¬Çë²ÎÔÄ ECMA ÍƳö JavaScript 5 - ÒëÕß×¢£©¡£¶Ô¼òµ¥µÄÒ³Ã棬ÕâÎÞËùν£¬µ«¸´ÔÓµÄÒ³Ã棬Èç¹û°üº¬´óÁ¿ JavaScript ½Å±¾£¬ÄãºÜÄÑÖªµÀij¸öÈ«¾Ö±äÁ¿ÊÇÔÚÄÄÀïÉùÃ÷µÄ£¬Èç¹û¼¸¸öÈ«¾Ö±äÁ¿²»Ð¡ÐÄÖØÃû£¬¾Í»áÒý·¢´íÎó¡£
5. ÄÇЩͳͳ±»Ì½²âΪ Mozilla User-Agent µÄä¯ÀÀÆ÷
±ØÐë³ÐÈÏ£¬ÊÂʵÉÏ£¬Õâ²»ÊÇ JavaScript µÄ´í£¬ÊǸ÷¸öä¯ÀÀÆ÷ÓÐÒâΪ֮¡£±ÈÈ磬ÒÔÏÂÊÇÓà JavaScript ̽²â Safari ʱµÃµ½µÄ½á¹û£º
ÊÇ·ñ×¢Òâµ½ÆäÖеĵÚÒ»¸öµ¥´Ê Mozilla/5.0£¬ÎªÊ²Ã´ Safari »á±»Ì½²âΪ Mozilla£¬¾¡¹Ü Safari ºóÀ´ÒѾ­¾ÀÕýÕâÒ»ÎÊÌ⣬µ«ÈÔÈ»²»ÄܽâÊÍΪʲôËüÃÇÒªÕâÑùÎ󵼿ª·¢Õß¡£ÊÂʵÉÏ£¬Äã»á·¢ÏÖ£¬¾ø´ó¶àÊýä¯ÀÀÆ÷°ÑËûÃÇµÄ User Agent ÉèÖÃΪ Mozilla£¬´ð°¸Òª»Øµ½10ÄêÇ°£¬Õâ¸ü¶àÊÇÒ»ÖÖ²ßÂÔ¡£
User Agent ÊÇÒ»¶ÎÓÃÀ´±êʶµ±Ç°ä¯ÀÀÆ÷Éí·ÝµÄ×Ö·û´®£¬ÊÀ½çÉϵÚÒ»¸öä¯ÀÀÆ÷ Mosaic£¬ ÔøÕâÑù±êÖ¾×Ô¼º£º
ÕâºÜºÏÀí£¬Òò´Ëµ± Netscape ³öÀ´µÄʱºò£¬Ëü±£ÁôÁË Mosaic Õâ¸ö´«Í³£¬»¹ÔÚºóÃæÌí¼ÓÁËÒ»¸ö¼ÓÃÜ·½Ê½²¿·Ö¡£
µ½Ä¿Ç°ÎªÖ¹£¬Ò»Çа²ºÃ£¬Ö±µ½ IE3 ·


Ïà¹ØÎĵµ£º

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

µÚ5ÕÂ
 
¼Ì³Ð
ÔÚÄÇЩ»ùÓÚÀàµÄÓïÑÔ£¨±ÈÈç
Java
£©ÖУ¬¼Ì³Ð£¨
inheritance
»ò
extends
£©ÌṩÁËÁ½¸öÓÐÓõķþÎñ¡£Ê×ÏÈ£¬ËüÊÇ´úÂëÖØÓõÄÒ»ÖÖÐÎʽ¡£Èç¹ûÒ»¸öеÄÀàÓëÒ»¸öÒÑ´æÔÚµÄÀà´ó²¿·ÖÏà
ËÆ£¬ÄÇôÄãÖ»Ðë¾ßÌå˵Ã÷Æ䲻ͬµã¼´¿É¡£Àà¼Ì³ÐµÄÁíÒ»¸öºÃ´¦ÊÇËü°üÀ¨ÁËÒ»Ì×ÀàÐÍϵͳµÄ¹æ·¶¡£ÓÉÓÚ³ÌÐòÔ±ÎÞÐë±àдÏÔʽÀàÐÍת ......

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

µÚ6ÕÂ
 
Êý×é
Êý×éÊÇÒ»¶ÎÏßÐÔ·ÖÅäµÄÄڴ棬Ëüͨ
¹ýÕûÊýÈ¥¼ÆËãÆ«ÒƲ¢·ÃÎÊÆäÖеÄÔªËØ¡£Êý×é¿ÉÒÔÊǺܿìµÄÊý¾Ý½á¹¹¡£²»ÐÒµÄÊÇ£¬
JavaScript
µÄÊý×é²»ÊÇÕâÑùµÄ¡£ËüÌṩÁËÒ»ÖÖÓµÓÐÀàËÆÊý×éÌØÐԵĶÔÏó¡£Ëü°ÑÊý×éµÄϱêת±ä³É×Ö·û´®£¬ÓÃÆä×÷ΪÊô
ÐÔ¡£ËüÃ÷ÏԵرÈÒ»¸öÕæÕýµÄÊý×éÂý£¬µ«Ëü¿ÉÒÔ¸ü·½±ãµØʹÓá£ÊôÐԵļìË÷ºÍ¸ü ......

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

http://blog.csdn.net/mouyong/archive/2009/10/02/4626852.aspx
Èç¹ûÄãÏë¼ÓÔ­×÷ÕßΪºÃÓÑ£ºÇëµã»÷ÒÔÏÂÁ´½Óhttp://hi.csdn.net/invite.php?u=8943&c=759c7fc189ea23c1
µÚ1Õ   ¾«»ª
JavaScriptµÄÌØÐÔÖÐÓÐÒ»²¿·ÖÌØÐÔ´øÀ´µÄÂé·³Ô¶Ô¶³¬³öËüÃǵļÛÖµ¡£ÆäÖУ¬Ò»Ð©ÌØÐÔÊÇÒòΪ¹æ·¶ºÜ²»ÍêÉÆ£¬´Ó¶ø¿ÉÄܵ¼Ö¿ÉÒÆ ......

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


http://blog.csdn.net/mouyong/archive/2009/12/07/4959741.aspx
µÚ4Õ  º¯Êý
JavaScriptÖÐ×îºÃµÄÌØÐÔ¾ÍÊÇËü¶Ôº¯ÊýµÄʵÏÖ¡£Ëü¼¸ºõÎÞËù²»ÄÜ¡£µ«ÊÇ£¬Ïë±ØÄãÒ²ÄÜÔ¤Áϵ½£¬º¯ÊýÔÚJavaScriptÀïÒ²²¢·ÇÍòÄÜÒ©¡£
º¯Êý°üº¬Ò»×éÓï¾ä£¬ËüÃÇÊÇJavaScriptµÄ»ù´¡Ä£¿éµ¥Ôª£¬ÓÃÓÚ´úÂ븴Óá¢ÐÅÏ¢Òþ²ØºÍ×éºÏµ÷Ó᣺¯ÊýÓÃÓÚÖ¸¶¨¶ ......

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

http://blog.csdn.net/mouyong/archive/2010/03/10/5364047.aspx
µÚ9Õ  ´úÂë·ç¸ñ
¼ÆËã»ú³ÌÐòÊÇÈËÀàÖÆÔì³öÀ´µÄ×ÔÓµÄÊÂÎï¡£³ÌÐòͨ³£Óɺܶಿ·Ö×é³É£¬±íÏÖΪº¯Êý¡¢Óï¾äºÍ±í´ïʽ£¬ËüÃDZØÐë׼ȷÎÞÎóµØ°´ÕÕ˳ÐòÅÅÁС£×îÖյĽá¹û¼¸ºõ¶¼ºÍʵÏÖËüµÄ³ÌÐòûÓÐʲôÏàËÆÖ®´¦¡£ÔÚÈí¼þµÄ²úÆ·ÉúÃüÖÜÆÚÖУ¬Í¨³£ËüÃǶ¼»á±»ÐÞ¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ