In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you the problem of how to change the innerHTML association so that memory can not be freed. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
When using JavaScript for DOM operations, depending on the browser, you will always encounter something interesting. The problem described this time is related to the association between IE6 and innerHTML: detailed records show that the memory of the deleted node will no longer be freed when ie6 operates on the innerHTML and dom of the deleted node, while there is no problem in setting the attributes of the deleted node and css.
The attention of the processing node is often called back in xhr, and the node that may be processed has been deleted.
Test the code:
< div id="p"> < a id="c">Xx
< /a> < /div> < script>_ window.onload=function () {var a=document.getElementById ("c"); document.getElementById ("p") [xss_clean] = ""; / / css, there is no problem with the attribute / / a.style.width = "1px"; / / a.hrefs = "xx"; / / there is a problem with setting innerHTML: changing the innerHTML association a [XSS _ clean] = 'yy' / / dom an and span cannot release / / a.appendChild (document.createElement ("span")); / / span null;}
< /script>Under normal circumstances:
After the execution of the page, there are 6 in-use nodes, a has been released
InnerHTML Association:
7 innerHTML in-use nodes of deleted nodes have been changed, a cannot be released
The above is the problem shared by the editor on how to change the innerHTML association so that memory cannot be freed. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.