nilesh nilesh - 1 year ago 102
PHP Question

Read JSON response object in php/js

I want to display particular values of response object in HTML. But I am not able to display those values.


I can convert response to string. I want to show Status and StatusCode to user. How can I get these values?


url: 'api url',
type: 'GET',
contentType: 'application/json; charset=utf-8',
dataType: 'jsonp',
success: function(data) {
var JSONString =JSON.stringify(data);

//var json = $jq.parseJSON(data);
$jq.each(data.ShipmentData, function(index, value){
// alert(JSON.stringify(value));

error: function() {

Answer Source

No need to stringify your data!

You just have to access the object properties. Like this:

$jq.each(data.ShipmentData, function(){

where this is the current object of the each iteration

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download