Best way to empty a listbox with large amounts of data

  • Thread starter Thread starter Erik
  • Start date Start date
E

Erik

Hi Everyone,

I have filled a div with around 10000 items of data. I have got it loading
in around 2 seconds but when I come to empty the div by setting innerHTML to
"" it takes ages, about 20 seconds to clear.

Can anybody tell me a quicker way of clearing the contents of a DIV. I have
also tried wrapping the content in another DIV and then simply removing the
DIV from the DOM but it takes the same amount of time.

Many thanks
 
in IE every dom node is a com object that needs to be released. you
really have too mush data for a div. one thing you could try is an
iframe. IE has probably better optimized the destruction of an entire
page. in this case you just set the src to 'blank.htm'.


you could also try your own optimized release. do a reverse tree walk
and delete the nodes bottom up, last child first, though this many
iterations of the dom may be the actual problem. (i'd of though IE would
do it this way)

-- bruce (sqlwork.com)
 
Back
Top