Best way to empty a listbox with large amounts of data

Discussion in 'ASP .Net' started by Erik, Oct 31, 2007.

  1. Erik

    Erik Guest

    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
    Erik, Oct 31, 2007
    #1
    1. Advertising

  2. Erik

    bruce barker Guest

    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)

    Erik wrote:
    > 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
    >
    >
    bruce barker, Nov 1, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brent
    Replies:
    3
    Views:
    497
    Raymond Lewallen
    Apr 7, 2004
  2. Andersen
    Replies:
    2
    Views:
    392
  3. Bint
    Replies:
    1
    Views:
    1,864
    Benjamin Niemann
    Mar 19, 2006
  4. David
    Replies:
    0
    Views:
    329
    David
    Jun 21, 2006
  5. flamesrock
    Replies:
    2
    Views:
    378
    flamesrock
    Mar 12, 2005
Loading...

Share This Page