I have a sample JSON data that looks like this:
{
"findItemsByKeywordsResponse":[
{
"ack":[
"Success"
],
"version":[
"1.13.0"
],
"timestamp":[
"2015-02-10T18:12:21.785Z"
],
"searchResult":[
{
"@count":"100",
"item":[
{
"itemId":[
"371250980931"
],
"title":[ etc etc...
I am attempting to parse it in the following manner:
function _cb_findItemsByKeywords(root) {
var items = root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
etc etc...
}
Unfortunately, I encounter the following error:
TypeError: root.findItemsByKeywordsResponse is undefined
var items = root.findItemsByKeywordsResponse[0].searchResult[0].item || [];
----^
Any suggestions on what mistake I might be making?