Solved

retrieve json data

Posted on 2014-02-08
4
379 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:Seven price
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Seven price
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:Seven price
ID: 39844920
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

630 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