Unfortunately, since these objects are not actually attached to any hierarchy, the call insertAfterdoes not really mean anything. What you need to do is put them in the containing div, maybe something like this:
var entry_set = $('<div>');
for([])
{
$('<div></div>')
.data([])
.addClass([])
.on([])
.appendTo(entry_set);
}
entry_set.appendTo('.entries');
I have not tested this, but I think it should work.
source
share