Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:45:45+00:00 2026-06-05T06:45:45+00:00

Here is my JSON which I need to parse: {opcode:groupdetails, status:success, data:[{Group ID:5,Group Name:data

  • 0

Here is my JSON which I need to parse:

{"opcode":"groupdetails",
 "status":"success",
 "data":[{"Group ID":5,"Group Name":"data structure","Group Subject":"computer science","Role Type":"Teacher"},{"Group ID":4,"Group Name":"information technology","Group Subject":"computer science","Role Type":"Student"},{"Group ID":6,"Group Name":"data mining","Group Subject":"computer science","Role Type":"Parent"},{"Group ID":7,"Group Name":"dccn","Group Subject":"computer science","Role Type":"Teacher"}]}

I have tried and implemented the solution provided here and this is the implementation of JS that was defined in there solution, which parses only the JSON array

for (var i = 0; i < data.data.length; i++) 
 {
    var object = data.data[i];
     for (property in object) 
     {
        var value = object[property];
        alert(property + "=" + value);
     }
 }

the outer JSON data is returned from server and yes I have tried parsing using the following code and there is no result:

for (var i = 0; i < data.length; i++) 
{
 var object = data[i];
 for (property in object) 
 {
    var value = object[property];
    alert(property + "=" + value);
 }
}

How can I parse the entire JSON using a single method instead of parsing the JSON array separately?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:45:47+00:00Added an answer on June 5, 2026 at 6:45 am

    Try this:

    for(var key in data) {
        if(typeof data[key] === "object") {
            for(var i = 0; i < data[key].length; i++) {
                for(var property in data[key][i]) {
                     alert(property + " = " + data[key][i][property]);
                }
            }
        } else if(typeof data[key] === "string") {
            alert(key + " = " + data[key]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse a JSON response regarding events in an agenda, of which
I have a method which requests external webservices and returns json here: public string
We are trying to communicate with a remote API which requires JSON formatted data.
I need to call a web service to receive a JSON object which I'll
I need to generate json from the serverside, which I know how to do.
All, I have the following JSON Data. I need help writing a function in
I've got a jQuery AJAX code, which recieves JSON-type data from php file. Wihout
I have the following javascript which I need to make dynamic. data.addRows(2); data.setValue(0, 0,
I'm writing an Android application which will occasionally need to download a json string
I've a CXF RESTful service which returns both XML and Json format. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.