While studying the jQuery sourcecode I stumbled upon the cleanData
-function several times:
jQuery.remove() calls it. So do other functions. What is the purpose of calling cleanData
before removing the DOM-Element?
Is jQuery's remove()
-method superior to a simple(removeChild) like in this fiddle?
And if so, why is it so? Does that code lead to memory leaks?
What is the data, which gets cleared before removal? Is there any usecase outside jQuery?