javascript memory leaks

后端 未结 5 632
天涯浪人
天涯浪人 2020-12-10 02:25

i am using jquery and doing something like this

DOM:

5条回答
  •  孤街浪徒
    2020-12-10 02:47

    Yes, because jQuery maintains a list of the attached event handlers to make unhooking them easier and in order to explicitly unhook them for you when the page is unloaded (which works around a more serious memory leak in IE). (So does Prototype, can't speak for other libs.) The solution is to unhook them before removing the elements (either directly, or via empty).

提交回复
热议问题