JQuery File Fragmentation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.