ÈçºÎ±ÜÃâJavascriptʼþ°ó¶¨³öÏÖÄÚ´æÐ¹Â©
"These memory leaks often
occur as a result of circular references between JavaScript objects and
objects within IE’s DOM (document object model)."
GPDE Team Blog
Ã÷ÏÔµÄDOM¶ÔÏóÓë JavaScript¶ÔÏóÑ»·ÒýÓúܺÃÅжϣ¬ÄѵÄÊÇÒþº¬µÄÑ»·ÒýÓÃÅжϣ¡
Òþº¬µÄÑ»·ÒýÓÃÐèҪͨ¹ý×÷ÓÃÓòÁ´½øÐзÖÎöÅжϣ¡
¿¼ÂÇÒÔÏ´úÂë(¸Ðл¿É°®µÄwinter ^_^)£º
var e=document.getElementBy??("XX");
e.onclick=function(){}
scopechain·ÖÎö£º
scopechain.e = document.getElementBy??("XX");
function f(){}
function f(){}.[[scope]] = scopechain
e.onclick = f
ºÜÇåÎú£¬¶Ô²»¶Ô£¿
"Javascript°ó¶¨Ê¼þʱ£¬Ö»ÒªDOMµÄʼþÀï·ÃÎʲ»ÁËDOM×Ô¼ºµÄÄǸö±äÁ¿¾ÍÐÐÁË"
winter
"IEÏÖÔÚµÄPatch¸ãµÃÓÐʱºòй¶ÓÐʱºò²»Ð¹Â¶"
winter
<button id="testx">No Memory Leak Event Bind</button>
<button id="testy">No Memory Leak Event Bind</button>
<script type="text/javascript">
var fooA = function(){
var f = function(){alert(this+'\n'+fooA);}
!function(){
var d = document.getElementById('testx');
d.onclick = f;
}()
}
fooA();
var fooB = function(){
this.onclick = function(){alert(this+'\n'+fooB);}
}
fooB.call(document.getElementById('testy'));
</script>
Ïà¹ØÎĵµ£º
<!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>
<meta http-equiv="Content-Type"&nb ......
FusionChart ¾Í²»ÓýéÉÜÁ˰ѣ¬Ò»¿îÖ§³Ö¶àÖÖÓïÑÔµÄͼ±íÉú³É¿Ø¼þ£¬Éú³ÉµÄͼ±í·á¸»£¬ÃÀ¹Û£¬ÇÒÓж¯Ì¬¸Ð£¬ÒòΪËüÉú´æµÄ¶«Î÷¾ÍÊÇÒ»¸öflash¡£Ò»Ï½éÉÜÒ»ÏÂËüµÄjavascript ʵÏÖ·½Ê½°Ñ¡£
·Ï»°ÉÙ˵£¬Ö±½ÓÉÏʵÀý
<HTML>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡ <HEAD>¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ <SCRIPT LANGUAGE="Javascri ......
javascriptͼƬä¯ÀÀÆ÷µÄºËÐÄ——ͼƬԤ¼ÓÔØ
2009-04-06 10:57
ÍøÕ¾¿ª·¢Ê±¾³£ÐèÒªÔÚij¸öÒ³ÃæÐèҪʵÏÖ¶Ô´óÁ¿Í¼Æ¬µÄä¯ÀÀ£¬Èç¹û¿¼ÂÇÁ÷Á¿µÄ»°£¬´ó¿ÉÒÔÏñpconlineÒ»Ñùÿ¸öÒ³ÃæÖ»ÏÔʾһÕÅͼƬ£¬ÈÃÓû§Ã¿¿´Ò»ÕÅͼƬ¾ÍÐèÒªÖØÐÂÏÂÔØÒ»ÏÂÕû¸öÒ³Ãæ¡£²»¹ý£¬ÔÚweb2.0ʱ´ú£¬¸ü¶àÈËÔ¸ÒâÓÃjavas ......
<html>
<head>
<mce:script type="text/javascript"><!--
function myclick(event){
var ev =event.srcElement ? event.srcElement : event.target;
}
// --></mce:script>
......
¡¡javascriptº¯ÊýµÄ²ÎÊýÊÇ¿ÉÑ¡µÄ¡£ËüÓÐÏÂÃæ¼¸¸öÌØµã£º
¡¡¡¡£±.ÒòΪjavascript±¾ÉíÊÇÈõÀàÐÍ£¬ËùÒÔ£¬ËüµÄº¯Êý²ÎÊýҲûÓÐÀàÐͼì²éºÍÀàÐÍÏÞ¶¨£¬Ò»Çж¼Òª¿¿±à³ÌÕß×Ô¼ºÈ¥½øÐмì²é¡£
¡¡¡¡£².²ÎÊý¸öÊý²»¶¨¡£¾¡¹ÜÄãÒ²ÔÚÔÚº¯ÊýÉùÃ÷ʱ£¬ÓУ³¸ö²ÎÊý£¬¶øÔÚʵ¼ÊµÄʹÓÃÖУ¬Äã¿ÉÒÔ´«ÈÎÒâ¸ö²ÎÊý¸øÕâ¸öº¯Êý¡£ËüµÄʶ±ð½ö½öÊÇÒÀ¿¿º¯ÊýÃû£¬ÕâÓ ......