This is the JSON response getting from webservice URL . JSON:
{
"data":[
{
"outputQty":"2",
"orderSummaries":[],
"categoryName":"test",
"itemId":1,
"recipes":[],
"name":"Laddu"
},
{
"outputQty":"2",
"orderSummaries":[],
"categoryName":"Badam Pista Mundiri",
"itemId":2,
"recipes":[],
"name":"Barpi"
}
]
}
I tried to get JSON values in html page .So that I tried as like below:
$.ajax({
type: "GET",
url: "http://tomcatworkbench.com/Catering2/secured/getAllItems",
dataType: "json",
success: function(response) {
$.each(response, function(idx, obj) {
console.log(obj);
});
}
});
or
$.getJSON("http://tomcatworkbench.com/Catering2/secured/getAllItems", function(data){
$.each(data, function (index, value) {
console.log(value);
});
});
Both way returns object only I can't get string values.Please anyone help me to get out this issue.Thanks in advance.
JSON.stringify(response)