I've added similiar functionality to the remove and empty methods to fix this bug. I know dojo does something similiar. Also I've noticed that it still causes leaks if the content you load has script in it. For example: <div onclick="alert(1)"></div>
On Mar 9, 4:33 pm, mif86 <finsta...@gmail.com> wrote: > Hi. > Update on the IE7 memoryleakproblem > > Original problem: > I'm having problems with all ajax updates, $("#element").load() etc., > as well as just setting html content with html(). > Doing this over and over will gradually eat up IE 7's memory. > > Test case to reproduce:http://mif86.com/memtest3.htm > > It periodically loads another page's html content (http://mif86.com/ > memtest2.htm) into a div using jQuery's $("#element").load > ("memtest2.htm"). > If you watch the memory usage in internet explorer, it keeps growing > endlessly. > > Solution: > But doing this before updating element content prevents the > memoryleakcompletely, it seems: > document.getElementById('test').innerHTML = ''; > > Should this perhaps be patched to the jQuery remove() method somehow, > so that it will notleak? > > Ref.:http://www.outofhanwell.com/ieleak/index.php?title=Fixing_Leaks