I'm making a javascript game without using canvas, and I want the screen to reflow only once per cycle, for speed. Is there a way for documentFragment to replace named elements?
EDIT: The javascript guide suggests that replaceChild( ) can be used with documentFragment but the example seems to imply multiple reflows:
function reverse(n) { // Reverses the order of the children of Node n
var f = document.createDocumentFragment( );
while(n.lastChild)
f.appendChild(n.lastChild);
n.appendChild(f); // surely this causes a reflow each time?
}