Solve JS objects and DOM objects in JS memory leaks


This problem involves the problem of scope chains, JS objects, and DOM objects.

Because for anonymous functions, its scope chains contain three objects: variable objects, dotry () variable objects, and global variable objects. At this time, the DOTRY function object references the DOM object, that is, the dotry function object references the DOM object; then according to an anonymous function, the DOM object’s onclickà anonymous function object, anonymous function object àdotry function object, that is, DOM object reference Dotry (). So explaining the situation of intercounting, causing memory that memory cannot.

Solving the idea: will be interrupted by each other.

The above is the JS object for the Solution to the JS memory leakage. DOM objects cited each other, I hope to help everyone. If you have any questions, please send me a message, Xiaobian will reply to everyone in time! 解决JS内存泄露之js对象和dom对象互相引用问题 解决JS内存泄露之js对象和dom对象互相引用问题

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment