I just came here, but I haven't forgotten it yet, so I can record a point I learned last night-the file fragments in JavaScript. 1. Basic understanding of document fragments this Article fragment can improve DOM operation performance (theoretically, pay attention to it !! Theoretically) the principle of file fragmentation reduces the reflux operation on DOM modifications. The following is a simple example of DOM backflow: for example, a person who buys vinegar, liquor, and salt from a mall. He has two ways: (1) Buy all three items at a mall at a time, so that two trips can be made back and forth; (2) buy one thing and take it home, then I went back to buy the second item, and then went back to buy the third item. It showed that it would take 6 times to get back and forth. Obviously, the latter is a neurology. In this example, we want to describe the backflow operation. Now I will take a look at how to reduce DOM reflux operations by using the method of document fragmentation to Improve the Performance by combining the new DOM nodes. For example, define 10000 li nodes at a time, place them on the file fragments, and mount them at a time. Another method is to mount the node without adding a new li node. Obviously, DOM operations are performed many times, resulting in a large number of DOM operation backflow times, theoretically, the execution performance is reduced. (In theory, because the examples I made later are inconsistent with my expected results .) How to create a document fragment var oFrag = document. createDocumentFragment (); // It is used to create document fragments. Next I will paste the code + execution of my experiment: My Test method: Add 10000 li nodes and count the execution time, compare the execution time of the two to determine who has a higher performance. (1) Use the common method to mount the new node and copy code 1 <! DOCTYPE html> 2