Re: [Ieleak-devel] real-time memory graph
Brought to you by:
matthiasmiller
From: jsrosman <jsr...@wa...> - 2006-06-13 11:09:45
|
Great! Made a small modification: The removeChild isn't necessary because appendChild already will move the element. http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks#Pseudo-Leaks. - Johan > Datum: 13/06/06 01:41 AM > Van: "Matthias Miller" > Aan: iel...@li... > CC: > Onderwerp : Re: [Ieleak-devel] real-time memory graph > > Thanks, that's helpful. I've updated the function at > http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks#Pseudo-Leaks. > > -Matthias Miller > > Johan Rosman wrote: > > Exactly! only don't create the container twice. But be aware the container > > should be added to the body otherwise the clean up won't work. > > > > -johan > > ----- Original Message ----- > > From: "Matthias Miller" > > To: > > Sent: Monday, June 12, 2006 3:30 PM > > Subject: Re: [Ieleak-devel] real-time memory graph > > > > > > > >> Hi Johan, are you thinking of a function like this? Or does the > >> container need to be attached to the document? > >> > >> function removeElement(elem) { > >> var container = document.createElement('DIV'); > >> container.appendChild(elem.parentNode.removeChild(elem)); > >> container.innerHTML = ""; > >> } > >> > >> -Matthias Miller > >> > >> jsrosman wrote: > >> > >>> Hi Matthias > >>> > >>> Setting outerHTML to "" is not a generic solution it is read-only for > >>> a range some HTML node-types. Better to appending the child to be > >>> removed to a dummy node somewhere in your document.documentElement and > >>> then set the innerHTML of that dummy node to "". This can be > >>> abstracted in a function of course. > >>> > >>> -Johan > >>> > >>> > Datum: 10/06/06 07:04 PM > >>> > Van: "Matthias Miller" > >>> > Aan: iel...@li... > >>> > CC: > >>> > Onderwerp : Re: [Ieleak-devel] real-time memory graph > >>> > > >>> > Johan Rosman wrote: > >>> > > Hi, > >>> > > > >>> > > As mentioned earlier removeChild is a pseudo leak!. Better to set > >>> > > innerHTML to "" instead. > >>> > > >>> > Thanks Johan. I documented this at > >>> > > >>> > >>> http://outofhanwell.com/ieleak/index.php?title=Fixing_Leaks#Pseudo-Leaks. > >>> > >>> > Am I right that it would also work to set the element's > >>> outerHTML to ""? > >>> > This would be another good function for the "anti-leak javascript > >>> > library" that I mentioned recently. :-) > >>> > > >>> > -Matthias Miller > >>> > > >>> > > >>> > > >>> > _______________________________________________ > >>> > Ieleak-devel mailing list > >>> > Iel...@li... > >>> > https://lists.sourceforge.net/lists/listinfo/ieleak-devel > >>> > > >>> > > >>> > >>> ------------------------------------------------------------------------ > >>> > >>> _______________________________________________ > >>> Ieleak-devel mailing list > >>> Iel...@li... > >>> https://lists.sourceforge.net/lists/listinfo/ieleak-devel > >>> > >>> > >> > >> > >> _______________________________________________ > >> Ieleak-devel mailing list > >> Iel...@li... > >> https://lists.sourceforge.net/lists/listinfo/ieleak-devel > >> > >> > >> > > > > > > > > > > _______________________________________________ > > Ieleak-devel mailing list > > Iel...@li... > > https://lists.sourceforge.net/lists/listinfo/ieleak-devel > > > > > > > > > > > _______________________________________________ > Ieleak-devel mailing list > Iel...@li... > https://lists.sourceforge.net/lists/listinfo/ieleak-devel > > |