Mozilla文档上的例子,这个是在IE6,7里的,https://developer.mozilla.org/en-US/docs/JavaScript/Memory_Managementvardiv=document.createElement("div");div.onclick=function(){doSomething();};//Thedivhasareferencetotheeventhandlerviaits'onclick'property//Thehandleralsohasareferencetothedivsincethe'div'variablecanbeaccessedwithinthefunctionscope//Thiscyclewillcausebothobjectsnottobegarbage-collectedandthusamemoryleak.这里说的,函数里有一个对div的引用,可是在哪,是this么?在ChromeFirefox里是否有类似的内存泄漏问题?这是语言设计的失误么?
慕标琳琳
相关分类