Hi All,
I'm writing an addressbook app that uses an ajax call to receive a
list of contacts. All was running well until I discovered that the
client has 250+ contacts and the browser hangs (windows gives 'not
responding') for a second as Javascript draws all the divs etc
required for the information.
My googling informs me that .innerHTML is the fastest method of
insertion so I have been using this. I have tried looping through the
addresses running .innerHTML each time but that was v slow and crashed
the browser. Then I tried joining all the contacts up in to one
huuuuuuuge string and this was a little faster but the browser still
hangs noticeably.
The only method that doesnt kill the browser is to use setTimeout to
space the .innerHTML calls out by a few ms and but this has its own
disadvantages - I have no idea what the optimum delay is.
Does anyone have any advice? Would DOM creation be better if I were to
create all the nodes and then insert or will I experience similar
problems?
If nobody replies with advice before I try it myself I will let you
know.
James