Link to home
Start Free TrialLog in
Avatar of rgarimella
rgarimella

asked on

Reading a JSON (Serialize) Data

Hi Folks,

I have the following json data

{"CTS":"0,51,52","lastTopic":53,"questions_answered":["3","2","4","1","9"],"scoreArray":[],"06_01":20}

Open in new window


How do I read scoreArray value of 20 which is the last value in Javascript

Thanks

RG
Avatar of leakim971
leakim971
Flag of Guadeloupe image

for example : http://jsfiddle.net/tb2MF/
var j = {
    "CTS": "0,51,52",
    "lastTopic": 53,
    "questions_answered": [
        "3",
        "2",
        "4",
        "1",
        "9"
    ],
    "scoreArray": [4,5,6,8,1,2,9,3,0,4,5,6,8,1,2,9,3,0],
    "06_01": 20
}

for(v=0;v<j.scoreArray.length;v++) {
  alert(j.scoreArray[v]);
}

Open in new window

Avatar of rgarimella
rgarimella

ASKER

Thanks, but this code does not read the value of "06_01": 20

All I need is the value stored in 06_01
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial