I am currently working on creating a horizontal menu from a json file. However, I am facing issues in retrieving the subchild elements properly. Below is an example of my json file:
var data = [{
"menu":[
{
"MenuId":1,
"MenuName":"Home",
...
}
]
}
];
$(function() {
for(var i = 0, j = data[0].menu.length; i<j; i++) {
var root_menu = data[0].menu[i];
if(root_menu.hasOwnProperty("MenuId")) {
...
}
});
I need assistance in accessing the sub child elements using this json file structure. You can view my code in action at http://jsfiddle.net/JcU4G/9/. The issue lies with the submenu under Home instead of being under Administration as intended, and it should further contain another set of submenus.