Best way to empty a listbox with large amounts of data

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
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top