Test.Customers = [{
"CustomerPortals":[{
"filename":"chrysanthemum.jpg",
"ext":"jpg",
},{
"name":"Lighthouse.jpg",
"filename":"lighthouse.jpg",
"ext":"jpg",
},{
"filename":"lighthouse.jpg",
"ext":"jpg",
}
}]
I have this json stored in my DOM. Sometimes there will be 0 items and sometimes multiple items in CustomerPortals array. But I want to parse through them and show the filename. Does jquery make it any simpler to do that?
EDIT
EDIT
var Test = {};
Test.Customers = [{"CustomerItems":
"Portals":
{"id":"1","customer":"1950","resident":"yes",
"CustomPortals":
[
{"id":"11","test":"4251","portalname":"tye.jpg"},
{"id":"12","test":"4251","portalname":"Lsdf.jpg"},
{"id":"13","test":"4251","portalname":"nick.jpg"}
]
}
},
{"CustomerItems":
"Portals":
{"id":"2","customer":"1952","resident":"yes",
"CustomPortals":
[
{"id":"14","test":"4252","portalname":"Chrysanthemum2.jpg"},
{"id":"15","test":"4255","portalname":"navagin.jpg"},
{"id":"16","test":"4257","portalname":"jasoria.jpg"}
]
}
},
{"CustomerItems":
"Portals":
{"id":"3","customer":"1950","resident":"yes",
"CustomPortals":
[
{"id":"17","test":"4231","portalname":"Zsryanmum1.jpg"},
{"id":"18","test":"4651","portalname":"Ltd1.jpg"},
{"id":"19","test":"4281","portalname":"ser1.jpg"}
]
}
}
]
I want to get the portalname for all the customers. the above was not showing sub arrays thanks