Okay, so i'm aware there are similar questions on this on the site BUT all I have seen have people with an array INSIDE an array. So I'm just looking for a bit of help on a simple one that I just can't seem to grasp.
The JSON is being generated from a PHP file and looks something like this when retrieved via AJAX: {'name' : 'Derick', 'email' : '[email protected]'}.
How can I loop through this response, using Javascript, to retrieve the value for, say, the 'name' key in the array?
code snippet:
response = {'name' : 'Derick', 'email' : '[email protected]'};
response.nameorresponse['name']should do it