Solved

retrieve json data

Posted on 2014-02-08
4
361 Views
Last Modified: 2014-02-08
My data is coming back as example below. I just want to retrieve data that says
(( The field Status must be a string or array type with a maximum length of '14'.))


{"update.Status":{"_errors":[{"<Exception>k__BackingField":null,"<ErrorMessage>k__BackingField":"The field Status must be a string or array type with a maximum length of '14'."}],"<Value>k__BackingField":null}}

Open in new window


.error(function () {
                var loc = jqxhr.getResponseHeader('Location');
                var a = $({ text: loc });
                $('#message').html(Status.html);
            });

Open in new window

0
Comment
Question by:sevensnake77
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39844889
Check the picture below :
http://jsonviewer.stack.hu/
Test page : http://jsfiddle.net/Bb38d/

var json = {
  "update.Status": {
    "_errors": [
      {
        "<Exception>k__BackingField": null,
        "<ErrorMessage>k__BackingField": "The field Status must be a string or array type with a maximum length of '14'."
      }
    ],
    "<Value>k__BackingField": null
  }
};

var text = json["update.Status"]._errors[0]["<ErrorMessage>k__BackingField"];

// CHECKING
alert(text);

Open in new window

0
 
LVL 9

Author Comment

by:sevensnake77
ID: 39844899
Actually I made a fix and now the data is like this.

Sort by key
0	"The field Status must b...maximum length of '14'."

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 39844902
Close the question, reopen a new one. Thanks.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 39844920
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question