Why is the jquery empty function so complicated?

前端 未结 1 1460
旧巷少年郎
旧巷少年郎 2020-12-21 09:28

I looked at the jQuery source code for the .empty() function:

empty: function() {
        for ( var i = 0, elem; (elem = this[i]) !         


        
相关标签:
1条回答
  • 2020-12-21 09:58

    Just think about .data() expandos and event handlers... By just removing the DOM, you would create memory leaks every time.

    0 讨论(0)
提交回复
热议问题