im filtering an array, and storing the results in another array.
i then want to loop through the array using .each(), doing various things to each and then displaying in html etc.
im stuck on how to pass the array info into the each() function however.
so far I have:
$("select[name='album']").change(function() {
var thisAlbum = $(this).children(":selected").attr("id");
var result = images_gallery.filter(function(x) {
return x.album == thisAlbum;
});
$('#librarian-page-container-gallery').html(' ');
Shadowbox.setup("a.gallery", {
gallery: "gallery",
});
showImages2(result);
});
function showImages2(){
$.each(result, function(i, image_gallery2){
what am i doing wrong?
You should change function
showImages2(){to functionshowImages2(result){.You are missing the argument for the
showImage2function.