This is more FYI than the actual answer, but it is also quite interesting.
From the W3C DOM core specification (http://www.w3.org/TR/DOM-Level-2-Core/core.html):
The Core DOM APIs are designed to be compatible with a wide range of languages, including common-use scripting languages ββand more complex languages, used primarily by professional programmers. Thus, the DOM APIs must work with various memory management philosophies, from language bindings that donβt provide the user with memory management at all through those (in particular Java) that provide explicit constructors but automatically provide an automatic mechanism for garbage collection to return unused memory those (especially C / C ++) that usually require the programmer to explicitly allocate object memory, keep track of where it is used, and explicitly free it for reuse. To provide a consistent API on these platforms, the DOM does not address memory management issues at all, but instead leaves them for implementation. None of the explicit language bindings defined by the DOM API (for ECMAScript and Java) require any memory management methods, but DOM binding for other languages ββ(especially C or C ++) may require such support. These extensions will be responsible for adapting the DOM API to a specific language, and not to the DOM workgroup.
In other words: memory management remains to implement the DOM specification in different languages. You will need to study the documentation for implementing the DOM in javascript to find out some method to remove a DOM object from memory, which is not a hack. (However, the MDC website has very little information on this topic.)
As a note to jQuery#remove and jQuery#empty : from what I can say, none of these methods does anything except remove the Object from the DOM node or remove the DOM node from document >. They just delete. This, of course, does not mean that there is no memory for these objects, although they are no longer in document .
Edit: The above snippet was superfluous, because obviously jQuery cannot work wonders and work with the DOM implementation of the browser used.
FK82 Sep 24 2018-10-12T00: 00Z
source share