I couldn't find a similar question that was detailed enough.
Currently, I have an ajax call that accesses a php page and receives the response:
echo json_encode($cUrl_c->temp_results);
This response looks something like this:
{"key":"value", "key2":"value"}
To work with this output, it is "parsed" using:
var json_response = JSON.parse(xmlhttp.responseText);
I am trying to figure out how to iterate through this response and extract both the key and the value using only Javascript.
- Is the returned output considered valid JSON?
- How can I loop through it without using jQuery, just plain Javascript?