I've just discovered that when the remove() function is used, the matched elements are not removed from the jQuery object, just the DOM.
According to the [remove() documentation][1]:
> Removes all matched elements from the
> DOM. This does NOT remove them from
> the jQuery object, allowing you to use
> the matched elements further.
Surely if a web app keeps on adding and removing elements from the dom, this will keep using up more and more memory? Can someone confirm if this is the case? What can be done to avoid this?
[1]: http://docs.jquery.com/Manipulation/remove#expr
以上就是Possible jQuery memory issues with $('#foo').remove() ?的详细内容,更多请关注web前端其它相关文章!