SO jQuery Fiddle
Test Fiddle mainly for SO Questions jQuery 1.4.3, UI 1.8.5
by metalhaze
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/ui-lightness/jquery-ui.css">
JavaScript
var data = {
"actions" : [
{
"action": "TOP1",
"subaction": [
{
"name": "A"
},
{
"name": "B"
},
{
"name": "C"
}
]
},
{
"action": "TOP2",
"subaction": [
{
"name": "X"
},
{
"name": "Y"
}
]
}]
};
$.each(data.actions, function(entryIndex, entry) {
var html = '<li class="top-level">' + this.action + '</li>';
$.each(this.subaction, function() {
alert(this.name);
});
});