I am creating a google chrome extension as a project and have run into a hurdle. I am playing around with JSON (hoping to eventually use an API i like). I have an example JSON file, load it, get a variable storing the parsed JSON (which I can see as an object, containing objects and values), however, I don't know how to reference values of the objects within.
var xhr = new XMLHttpRequest();
var resp;
xhr.open("GET", "eg.json", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
resp = JSON.parse(xhr.responseText);
}
}
xhr.send();
The object resp looks like this after send is executed.
I guess this is because I'm new to JavaScript but how would I get the createdDate as a String variable?
Thanks