After clicking "Create Element" Then click "Delete Element" to delete the newly created element using removeChild, and then click "Test whether the DIV still exists" to check whether the element is really deleted. The result alert displays
null. It seems that the element node has really been deleted. So what is the memory leak mentioned in Situ Zhengmei's article? I had to search on google to see if anyone has also encountered the problem of memory leak caused by removeChild. Finally, I found someone asking the same question (LINK) on an English version of msdn. I slightly modified the code in it to see through comparison the memory leak caused by removeChild. The code is as follows:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn