Is there a way to count the amount of times that the DOM has been appended to?
If you're stricly after .append()
, you can just patch it, like:
var _origAppend = $.fn.append;
$.appendCount = 0;
$.fn.append = function() {
$.appendCount++;
return _origAppend.apply(this, arguments);
};
Now, you could just access $.appendCount
at anytime to see how often it was called. However, be aware that there are lots of functions which can manipulate the DOM. It might be a more clever idea, to patch jQuery.fn.domManip
instead. That method is called internally basically at any dom manipulation (like you might have suspected because of the name)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With