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

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

µÚËÄÕ  Algorithms and Flow Control  Ëã·¨ºÍÁ÷³Ì¿ØÖÆ
    The overall structure of your code is one of the main determinants as to how fast it will execute. Having a very small amount of code doesn't necessarily mean that it will run quickly, and having a large amount of code doesn't necessarily mean that it will run slowly. A lot of the performance impact is directly related to how the code has been organized and how you're attempting to solve a given problem.
    ´úÂëÕûÌå½á¹¹ÊÇÖ´ÐÐËٶȵľö¶¨ÒòËØÖ®Ò»¡£´úÂëÁ¿ÉÙ²»Ò»¶¨ÔËÐÐËٶȿ죬´úÂëÁ¿¶àÒ²²»Ò»¶¨ÔËÐÐËÙ¶ÈÂý¡£ÐÔÄÜËðʧÓë´úÂë×éÖ¯·½Ê½ºÍ¾ßÌåÎÊÌâ½â¾ö°ì·¨Ö±½ÓÏà¹Ø¡£
    The techniques in this chapter aren't necessarily unique to JavaScript and are often taught as performance optimizations for other languages. There are some deviations from advice given for other languages, though, as there are many more JavaScript engines to deal with and their quirks need to be considered, but all of the techniques are based on prevailing computer science knowledge.
    ±¾Õ¼¼Êõ²»½öÊÊÓÃÓÚJavaScriptÒ²ÊÊÓÃÓÚÆäËûÓïÑÔµÄÐÔÄÜÓÅ»¯¡£»¹ÓÐһЩΪÆäËûÓïÑÔÌṩµÄ½¨Ò飬»¹Òª´¦Àí¶àÖÖJavaScriptÒýÇæ²¢¿¼ÂÇËüÃǵIJîÒ죬µ«ÕâЩ¼¼Êõ¶¼ÒÔµ±Ç°¼ÆËã»ú¿Æѧ֪ʶΪ»ù´¡¡£
Loops  Ñ­»·
    In most programming languages, the majority of code execution time is spent within loops. Looping over a series of values is one of the most frequently used patterns in programming and as such is also one of the areas where efforts to improve performance must be focused. Understanding the performance impact of loops in JavaScript is especially important, as infinite or long-running loops severely impact the overall user experience.
    ÔÚ´ó¶àÊý±à³ÌÓïÑÔÖУ¬´úÂëÖ´ÐÐʱ¼ä¶àÊýÔÚÑ­»·Öжȹý¡£ÔÚһϵÁбà³ÌģʽÖУ¬Ñ­»·ÊÇ×î³£ÓõÄģʽ֮һ£¬Òò´ËÒ²ÊÇÌá¸ßÐÔÄܱØÐë¹Ø×¢µÄµØÇøÖ®Ò»¡£Àí½âJavaScriptÖÐÑ­»·¶ÔÐÔÄܵÄÓ°ÏìÖÁ¹ØÖØÒª£¬ÒòΪËÀÑ­»·»òÕß³¤Ê±¼äÔËÐеÄÑ­»·»áÑÏÖØÓ°ÏìÓû§ÌåÑé¡£
Types of Loops  Ñ­»·µÄÀàÐ


Ïà¹ØÎĵµ£º

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

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

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

µÚÈýÕ  DOM Scripting  DOM±à³Ì
    DOM scripting is expensive, and it's a common performance bottleneck in rich web applications. This chapter discusses the areas of DOM scripting that can have a negative effect on an application's responsiveness and gives recommendations o ......

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


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

javascript typeofÓ¦ÓÃ

typeof ÊÇJavaScriptµÄÔËËã·û
    ——·µ»ØÒ»¸öÓÃÀ´±íʾ±í´ïʽµÄÊý¾ÝÀàÐ͵Ä×Ö·û´®
   typeof[(] expression [)]  //typeofÓï·¨ÖеÄÔ²À¨ºÅÊÇ¿ÉÑ¡Ïî
  typeof ÔËËã·û@import url(../html-vss/msdnie4a.css);
typeof
ÔËËã·û°ÑÀàÐÍÐÅÏ¢µ±×÷×Ö·û´®·µ»Ø¡£typeof
·µ»ØÖµÓÐÁ ......

AJAX (Òì²½ JavaScript ºÍ XML)

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