I have this javascript object,
console.log(object.response);
console.log(object.response.imageUID);
gives me:
{"id":138,"imageUID":"image-aa0dce87-0261-44ef-8377-d897a996f4b1"}
undefined
What went wrong?
It seemed the issue was that your response was a stringified object - so it probably looked like:
var response = '{"id":138,"imageUID":"image-aa0dce87-0261-44ef-8377-d897a996f4b1"}';
In order to access the properties you must first parse that string into an object:
var responseObj = JSON.parse(response);
Now you can access the properties:
var imageUID = responseObj.imageUID;
responsea string or another object?console.log(JSON.parse(object.response).imageUID);