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

£¨×ª£©javascript ÄÚ´æй¶¹¤¾ßʹÓÃ


javascriptÄÚ´æ鶵ÄÎÊÌâÒ»Ö±ÒÔÀ´¶¼²»Êܵ½´ó¼ÒµÄÖØÊÓ£¬Ô­ÒòÊǶÔÓû§µÄÓ°ÏìûÓÐ̫ʵ¼ÊµÄ±íÏÖ£¬»òÐí½ü¼¸ÄêÄڴ淢չѸËÙ¡£½Å±¾ÄÚ´æÔÙй¶Ҳ²»»áÓÐÌ«´óÓ°Ïì¡£
µ±È»×÷Ϊǰ¶Ë¿ª·¢µÄͬѧÃÇ£¬¾Í²»ÄÜÓÐÕâÑùµÄ½ÄÐÒÐÄÀí¡£³öÏÖmemory leaksºÜ´ó³Ì¶ÈÉÏÊÇÒòΪ³ÌÐòµÄ²»³ÉÊìºÍ±àÂ벻̫¹æ·¶Ôì³ÉµÄ¡£²»¹ý£¬ÕâÀï¾Í²»ËµÈçºÎ³öÏÖÎÊÌâµÄ£¬¶ÔÎÊÌâµÄ³öÏÖÓÐÐËȤ¿ÉÒԲο¼ÒÔϵØÖ·£º
Understanding and Solving Internet Explorer Leak Patterns
IE's memory-leak fix greatly exaggerated
Memory Leakage in Internet Explorer – revisited
ÕâÀïÖ÷Ҫ˵˵£¬Ä¿Ç°¼¸¸ö¼ì²éjavascriptÄÚ´æй¶µÄ¹¤¾ßʹÓ÷½·¨:
Ê×
ÏÈÎÒÃÇÓõ½µÄ¹¤¾ßÓÐÈý¸ö Drip/sIEve ,Javascript Leaks Detector, leak
monitor¡£ÆäÖÐÇ°Á½¸öÊÇÓÃÓÚ¼ì²éieµÄ£¬leak monitor
ÊÇÓÃÀ´¼ì²éfirefoxµÄÇé¿öµÄ¡£ÕâÀïÖصã˵һÏÂieϵÄÕâÁ½¸ö¹¤¾ß£¬ÓÉÓÚfirefoxµÄGC»úÖƱÈieǿ׳£¬Ö»ÒªieµÄÎÊÌâÏû³ýÁË£¬ÆäËûä¯ÀÀÆ÷»ù±¾
Éϲ»»áÓÐʲôÎÊÌâ¡£
1.Drip/sIEve
DripºÍsIEveµÄ×÷ÕßÓ¦¸ÃÊÇͬһ¸öÈË£¬Á¬open souceÉϵÄÏîÄ¿¶¼ÊÇÔÚÒ»ÆðµÄ¡£²»¹ý£¬Æ½Ê±ÎÒÃÇÖ÷ҪʹÓÃsIEve¾Í¿ÉÒÔÁË£¬sIEveµÄ¹¦ÄܱÈDripÇ¿´óһЩ
sIEve ½çÃæºÜ¼òµ¥£¬×ó²à£ºÄÚǶÁËÒ»¸öä¯ÀÀÆ÷¿Ø¼þ£¬ÎÒ¿ÉÒÔ·ÃÎÊÈκÎÍøÖ·£¬Ï·½»¹ÓиöÄÚ´æ¼ì²é£¬ÕâÑùÎÒÃÇ¿ÉÒÔ·½±ã¿´³öÄÚ´æµÄÉý½µÇé¿öÒÔ¼°domʹÓÃÊýÁ¿ÇúÏß¡£
ÓÒ²àÃæ°å£¬ÎÒÃÇ¿ÉÒÔͨ¹ý Show in use ¿´µ½Ä¿Ç°Ò³ÃæʹÓõÄdomµÄÇé¿ö£¬Show Leaks ¿ÉÒÔ¿´µ½ÄÚ´æ鶵Ädom¡£µ±È»Ã¿´ÎÏÔʾ鶵ÄÇé¿ö±ØÐëÊÇÒ³Ãæˢк󣬿´µ½ÉÏÒ»¸öÒ³ÃæµÄй¶Çé¿ö¡£
ͬʱͨ¹ýÓÒ²àµÄÊý¾ÝÑÕÉ«£¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÄÚ´æµÄÉý½µºÍ¾ßÌåµÄÊýÁ¿¼¶
            


 
²»¹ýsIEveµÄ¹¤×÷Ô­ÀíÊǶÔËùÓÐdom½øÐÐÁËÒ»´Îhack,È»ºó×Ô¼ºÅжÏÄÇЩdomûÓб»Êͷŵô£¬µ«ÊǾßÌåµÄÇé¿ö±È½ÏÄÑ·ÖÎö³öÀ´¡£¶øÇÒ¸ú×ÙÓÐÎÊÌâµÄdomÐèÒªÒ»¶¨¼¼ÇÉ£¬¶ÔÓÚ´óÐ͵ÄÓ¦ÓóÌÐò£¬¸ú×ÙÄѶȴó¡£
²»¹ýÓÃÀ´¼ì²âСģ¿éµÄÄÚ´æʹÓÃÇé¿ö»¹ÊÇÒ»¸ö²»´íµÄÑ¡Ôñ£¬ÌرðÊÇ´óÏîÄ¿Ä£¿éϸ·Öºó£¬¶Ôÿ¸öÄ£¿éµÄµ¥¶À²âÊÔ»¹ÊDZȽϲ»´íµÄ
ллâø·ÉͬѧÌáʾµÄÏÂÔصØÖ·, Drip/sIEveÏÂÔصØÖ·:

http://home.orange.nl/jsrosman/
2. Javascript Leaks Detector
ÕâÊÇÀ´×Ô΢ÈíGPDEÍŶӵÄÒ»¸öС¹¤¾ß,ÏÂÃæ¼ò³ÆJLD
¹ÙÍø: http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx



°²×°ºó£¬ÎÒÃÇ¿ÉÒÔÔÚieä¯ÀÀÆ÷µÄ ²


Ïà¹ØÎĵµ£º

javascriptÍøÒ³¶Ô»°¿ò²ÎÊýÏê½â

N.1 »ù±¾½éÉÜ£º
    * showModalDialog() (IE 4+ Ö§³Ö)£¬ÓÃÀ´´´½¨Ò»¸öÏÔʾHTMLÄÚÈݵÄģ̬¶Ô»°¿ò¡£
    * showModelessDialog() (IE 5+ Ö§³Ö) £¬ÓÃÀ´´´½¨Ò»¸öÏÔʾHTMLÄÚÈݵķÇģ̬¶Ô»°¿ò¡£
N.2 ʹÓ÷½·¨£º
    * vReturnValue = window.showModalDialog(sURL [, vArgument ......

javascript»ñÈ¡²¢·ÖÎöURL(html?id=*µÈÎÊÌâ)

1.»ñÈ¡URL
»ñÈ¡urlµÄ·½·¨£¬Ö±½ÓÓÃlocation¾Í¿ÉÒÔÁË£¬window.location»òwindow.loation.hrefÒ²¿ÉÒÔ¡£
2.·ÖÎöURL
ÔËÓÃlocation»ñÈ¡µÄurlµÄÊôÐÔΪobject£¬Òª¶ÔÆä½øÐÐ×Ö·û´®µÄ·ÖÎö²Ù×÷£¬ÐèÒªÏȽ«Æäת»»Îª×Ö·û´®¡£
ÓÃlocationÀ´½øÐд¦Àí£¬Ê×ÏȽ«Æäת»»Îª×Ö·û´®£¬Óú¯ÊýtoString()£¬URL.toString();
¸½Ò»Ð©URL²ÎÊý
ÍêÕûµÄU ......

ÔÚÍøÉÏÕÒµÄjavascriptµÄÄÚÖöÔÏóµÄ×ÊÁÏ

JavaScriptÓµÓÐÄÚÖöÔÏóºÍ×Ô¶¨Òå¶ÔÏó£¬ÊÂʵÉϸ÷ÖÖÊý¾ÝÀàÐ͵ıäÁ¿¶¼ÊôÓÚÒ»ÖÖ¶ÔÏ󣬱äÁ¿ÔÚÉùÃ÷ºÍ¸³ÖµºóÂíÉÏÓµÓжÔÓ¦µÄ·½·¨ºÍ¶ÔÏó¡£
¡¡¡¡1.JavaScriptÄÚÖöÔÏóµÄÖÖÀà
¡¡¡¡JavaScript¶ÔÏóÒÀÕÕ½¨Á¢·½Ê½²»Í¬¿É·ÖΪʹÓñäÁ¿ÉùÃ÷µÄÒþÐÔ¶ÔÏóºÍʹÓÃnewÃüÁî¶ÔÁ¢¶ÔÏ󸱱¾µÄÏÔÐÔ¶ÔÏó¡£
¡¡¡¡
¡¡¡¡ÒþÐÔ¶ÔÏó(Implicit[im'plisit] Object ......

JavaScriptÌâÐÍ

 1£®ÈçºÎ»ñÈ¡±íµ¥<select>ÓòµÄÑ¡Ôñ²¿·ÖµÄÎı¾£¿
<form name="a">
<select name="a" size="1" onchange="_sel(this)">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
< ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ