the jquery dom manipulation routines are not to be over-used.
instead of zillions of calls to jquery, you should prepare a html statement
as a string;

var html = '';
html += '<div id="something">';
html += 'somethingElse';
html += '</div>';

to prevent IE mem leaks, i read to do this:

var div = document.createElement ("DIV");
$(div).css ({ display:none });
document.body.appendChild (div);
div.innerHTML = html;
document.body.removeChild(div);
$(div).css ({ finalizedCSS });
$(parent)[0].appendChild (div);

2008/9/4 Jacky <[EMAIL PROTECTED]>

> Hi all,
>
> I have some question about IE memory leakage.
>
> There are four type of leakage in IE as stated in
> http://msdn.microsoft.com/en-us/library/bb250448(VS.85).aspx<http://msdn.microsoft.com/en-us/library/bb250448%28VS.85%29.aspx>One
>  of them is called 'Cross Page Leak', which is caused by DOM insertion
> order. (should have no intermediate object)
> The result is that the memory will not be released even if page is changed.
>
> So, will the following code introduce this kind of leakage?
>
> $('<div>')
>     .append('<p>Some text</p>')
>     .append($('<div/>').append('abcdef'))
>         //more append to create the complex dom objects
>         //.....
>     .appendTo("body");
>
> My case is quite serious. I have a page with some modals displaying some
> small search box the ajax way.
> Whenever a modal is displayed, about 10MB of memory is consumed and it
> never returns.
>
> --
> Best Regards,
> Jacky
> 網絡暴民 http://jacky.seezone.net
>

Reply via email to