Solved

retrieve json data

Posted on 2014-02-08
4
376 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
[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: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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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