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

[·­Òë]High Performance JavaScript(015)

µÚÎåÕ  Strings and Regular Expressions  ×Ö·û´®ºÍÕýÔò±í´ïʽ
    Practically all JavaScript programs are intimately tied to strings. For example, many applications use Ajax to fetch strings from a server, convert those strings into more easily usable JavaScript objects, and then generate strings of HTML from the data. A typical program deals with numerous tasks like these that require you to merge, split, rearrange, search, iterate over, and otherwise handle strings; and as web applications become more complex, progressively more of this processing is done in the browser.
    ¼¸ºõËùÓÐJavaScript³ÌÐò¶¼Óë×Ö·û´®²Ù×÷½ôÃÜÏàÁ¬¡£ÀýÈ磬Ðí¶àÓ¦ÓóÌÐòʹÓÃAjax´Ó·þÎñÆ÷»ñÈ¡×Ö·û´®£¬½«ÕâЩ×Ö·û´®×ª»»³É¸üÒ×ÓõÄJavaScript¶ÔÏó£¬È»ºó´ÓÊý¾ÝÖÐÉú³ÉHTML×Ö·û´®¡£Ò»¸öµäÐ͵ijÌÐòÐèÒª´¦ÀíÈô¸ÉÕâÑùµÄÈÎÎñ£¬ºÏ²¢£¬·Ö½â£¬ÖØÐÂÅÅÁУ¬ËÑË÷£¬±éÀú£¬ÒÔ¼°ÆäËû·½·¨´¦Àí×Ö·û´®¡£Ëæ×ÅÍøÒ³Ó¦ÓÃÔ½À´Ô½¸´ÔÓ£¬Ô½À´Ô½¶àµÄ´ËÀàÈÎÎñ½«ÔÚä¯ÀÀÆ÷ÖÐÍê³É¡£
    In JavaScript, regular expressions are essential for anything more than trivial string processing. A lot of this chapter is therefore dedicated to helping you understand how regular expression engines internally process your strings and teaching you how to write regular expressions that take advantage of this knowledge.
    ÔÚJavaScriptÖУ¬ÕýÔò±í´ïʽÊDZز»¿ÉÉٵĶ«Î÷£¬ËüµÄÖØÒªÐÔÔ¶³¬¹ýËöËéµÄ×Ö·û´®´¦Àí¡£±¾ÕÂʹÓÃÏ൱ƪ·ù°ïÖúÄúÁ˽âÕýÔò±í´ïʽÒýÇæ´¦Àí×Ö·û´®µÄÔ­Àí£¬²¢½²ÊÚÈçºÎÀûÓÃÕâЩ֪ʶÊéдÕýÔò±í´ïʽ¡£
    Also in this chapter, you'll learn about the fastest cross-browser methods for concatenating and trimming strings, discover how to increase regex performance by reducing backtracking, and pick up plenty of other tips and tricks for efficiently processing strings and regular expressions.
    ͨ¹ý±¾ÕÂÄÚÈÝ£¬Äú»¹½«Ñ§µ½¹ØÓÚÁ¬½Ó¡¢ÐÞÕû×Ö·û´®µÄ×î¿ìµÄ¿çä¯ÀÀÆ÷·½·¨£¬Ì½Ë÷ÈçºÎͨ¹ý¼õÉÙ»ØËÝÀ´Ìá¸ßÕýÔò±í´ïʽµÄÐÔÄÜ£¬²¢ÌôÑ¡ÁËһЩ¹ØÓÚ¸ßЧ´¦Àí×Ö·û´®ºÍÕýÔò±í´ïʽµÄ¼¼ÇÉ¡£
String Concatenation  ×Ö·


Ïà¹ØÎĵµ£º

ͨ¹ýjavascript»ñµÃurl²ÎÊý

Ò³ÃæÌá½»Êý¾ÝÒ»°ãÓÐÁ½ÖÖ·½·¨£ºget,post¡£post¾ÍÊÇËùνµÄformÌá½»£¬Ê¹ÓÃÊÓͼ£»getÊÇͨ¹ýurlÌá½»¡£
Get·½·¨Ò»°ãÓúǫ́´úÂ루Èçasp,asp.net£©»ñµÃ²ÎÊý£¬´úÂëºÜ¼òµ¥£ºRequest.QueryString["id"];¼´¿É»ñÈ¡¡£ 
ÓÐЩʱºòÐèÒªÖ±½ÓÔÚǰ̨»ñÈ¡url²ÎÊý£¬ÒªÓõ½javascript£¬jsûÓÐÖ±½Ó»ñÈ¡url²ÎÊýµÄ·½·¨£¬ÄÇô£¬ÎÒÃÇÈçºÎͨ¹ýjs ......

[ת]¾«Í¨JSON (JavaScript Object Notation)


[ת×Ô]http://article.yeeyan.org/view/mouse4x/16540
JSON±»¹«ÈÏΪä¯ÀÀÆ÷ÖÐXMLµÄºó¼ÌÕߣ¬ËüµÄÄ¿±ê½ö½öÊdzÉΪһÖÖ¼òµ¥¡¢ÓÅÑŵÄÊý¾Ý¸ñʽ£¬ÒÔ·½±ãä¯ÀÀÆ÷ºÍ·þÎñÆ÷Ö®¼äµÄÊý¾Ý½»»»¡£ÔÚÍê³ÉÕâÒ»¼òµ¥ÈÎÎñµÄ¹ý³ÌÖУ¬Ëü½«ÒýÁìÏÂÒ»´úÍòάÍø¡£
¶ÔÏó¼ò½é
¿´,Õâ¾ÍÊÇÒ»¸ö¶ÔÏó:
var myFirstObject ={};
¾¡¹Ü¿´ÆðÀ´Í¦¼òµ¥£¬È»¶øÄÇЩ» ......

JavaScript»ù´¡ÖªÊ¶2

ÍæPHP¡¢Delphi¡¢Java»ù±¾É϶¼ÓжÔÏó£¬Ï°¹ßÕâÖÖ˼·ºóÉÏÊÖÈκÎÓïÑÔ¶¼Ïë¿¿OO˼·£¬Õâ¾ø²»ÊÇÔÚ¸Ïʱ÷Ö£¬¶øÊÇ°ÑÏà¹Ø´úÂë½øÐÐÄÚ¾ÛµÄÈ·¿ÉÒÔÌå»áµ½Î¬»¤µÄ·½±ã£¡
ÔÚJavaScriptÖÐÈçºÎ´´½¨¶ÔÏó£¿
JavaScriptÊÇ»ùÓÚ¶ÔÏóµÄ£¡ËüÒ²ÊÇÒÔObjectΪ¸ùÀ࣬ÆäËüÀà¼Ì³ÐÖ®¡£ÔÚ¸ùÀàÌṩÁ˼¸¸ö·½·¨¡£¹©¼Ì³ÐÀàʹÓã¡
ÒÔÏÂÊÇ´´½¨¶ÔÏóµÄÀý×Ó£º
funct ......

AJAX (Òì²½ JavaScript ºÍ XML)

AJAX (Òì²½ JavaScript ºÍ XML) ÊǸöвúÉúµÄÊõÓï,רΪÃèÊöJavaScriptµÄÁ½ÏîÇ¿´óÐÔÄÜ.ÕâÁ½ÏîÐÔ
ÄÜÔÚ¶àÄêÀ´Ò»Ö±±»ÍøÂ翪·¢ÕßËùºöÂÔ,Ö±µ½×î½üGmail, Google suggestºÍgoogle MapsµÄºá¿Õ³öÊÀ²ÅʹÈË
ÃÇ¿ªÊ¼Òâʶµ½ÆäÖØÒªÐÔ.
ÕâÁ½Ïî±»ºöÊÓµÄÐÔÄÜÊÇ:
* ÎÞÐèÖØÐÂ×°ÔØÕû¸öÒ³Ãæ±ãÄÜÏò·þÎñÆ÷·¢ËÍÇëÇó.
* ¶ÔXMLÎĵµµÄ½âÎöºÍ´¦Àí£® ......

[·­Òë]High Performance JavaScript(014)

Recursion Patterns  µÝ¹éģʽ
    When you run into a call stack size limit, your first step should be to identify any instances of recursion in the code. To that end, there are two recursive patterns to be aware of. The first is the straightforward recursive pattern represented ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ