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

ÈçºÎ±ÜÃâ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>


Ïà¹ØÎĵµ£º

javascript½ØÈ¡Â·¾¶ÖеÄÎļþÃû

<!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 ......

javascriptʵÏּ̳еÄÁ½ÖÖ·½·¨

(Ò»)¶ÔÏóð³ä
function A(name){
    this.name = name;
    this.sayHello = function(){alert(this.name+” say Hello!”);};
}
function B(name,id){
    this.temp = A;
    this.temp(name);      &nbs ......

javascriptÖÐreplace()


javascriptÖÐreplace()
   ÔÚjavascriptÖУ¬StringµÄº¯Êýreplace()¼òֱ̫ÈÃÈËϲ°®ÁË¡£ËüÁé»î¶øÇ¿´óµÄ×Ö·ûÌæ»»´¦ÀíÄÜÁ¦£¬ÈÃÎÒ²»½ûÏëÏò´ó¼Ò½éÉÜËü¡£
¡¡¡¡replace()×î¼òµ¥µÄËãÊÇÄÜÁ¦¾ÍÊǼòµ¥µÄ×Ö·ûÌæ»»¡£Ê¾Àý´úÂëÈçÏ£º
<script language="javascript">
 var strM = "javascript is a good script ......

¡¡javascriptº¯ÊýÌØµã(zz)

¡¡javascriptº¯ÊýµÄ²ÎÊýÊÇ¿ÉÑ¡µÄ¡£ËüÓÐÏÂÃæ¼¸¸öÌØµã£º
¡¡¡¡£±.ÒòΪjavascript±¾ÉíÊÇÈõÀàÐÍ£¬ËùÒÔ£¬ËüµÄº¯Êý²ÎÊýҲûÓÐÀàÐͼì²éºÍÀàÐÍÏÞ¶¨£¬Ò»Çж¼Òª¿¿±à³ÌÕß×Ô¼ºÈ¥½øÐмì²é¡£
¡¡¡¡£².²ÎÊý¸öÊý²»¶¨¡£¾¡¹ÜÄãÒ²ÔÚÔÚº¯ÊýÉùÃ÷ʱ£¬ÓУ³¸ö²ÎÊý£¬¶øÔÚʵ¼ÊµÄʹÓÃÖУ¬Äã¿ÉÒÔ´«ÈÎÒâ¸ö²ÎÊý¸øÕâ¸öº¯Êý¡£ËüµÄʶ±ð½ö½öÊÇÒÀ¿¿º¯ÊýÃû£¬ÕâÓ ......

(×ªÔØ)javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ


 
[ 2007-8-6 17:03:00 | By: ibrahim ]
 
javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ

ÏÈÀ´¿´¿´options¼¯ºÏµÄÕ⼸¸ö·½·¨£º
options.add(option)·½·¨Ïò¼¯ºÏÀïÌí¼ÓÒ»Ïîoption¶ÔÏó£»
options.remove(index)·½·¨ÒƳýoptions¼¯ºÏÖеÄÖ¸¶¨Ï
options(index)»òoptions.item(index)¿ÉÒÔͨ¹ýË÷Òý»ñÈ¡options¼¯º ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ