Link Details

Link 96832 thumbnail
User 209500 avatar

By rlamarch
via ejohn.org
Published: Jul 21 2008 / 17:02

I was playing around with DOM DocumentFragments recently, in JavaScript, seeing what I could make with them. Roughly speaking, a DocumentFragment is a lightweight container that can hold DOM nodes. It's part of the DOM 1 specification and is supported in all modern browsers (it was added to Internet Explorer in version 6). If you take a bunch of DOM nodes and append them to a fragment then you can simply append the fragment to the document. As it turns out: A method that is largely ignored in modern web development can provide some serious (2-3x) performance improvements to your DOM manipulation.
  • 16
  • 0
  • 1038
  • 217

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.