I am trying to parse the following (validated) json string using javascript. I have tried the following code, but it doesn't seem to be working.
code:
var obj = JSON.parse(data);
alert(obj.Design_Lump_Sum[1]);
alert(obj[1]);
json object:
{
"Capex_Lump_Sum":
{
"Pipework and associated fittings": "86086.9",
"Cable Trays": "10410.4",
"New Mechanical Services Switchboard": "23209.28",
"Decommissioning removal of Redundant Mechanical Plant": "28342.32",
"Electrical system labelling": "473.2",
"Handover Documentation": "2957.5",
"Mechanical system labelling": "946.4",
"Service and Maintenance during DL": "16196.46",
"Painting": "9227.4",
"Submain Cabling": "27471.63",
"Construction Works": "17464.63",
"Decommissioning removal of redundant mech electrical plant": "5323.5",
"Framed AsBuilt Drawings": "591.5",
"Pre Post Air Balancing": "10883.6",
"Innotech DDC controls and associated cabling": "23831.54",
"LSL": "2663.0",
"Testing and Commissioning": "4519.06",
"Temporary air conditioning": "87243.88",
"Supply and installation of Air Handling Units Condensor Units": "194521.85",
"133.0": "105.0",
"Ductwork Dampers Louvres": "96018.19",
"Building certifier": "7038.85",
"Facility Manager Training": "1183.0",
"AMS": "5915.0",
"Pre Post Site Acoustic Testing": "5867.68",
"Penetrations and Fire Sealing": "3903.9"
},
"Design_Lump_Sum":
{
"Electrical Services Design": "6915.82",
"Mechanical Services Design": "13569.01"
},
"Opex_Lump_Sum":
{"Testing and Commissioning": "1200.0"}
}