I am using JQuery's getJSON() to request JSON from my web server. Then, I want to parse the response. The format of the JSON response is as follows:
{
"responseStatus": "200",
"responseData": {
"resultText": "Hello"
},
"originalText": "hi"
}
And my JQuery code:
$.getJSON(url, function (json) {
$.each(json, function (i, result) {
alert(result.resultText);
});
});
The problem I am facing is that I receive three alert windows in a row: "Undefined", "Hello", and "Undefined". I am only looking to get and show the single value for resultText. Why am I also receiving the "Undefined"?
Thanks!