Solved

retrieve json data

Posted on 2014-02-08
4
355 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
Comment Utility
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
Comment Utility
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
Comment Utility
Close the question, reopen a new one. Thanks.
0
 
LVL 9

Author Comment

by:sevensnake77
Comment Utility
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now