This is the JSON array:
{
"head": {
"status": "200",
"data": {}
},
"body": {
"content": {
"deliveryMessage": {
"MT9J2AE/A": {
"label": "Delivers:",
"quote": "Sep 23-Sep 24",
"address": {
"city": "Ajman"
},
"showDeliveryOptionsLink": false,
"messageType": "Delivery",
"basePartNumber": "MT9J2",
"commitCodeId": "8886",
"idl": false,
"defaultLocationEnabled": false
},
"MT9M2AE/A": {
"label": "Delivers:",
"quote": "25 Sep - 2 Oct",
"address": {
"city": "Ajman"
},
"showDeliveryOptionsLink": false,
"messageType": "Delivery",
"basePartNumber": "MT9M2",
"commitCodeId": "199",
"idl": false,
"defaultLocationEnabled": false
},
"geoLocated": false,
"deliveryLocationLink": {
"text": "Ajman",
"dataVar": {},
"newTab": false
},
"dudeCookieSet": true,
"MT9F2AE/A": {
"label": "Delivers:",
"quote": "25 Sep - 2 Oct",
"address": {
"city": "Ajman"
},
"showDeliveryOptionsLink": false,
"messageType": "Delivery",
"basePartNumber": "MT9F2",
"commitCodeId": "199",
"idl": false,
"defaultLocationEnabled": false
},
"deliveryLocationLabel": "Your delivery location:",
"WarmAPUWithDude": true,
"locationCookieValueFoundForThisCountry": true,
"dudeLocated": true,
"accessibilityDeliveryOptions": "delivery options",
"little": true
}
}
}
}
I want to access the three "quote" attribute's values.
So far this is what I have achieved:
parsedata = JSON.parse(jsondata);
parsedata[0].body.content.deliveryMessage["MT9J2AE/A"].quote
This will give the "quote" value of "MT9J2AE/A". But if that attribute changes, how do I get the quotes?
I mean I am asking something like this:
parsedata[0].body.content.deliveryMessage[0].quote
But that is not working :(