Hello, I would like to loop trough nested objects. here is my code :
var defaults = {
toolTips: {
printVersion: {
toolTip1: {
link_s: '#mm_tooltip1_link',
tooltip_s: '#mm_tooltip1'
},
toolTip2: {
link_s: '#mm_tooltip2_link',
tooltip_s: '#mm_tooltip2'
},
toolTip3: {
link_s: '#mm_tooltip3_link',
tooltip_s: '#mm_tooltip3'
}
}
}
};
var settings;
var $archives_dialog;
$.madmagz = function(options) {
settings = $.extend({}, defaults, options);
init();
};
function init(){
initToolTips();
}
function initToolTips() {
$(settings.toolTips).each ( function (i, tooltip_group) {
$(tooltip_group).each (function (i, tooltip) {
// do stuff
});
});
}
In every each loop, I get the same object. How can I go down in every nested objects ?