Skip to content

Instantly share code, notes, and snippets.

@jcuffe
Created January 7, 2019 19:49
Show Gist options
  • Save jcuffe/b42cb2846b07a65b207ed2985863ac24 to your computer and use it in GitHub Desktop.
Save jcuffe/b42cb2846b07a65b207ed2985863ac24 to your computer and use it in GitHub Desktop.
$(document).ready(function(e){
//commID = getCommunity();
commID = "ACH";
var campusArray = ilHeadshots.filter(function(item){
return item.community == commID;
});
console.log(ilHeadshots);
console.log("");
console.log(campusArray);
// Start out with a forEach on the outer array
campusArray.forEach(function(item) {
// Convert the `images` dictionary to an array with Object.entries()
Object.entries(item["images"]).forEach(([key, value]) => {
$('#ff_imgHeadShot').append(
$('<option></option>').val(value).html(value)
);
});
});
//$('select#ff_imgHeadShot option').trigger("chosen:updated");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment