Hacker News new | ask | show | jobs
by wwarnerandrew 4813 days ago
What about using something like jquery detach? Then you could, when rendering, detach the element, render all the content, subviews, and re-append it. That shouldn't trigger reflows, right?
2 comments

Correct. So far as I know, the way jQuery detach works is to remove it from the DOM and then return the individual element. The element could act as a fragment, because it can contain children, and then be reappended to the DOM.
Right, and even better than a document fragment since fragments have both unusual semantics and API limitations that normal elements do not (e.g., no getElementsByTagName or getElementById).