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
rgarimellaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
leakim971Connect With a Mentor PluritechnicianCommented:
Use : j["06_01"]
Test page : http://jsfiddle.net/tb2MF/2/
0
 
leakim971PluritechnicianCommented:
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

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

All I need is the value stored in 06_01
0
 
rgarimellaAuthor Commented:
0
All Courses

From novice to tech pro — start learning today.