The JS Operation DOM node can be the unit of the node, let us connect the node, be able to createelement,createtextnode, and then, appendchild together, It is then added to the DOM tree with AppendChild or insertbefor. But suppose you want to add a large number of nodes to the DOM tree dynamically. It will be very troublesome. And each time the DOM is refreshed. Cause a performance flaw.
The workaround is to create a document fragment using this method of document fragmentation.
I personally think it should be more appropriate to translate this into a document fragment.
Use jquery solutions.
<span style= "FONT-FAMILY:FANGSONG_GB2312;FONT-SIZE:18PX;" >
You can also use the following methods to solve< Span style= "FONT-FAMILY:FANGSONG_GB2312;FONT-SIZE:18PX;" >
The effect is the same.
Of course, you can also build a new node, like a Div, to add op to the div first, The div is then added to the body. But this will add a <div></div> to the body. However, document fragmentation does not produce such nodes.
Note: The binding fragment is actually attaching the contents of the fragment to the bound node. It does not produce nodes like <fragment></fragement>;
best Wishes.
copyright notice: This article Bo Master original article , blogs, without consent may not be reproduced.
JQuery file fragmentation