I'm trying to use a variable (data.$choice) instead of (data.client_kits_bios), to iterate through the array.
I guessing can't place a string variable right there? What would the option be to replace it? Or is that not possible?
Thanks!
$( document ).ready(function() {
var $choice = 'client_kits_bios';
console.log($choice);
$.ajax({
url: 'data_marketingLibrary.json',
dataType: 'json',
type: 'get',
cache: false,
success: function(data) {
$(data.$choice).each(function(index, value) {
console.log(value.name);
console.log(index);
});
}
});
});