I've got a loop where I insert about 500 <div>
s into the DOM via document.getElementById(target).appendChild(docFragmentDiv)
, and each <div>
has probably 20 or 30 descendants. I can insert up to about 100 just fine, but the page temporarily freezes while the DOM is updated if there's something like 200+ inserts.
How can I avoid this choke? Right now I have an interval set up to insert 50 per interval, with 25 ms between intervals. Is there a better way to do this?