I better move the node, I sent it from the server or insert it?
I am using jQuery (1.4), but would like to know both jQuery and JS in general. In this case, the node is small with one child. But what if it was a big list?
what
large list 1 = 200 nodes
long list 2 = 1000 nodes
Example:
Insert:
<div id="wrap">
<div id="box></div>
</div>
$('#box').before($('<ul id="list"><li>...</ul>'));
vs
Manipulation:
<div id="wrap">
<div id="box></div>
</div>
<ul id="list"><li>...</ul>
$('#list').insertBefore($('#box'));
source
share