Message from JavaScript discussions

June 2017

— I wouldn't


If you are getting HTML from the server you can, for sure, but if you can build it yourself in a document fragment, then insert the fragment, that is a faster alternative

— These dom-is-text guys won't learn

— XMLHttpRequest has the ability to parse documents too, if all you are sending is HTML

— Yup

— Also wow, we got lots of new people :)

— Yea

— I recommended this in another sn group a few days ago

— I didn't know the existence of document fragments, thank you Floofies

— No problem :)

— If you are adding a few elements it is sometimes better to use those to prevent DOM thrashing

— But the speed increase is a nice benefit as well