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 8608305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:34:40+00:00 2026-06-12T03:34:40+00:00

I am able to parse JSON that returns simple data, with JSON.parse but I

  • 0

I am able to parse JSON that returns simple data, with JSON.parse but I am having trouble with data that returns objects, dates, strings, etc..

var theData=JSON.parse(theData);

Something like this JSON.parse returns [Object] object back with no data at all (I can see the data is being successfully returned because it returns all the data as a string if I have JSON.parse turned off).

{
"AppName": "TheName",
"AppUrl": "https:\/\/app\/icons\/unknown.png",
"aGUID": "45c055d2-2edc-d4444"."DateCreated": "8\/23\/2012 11:04AM", {
    "ID": "yser123",
    Name ":" User "}
    }

What is the best way to go about parsing this data in javascript(I am not able to use jquery)?

Note: I had wrote the JSON assume its valid

Here is the code I am using to retreive the data..

var xhReq = new XMLHttpRequest();
xhReq.open("POST", "ClientService.svc/REST/GetDetail", false);
xhReq.send(null);
var serverResponse = xhReq.responseText;
alert(serverResponse);
return serverResponse;
  • 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-12T03:34:41+00:00Added an answer on June 12, 2026 at 3:34 am

    First and foremost, don’t use synchronous XHR. Rewrite your JavaScript to be asynchronous.

    function getDetail(cb) {
        var xhReq = new XMLHttpRequest();
        xhReq.open("POST", "ClientService.svc/REST/GetDetail", true);
        xhReq.onreadystatechange = function() {
            if (xhReq.readyState == 4) cb(xhReq.responseText);
        }
        xhReq.send(null);
    }
    
    // to call:
    
    getDetail(function(data) {
        JSON.parse(data);
    }
    

    Second, your problem is not that JSON is being parsed incorrectly. It’s your debugging call to alert. When you pass the serverResponse object, alert coerces the object into a string by calling the object’s toString method, which simply returns '[object Object]'.

    Try console.log. Objects can be inspected in the console.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following JSON structure that defines a table and it's data. var
i can parse data and see the output also but i am not able
I'm completely noob with json. I need to parse a json that returns a
I am able to parse the HTML but I want to extract the warning
I want to be able to parse file paths like this one: /var/www/index.(htm|html|php|shtml) into
I want to be able to parse a string to an object that I
I have the following JSON: {COLUMNS:[ID,FIRSTNAME],DATA:[[1,Steve],[2,Jim],[3,Bill],[4,Tony]]} I am trying to write some jQuery that
I have a text file that is formatted like JSON, but in a print/view
I am trying to dynamically map JSON information into different objects. But I can't
So I am trying to parse some JSON that is returned to me by

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.