Skip to main content
This has nothing to do with JSON (even if the object was created by parsing JSON)
Source Link
nnnnnn
  • 150.4k
  • 30
  • 210
  • 247

JSON looping in How to loop through an array that is nested within an object?

I'm trying to get the contents of data withinwithin the subject array using jquery.How How can this be done ? I tried using $.each$.each but cudn'tcouldn't get the contents .

  "student": {
    "name": "sdfdsf",
    "age": 3,
    "subject": [
        {
            "science": "dfsdfdfd",
            "book": "sdfds"
        },
        {
            "math": "vbcb",
            "book": "sdfds"
        }
    ]
}

JSON looping in array

I'm trying to get the contents of data within the subject array using jquery.How can this be done ? I tried using $.each but cudn't get the contents

  "student": {
    "name": "sdfdsf",
    "age": 3,
    "subject": [
        {
            "science": "dfsdfdfd",
            "book": "sdfds"
        },
        {
            "math": "vbcb",
            "book": "sdfds"
        }
]
}

How to loop through an array that is nested within an object?

I'm trying to get the contents of data within the subject array using jquery. How can this be done ? I tried using $.each but couldn't get the contents .

  "student": {
    "name": "sdfdsf",
    "age": 3,
    "subject": [
        {
            "science": "dfsdfdfd",
            "book": "sdfds"
        },
        {
            "math": "vbcb",
            "book": "sdfds"
        }
    ]
}
Source Link
user1184100
  • 6.9k
  • 30
  • 84
  • 122

JSON looping in array

I'm trying to get the contents of data within the subject array using jquery.How can this be done ? I tried using $.each but cudn't get the contents

  "student": {
    "name": "sdfdsf",
    "age": 3,
    "subject": [
        {
            "science": "dfsdfdfd",
            "book": "sdfds"
        },
        {
            "math": "vbcb",
            "book": "sdfds"
        }
]
}