/ Published in: PHP
Memory leakage in IE6/7 if the event handlers are not purged before deleting an element.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Object.protoype.purge = function purge(d) { var a = d.attributes, i, l, n; if (a) { l = a.length; for (i = 0; i < l; i += 1) { n = a[i].name; if (typeof d[n] === 'function') { d[n] = null; } } } a = d.childNodes; if (a) { l = a.length; for (i = 0; i < l; i += 1) { purge(d.childNodes[i]); } } }
URL: http://javascript.crockford.com/memory/leak.html