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

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

JavaScript Minification  JavaScript½ô´Õ
    JavaScript minification is the process by which a JavaScript file is stripped of everything that does not contribute to its execution. This includes comments and unnecessary whitespace. The process typically reduces the file size by half, resulting in faster downloads, and encourages programmers to write better, more extensive inline documentation.
    JavaScript½ô´ÕÖ¸µÄÊÇÌÞ³ýÒ»¸öJavaScriptÎļþÖÐÒ»ÇÐÔËÐÐÎÞ¹ØÄÚÈݵĹý³Ì¡£°üÀ¨×¢ÊͺͲ»±ØÒªµÄ¿Õ¸ñ¡£¸Ã´¦Àíͨ³£¿É½«Îļþ³ß´çËõ¼õµ½Ò»°ë£¬Æä½á¹ûÊÇÏÂÔØËٶȸü¿ì£¬²¢¹ÄÀø³ÌÐòԱд³ö¸üºÃ£¬¸üÏêϸµÄÄÚÁªÎĵµ¡£
    JSMin (http://www.crockford.com/javascript/jsmin.html), developed by Douglas Crockford, remained the standard in JavaScript minification for a long time. However, as web applications kept growing in size and complexity, many felt it was time to push JavaScript minification a step further. This is the main reason behind the development of the YUI Compressor (http://developer.yahoo.com/yui/compressor/), a tool that performs all kinds of smart operations in order to offer a higher level of compaction than other tools in a completely safe way. In addition to stripping comments and unnecessary whitespace, the YUI Compressor offers the following features:
    JSMin£¨http://www.crockford.com/javascript/jsmin.html£©£¬ÓÉDouglas Crockford¿ª·¢£¬Ëü±£³ÖÁËJavaScript½ô´Õ±ê×¼ºÜ³¤Ò»¶Îʱ¼ä¡£È»¶øËæ×ÅÍøÂçÓ¦ÓóÌÐòÔÚ¹æÄ£ºÍ¸´ÔÓÐÔÉϲ»¶ÏÔö³¤£¬Ðí¶àÈËÈÏΪJavaScript½ô´ÕÓ¦µ±ÔÙÏòÇ°ÍƽøÒ»²½¡£ÕâÊÇ¿ª·¢YUIѹËõÆ÷µÄÖ÷ÒªÔ­Òò£¨http://developer.yahoo.com/yui/compressor/£©ËüÌṩÁËËùÓÐÀàÐ͵ÄÖÇÄܲÙ×÷£¬ÎªÁËÌṩ±ÈÆäËü¹¤¾ß¸ü¸ß¼¶µÄ½ô´Õ²Ù×÷²¢ÇÒÒÔÍêÈ«°²È«µÄ·½·¨ÊµÏÖ¡£³ýÁËÌÞ³ý×¢ÊͺͲ»±ØÒªµÄ¿Õ¸ñ£¬YUIѹËõÆ÷»¹ÌṩÒÔϹ¦ÄÜ£º
• Replacement of local variable names with shorter (one-, two-, or three-character) variable names, picked to optimize gzip compression downstream
  ½«¾Ö²¿±äÁ¿ÃûÌæ»»ÒÔ¸ü¶ÌµÄÐÎʽ£¨1¸ö£¬2¸ö£¬»ò3¸ö×Ö·û£©£¬ÒÔÓÅ»¯ºóÐøµÄgzipѹËõ¹¤×÷
• Rep


Ïà¹ØÎĵµ£º

javascript typeofÓ¦ÓÃ

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

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

Repaints and Reflows  ÖØ»æºÍÖØÅÅ°æ
    Once the browser has downloaded all the components of a page—HTML markup, JavaScript, CSS, images—it parses through the files and creates two internal data structures:
    µ±ä¯ÀÀÆ÷ÏÂÔØÍêËùÓÐÒ³ÃæHTML±ê¼Ç£¬JavaScri ......

[·­Òë]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 ......

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

µÚÆßÕ  Ajax  Òì²½JavaScriptºÍXML
    Ajax is a cornerstone of high-performance JavaScript. It can be used to make a page load faster by delaying the download of large resources. It can prevent page loads altogether by allowing for data to be transferred between the client ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ