Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

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

Working Around Caching Issues  ¹ØÓÚ»º´æÎÊÌâ
    Adequate cache control can really enhance the user experience, but it has a downside: when revving up your application, you want to make sure your users get the latest version of the static content. This is accomplished by renaming static resources whenever they change.
    ³ä·ÖÀûÓûº´æ¿ØÖÆ¿ÉÕæÕýÌá¸ßÓû§ÌåÑ飬µ«ËüÓÐÒ»¸öȱµã£ºµ±Ó¦ÓóÌÐò¸üÐÂÖ®ºó£¬ÄãÏ£ÍûÈ·±£Óû§µÃµ½¾²Ì¬ÄÚÈݵÄ×îа汾¡£Õâͨ¹ý¶Ô¸Ä¶¯µÄ¾²Ì¬×ÊÔ´½øÐÐÖØÃüÃûʵÏÖ¡£
    Most often, developers add a version or a build number to filenames. Others like to append a checksum. Personally, I like to use a timestamp. This task can be automated using Ant. The following target takes care of renaming JavaScript files by appending a timestamp in the form of yyyyMMddhhmm:
    ´ó¶àÇé¿öÏ£¬¿ª·¢ÕßÏòÎļþÃûÖÐÌí¼ÓÒ»¸ö°æ±¾ºÅ»ò¿ª·¢±àºÅ¡£ÓÐÈËϲ»¶×·¼ÓÒ»¸öУÑéºÍ¡£¸öÈ˶øÑÔ£¬ÎÒ¸üϲ»¶Ê±¼ä´Á¡£´ËÈÎÎñ¿ÉÓÃAnt×Ô¶¯Íê³É¡£ÏÂÃæµÄÄ¿±êÌåͨ¹ý¸½¼ÓÒ»¸ö ......

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

µÚʮՠ Tools  ¹¤¾ß
    Having the right software is essential for identifying bottlenecks in both the loading and running of scripts. A number of browser vendors and large-scale websites have shared techniques and tools to help make the Web faster and more efficient. This chapter focuses on some of the free tools available for:
    µ±È·¶¨½Å±¾¼ÓÔØºÍÔËÐÐʱµÄÆ¿¾±ËùÔÚʱ£¬ºÏÊֵŤ¾ßÊDZز»¿ÉÉٵġ£Ðí¶àä¯ÀÀÆ÷³§É̺ʹóÐÍÍøÕ¾·ÖÏíÁËһЩ¼¼ÊõºÍ¹¤¾ß£¬°ïÖú¿ª·¢ÕßÊ¹ÍøÒ³¸ü¿ì£¬Ð§Âʸü¸ß¡£±¾Õ¹Ø×¢ÓÚÕâЩÃâ·Ñ¹¤¾ß£º
Profiling  ÐÔÄÜ·ÖÎö
    Timing various functions and operations during script execution to identify areas for optimization
    Ôڽű¾ÔËÐÐÆÚ¶¨Ê±Ö´Ðв»Í¬º¯ÊýºÍ²Ù×÷£¬ÕÒ³öÐèÒªÓÅ»¯µÄ²¿·Ö
Network analysis  ÍøÂç·ÖÎö
    Examining the loading of images, stylesheets, and scripts and their effect on overall page load and rendering
    ¼ì²éͼƬ£¬Ñùʽ±í£¬ºÍ½Å±¾µÄ¼ÓÔØ¹ý³Ì£¬»ã±¨ËüÃǶÔÕû¸öÒ³ ......

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

Firebug
    Firefox is a popular browser with developers, partially due to the Firebug addon (available at http://www.getfirebug.com/), which was developed initially by Joe Hewitt and is now maintained by the Mozilla Foundation. This tool has increased the productivity of web developers worldwide by providing insights into code that were never before possible.
    ¶Ô¿ª·¢ÈËÔ±À´Ëµ£¬FirefoxÊÇÒ»¸öʱ÷ÖµÄä¯ÀÀÆ÷£¬²¿·ÖÔ­ÒòÊÇFirebug²å¼þ£¨http://www.getfirebug.com/£©ÓÉJoe HewittÊ×´´ÏÖÔÚÓÉMozilla»ù½ð»áά»¤¡£´Ë¹¤¾ß¾ßÓÐǰËùδÓеĴúÂë¶´²ìÁ¦£¬Ìá¸ßÁËÈ«ÊÀ½çÍøÒ³¿ª·¢ÕßµÄÉú²úÁ¦¡£
    Firebug provides a console for logging output, a traversable DOM tree of the current page, style information, the ability to introspect DOM and JavaScript objects, and more. It also includes a profiler and network analyzer, which will be the focus of this section. Firebug is also highly extensible, enabling custom panels to be easily added.
    FirebugÌṩÁËÒ»¸ö¿ ......

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

Fiddler
    Fiddler is an HTTP debugging proxy that examines the assets coming over the wire and helps identify any loading bottlenecks. Created by Eric Lawrence, this is a general purpose network analysis tool for Windows that provides detailed reports on any browser or web request. Visit http://www.fiddler2.com/fiddler2/ for installation and other information.
    FiddlerÊÇÒ»¸öHTTPµ÷ÊÔ´úÀí£¬¼ì²é×ÊÔ´ÔÚÏß´«ÊäÇé¿ö£¬ÒÔ¶¨Î»¼ÓÔØÆ¿¾±¡£ËüÓÉEric Lawrence´´½¨£¬ÊÇÒ»¸öWindowsÏÂͨÓõÄÍøÂç·ÖÎö¹¤¾ß£¬¿ÉΪÈκÎä¯ÀÀÆ÷»òÍøÒ³ÇëÇó¸ø³öÏêϸ±¨¸æ¡£Æä°²×°ºÍÆäËüÐÅÏ¢²Î¼ûhttp://www.fiddler2.com/fiddler2/¡£
    During installation, Fiddler automatically integrates with IE and Firefox. A button is added to the IE toolbar, and an entry is added under Firefox's Tools menu. Fiddler can also be started manually. Any browser or application that makes web requests can be analyzed. While running, all WinINET traffic is routed through Fiddler, allowing it to monitor and analy ......

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

Summary  ×ܽá
    When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
    µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎöÍøÉÏ´«À´µÄ×ÊÔ´£¬·ÖÎö½Å±¾µÄÔËÐÐÐÔÄÜ£¬Ê¹ÄãÄܹ»¼¯Öо«Á¦ÔÚÄÇЩÐèҪŬÁ¦ÓÅ»¯µÄµØ·½¡£
• Use a network analyzer to identify bottlenecks in the loading of scripts and other page assets; this helps determine where script deferral or profiling may be needed.
  Ê¹ÓÃÍøÂç·ÖÎöÆ÷ÕÒ³ö¼ÓÔØ½Å±¾ºÍÆäËüÒ³Ãæ×ÊÔ´µÄÆ¿¾±ËùÔÚ£¬ÕâÓÐÖúÓÚ¾ö¶¨ÄÄЩ½Å±¾ÐèÒªÑÓ³Ù¼ÓÔØ£¬»òÕß½øÐнøÒ»²½·ÖÎö¡£
• Although conventional wisdom says to minimize the number of HTTP requests, deferring scripts whenever possible allows the page to render more quickly, providing users with a better overall experience.
  ´«Í³µÄÖǻ۸æËßÎÒÃÇÓ¦¾¡Á¿¼õÉÙHTTPÇëÇóµÄÊýÁ¿£¬¾¡Á¿ÑÓ³Ù¼ÓÔØ½Å±¾ÒÔÊ¹Ò³ÃæäÖȾËٶȸü¿ì£¬ÏòÓû§Ìṩ¸üºÃµÄÕûÌåÌåÑé¡£ ......

ÓÃJavaScriptдµÄСʱºòÍæµÄƹÅÒÇòСÓÎÏ·

ÓÉÓÚ»ðºüä¯ÀÀÆ÷²»Ö§³Ö“removeNode”º¯Êý£¬ËùÒÔһϴúÂëÖ»Ö§³ÖIE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>--ƹÅÒÇò--</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
.main{
    width:690px;
    margin:0 auto;
}
#box{
    width:680px;
    height:340px;
    border:1px solid green;
    position:relative;
}
.pingpang{
    position:absolute;
    width:10px;
    height:10px;
    background-color:red;
    overflow:hidden;
}
.pingpangpai{
    position:absolute;
    width:60px;
    height:10px ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [48] [49] [50] [51] 52 [53] [54] [55] [56] [57]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ