I am pulling some information out of some JSON, which works just fine. It ends up generating a series of divs using the following:
var i = 0;
$.getJSON(url, function(json) {
$.each(json.projects, function(index, data) {
//some stuff to find and filter my data
$('<div/>', {
id: i,
"class" : "span4",
html: '<h3>' + title + '</h3>' + description
}).appendTo('#projectList');
i = i + 1;
});
});
I need to insert a new fluid row for every 3 divs in #projectList. I figured .slice() would be my best option (feel free to correct me if I'm mistaken). So I make the call to generate my series of divs, and then I attempt to slice (taken and modified from Wrap every 3 divs in a div).
var divs = $('#projectList > div');
for (var i = 0; i < divs.length; i+=3) {
divs.slice(i, i+3).wrapAll('<div class="row-fluid"></div>');
}
When I look at my results, I don't see the inserted rows. Firebug doesn't see anything syntatically wrong, and the return on an alert for divs.length is 0.
' + title + '
' + description).appendTo('#projectList');` really' + title + '
' + description '+