First, check if your data
object is correct:
var data = { "100" : ["submenu 4", "submenu 5", "submenu 6"],
"120" : ["submenu 10", "submenu 11", "submenu 12"],
"125" : ["submenu 19", "submenu 20", "submenu 21"],
"99" : ["submenu 16", "submenu 17", "submenu 18"],
"77" : ["submenu 13", "submenu 14", "submenu 15"],
"70" : ["submenu 1", "submenu 2", "submenu 3"],
"44" : ["submenu 7", "submenu 8", "submenu 9"] };
Then you may use for
loop to iterate elements in the object:
for (var key in data) {
console.log(data[key]);
}
You may also use jQuery $.each()
method:
$.each(data, function(key, value) {
console.log(key);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…