JSON Parse: Not parsing with javascript
I get json data with jquery.ajax and dataType is "json" But I have some
problem
That is my json data :
{"stock":{"head":["name","est","date"],"body":[{"row":["TEST","10.58","2013-09-05
13:37:20"]}]},"year":{"head":["name","est","date"],"body":[{"row":["TEST","0","2013-09-05
13:37:35"]}]}}
And that is my javascript code:
var getdata = $.ajax({
type : 'POST',
url : 'testjson.php',
data : data,
dataType : 'json'
});
getdata.done(function(result){
var queryHead = result.stock.head; // That is return with data
var queryBody = result.stock.body; // But that is not return . empty
});
Json data return successfully but not correctly parsing queryHead is work
but queryBody not work
No comments:
Post a Comment