I currently have an object with a few nested arrarys that contain another object and one with just an array. It is formated as such:
{
"x": 1409529600000,
"y": 730,
"pf": [
{
"sd": "this is some text"
},
{
"sd": "here is some stuff"
}
],
"nf": [
{
"sd": "im in the nf array"
},
{
"sd": "me too!"
}
],
"t": [
"here is a tip",
"how about the other tip"
]
}
When a user click a link I'd like to display all this data (minus the x: and y:) to elements on the page. For instance:
from pf:
<p>this is some text</p>
<p>here is some stuff</p>
from nf:
<p>im in the nf array</p>
<p>me too!</p>
from t:
<p>here is a tip</p>
<p>how about the other tip</p>
As you can see its a bit complex. I need to pull out the values from each nested array/object via pf and nf and also pull out the two items from t's array and them wrap them all in their own elements.
I'm just so lost as to where I even begin. I know I can loop through and get the values from the two objects, but it seems like a lot of work to pull everything out, bind it to an element, and display.
EDIT: For easy of a solution I could also have the backend return t: as an object with a key value too.