I'm relatively new to working with JSON, so the issue I'm facing may be simple, but I haven't been able to find a similar problem on stackoverflow. Here's my question:
My goal is to access a nested JSON object like: pizza.topping.rating. However, when I try to access it, it returns undefined even though I can see the rating object. Interestingly, accessing pizza.rating works fine. Could this be related to the multiple instances of "rating" within the pizza object?
Is there a workaround for this specific scenario?
Thank you in advance for any assistance provided.
P.S.: The structure of the object is as follows:
jQuery16207381055671721697_1329849155553(
{"pizza":
{"Hjid":2030,
"creator":"n0rritt",
"pizzaTitle":"Fungi",
"rating":
[
{"Hjid":2032,
"creator":"n0rritt",
"ratingText":"it's delicious"}
],
"topping":
[
{"Hjid":2031,
"creator":"n0rritt",
"toppingText":"with fish",
"rating":
[
{"Hjid":2042,
"creator":"n0rritt",
"creationTime":"2012-02-21T19:08:22.896",
"ratingText":"good for your health"}
]
}
]
}
}
)