I have code (using jQuery) like the following:
var $parent = $('#parentContainer');
$.each([[],[],[],...[]], function(index, innerArray) {
$.each(innerArray, function(innerIndex, innerValue) {
$parent.append($('<div />', { ... }));
});
});
I know this is massively inefficient. I originally tried this with $.map instead of $.each. I would return the DIVs from the inner $.map and each of those arrays would be returned from the outer $.map. Then I would try something like $parent.append(arrayOfArrays). I would then get an uncaught exception some time later.
The code with $.each works but I know there is another way using arrays and appending them all at once. Was I even close with the $.map implementation? Am I missing another way? thanks
By the way, i am a total newb at this so I realize I may be doing this totally wrong.