I have below JSON text format
[
{"fields": {"Num": 34, "Univ": "TUni"}, "pk": 1, "model": "app.unbased"},
{"fields": {"Num": 10, "Univ": "VTU"}, "pk": 1, "model": "app.unbased"}
]
I tried to access fields value of Num of the first item using Jquery, but couldn't get it. I have already gone through other questions related to JSON but no use as this form is unusual.
I tried below in the success function
success: function (json) {
$('#PieStats').html(json.message);
var data_json = $.parseJSON(json.message);
alert(typeof(json.message)); // Output : string
alert(data_json[0][0]); // Output : Undefined
alert(typeof (json) + ' ' + typeof (data_json)); // Output : object object
$('.ajaxProgress').hide();
}
I have also tried using data_json['fields'][0][0] and other possible ways - doesn't work
What am I missing ?