I would like to parse some JSON data but am not sure what I am doing wrong.
The code I am using is as follows:
$.getJSON('bd/getuserDetails',userID,function(data) {
$.each(data.UserDTO,function(index, value){
alert(value);
});
});
In my Java action class I am populating UserDTO with relevant details like
name, age, etc.
The above code is able to parse my object, but my intentions are to access the value based on the name like alert(value.name); //user name. Currently it's parsing and displaying the values but I am not able to determine the name for the given value.
How can I access the collection with the name for the corresponding value?