3 ms·
Here is an introduction. They are not SVG specific but you can build SVG elements in a document fragment, which is a lot faster than appending to the DOM, then
by spellboots 13y ago
Here is an introduction. They are not SVG specific but you can build SVG elements in a document fragment, which is a lot faster than appending to the DOM, then append the fragment to the DOM all in one go.
See http://ejohn.org/blog/dom-documentfragments/ http://ejohn.org/blog/dom-documentfragments/ or google for an introduction.
Building strings and using innerHTML is a very ugly way to get performance, you should definitely try to using the document fragment approach as it has similar performance characteristics.
- gruseom 13y agoSo these are regular document fragments? I vaguely remember that we tried that and it didn't work nearly as well, but it's been a while. Building strings and using innerHTML is a very ugly Ah. Then you'll be dismayed to hear we use tables for layout as well :)