jquery - javascript dom insertion. Performance vs Leak? -


I'm wondering what is the right way to put complex elements

So far, ( With jQuery) I used to first build my own element and to finish it once. I thought it was the most efficient, because Dome Access performance is fantastic.

But with the original JS, I have read that to avoid memory leaks, each new dome node should be inserted into the dome immediately after its creation.

Our intranet says:

Note the DOM Entry Order DOM Entry Order: No root element attached to the original element is attached to the DOM itself Please.

var root = document.createElement ("DIV"); Var children = document.createElement ("DIV"); // It is wrong root.appendChild (child); Document.body.appendChild (Route); // This is the right document. Don.appendChild (Route); Root.appendChild (child);

I found this page online that basically explain the same thing (under the cross-page leak section):

This means that Performance and leakage-prevention?

Should the new DOM elements be created and manipulated in the form of a string before being inserted? How are the JS libraries solving this? What is a miracle solution in the document?

Your quote is inspired by the article written by almost one member about the IE team, special Sections related to "DOM Insertion Order Leak Model" are eligible for a two-digit note:

  1. This article was written in 2005 specifically to address leaks issues in IE6 Had IE 7 been not released;
  2. This is only concerned with IE; There is no suggestion that any other browser is suffering from the same problem. According to the ("top management" under memory management improvements), IE 7 contains improvements to prevent such leaks for lifetime, in the browser window, and in IE 8 Hope has improved in the hope of ending the need to worry about the matter.

    The question you need to ask is: How important is IE6 for you? At the end of the day, DOM insertion order should never be anything to worry, but if (for example) you are working on an intranet app that will be used on IE6 for some time, then you Keep in mind the points in the 2005 article, if you have a luxury to know that IE6 is hardly a blip on your app's radar, do not worry about it.

    Oh, and note that adding everything to parents will provide better performance before adding parents to the page: if a new baby is added to each child Rather than replacing and replying, the browser can refill and repeat again when everything can come in a systematic part.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -