Having problems calling my parent Title ("Main title") in my JSON object. Below is a fiddle with what I currently have. (I can get it to call all child nodes in items, but again need to figure out how to call "title: Main Title")
/
Current JSON Tree
{
"title": "Main Title",
"items": [{
"title": "Sub Title 1 "
},
{
"title": "Sub Title 2",
"items": [{
"title": "Sub Item 1"
},
{
"title": "Sub Item 2"
}]
},
{
"title": "Sub Title 3",
"items": [{
"title": "Sub Item 1"
},
{
"title": "Sub Item 2"
}]
},
{
"title": "Sub Title 4 "
}]
}
Having problems calling my parent Title ("Main title") in my JSON object. Below is a fiddle with what I currently have. (I can get it to call all child nodes in items, but again need to figure out how to call "title: Main Title")
http://jsfiddle/VVAFM/3/
Current JSON Tree
{
"title": "Main Title",
"items": [{
"title": "Sub Title 1 "
},
{
"title": "Sub Title 2",
"items": [{
"title": "Sub Item 1"
},
{
"title": "Sub Item 2"
}]
},
{
"title": "Sub Title 3",
"items": [{
"title": "Sub Item 1"
},
{
"title": "Sub Item 2"
}]
},
{
"title": "Sub Title 4 "
}]
}
Share
Improve this question
edited Oct 17, 2011 at 1:31
user113716
323k64 gold badges453 silver badges441 bronze badges
asked Oct 17, 2011 at 1:20
StarboyStarboy
1,6353 gold badges20 silver badges27 bronze badges
1 Answer
Reset to default 2you can try the new JSON SELECT engine, looks interesting and affords CSS-like select statements over your JSON.
http://jsonselect/#overview
having said that, you can reference it differently like so: http://jsfiddle/dimitar/VVAFM/4/
the title var will refer to main title, always.
good luck :)