Currently, I am utilizing ajax to fetch a json string from the server and then employing eval to convert it into an object. However, when I loop through the data obtained from the json, only the key is displayed. Is there a way to extract the value associated with each key? Below is my existing code snippet:
var jsonObject = eval('(' + xmlhttp.responseText + ')');
for (i in jsonObject){
alert(i);
}
As per the above code, only the keys are alerted. How can I access the values corresponding to these keys?