Hello. I have a string big_html
and I want to add it to some div. I have observed a performance difference in the following:
$('#some-div').append( big_html );
// takes about 100 ms
//create it first
var append_objs = $(big_html);
$('#some-div').append( append_objs );
//takes about 150 ms
Does anyone know why this happens ? Thank you for your time.
EDIT: I am trying to get the stuff I am adding to the page. I have also tried
var added = $(big_html).appendTo( '#some-div' );
//150 ms
Is there an efficient way to do this ?