Ok. After about an hour of trying to think of different ways to do this, my noobness is prevailing (and this question will prove it).
I have a JSON object that looks like so:
{
newEvent: {
Event: {
name: "Something",
timestamp: {
month: "07",
day: "27",
year: "2013",
hour: "07",
min: "42",
meridian: "pm"
},
duration: "2",
durationMeasure: "min"
}
},
msg: "Event Added"
}
It gets returned in a jquery ajax complete callback function thingy, so its sitting inside a param called data.
Using Chrome, I can console.log() data,data.newEvent,data.msg,data['newEvent'],and data['msg']. The only one that returns anything other than undefined, is data (which prints what's above)
My question: How in the WORLD do I get to anything in data?! Any insight for a JavaScript noob would be greatly appreciated! =)
EDIT: A code snippet:
function eventAdditionalFinish(data,textStatus) {
console.log("data: ",data,"\n");
console.log("data['newEvent']: ",data['newEvent'],"\n");
console.log("data['msg']: ",data['msg'],"\n");
console.log("data.newEvent: ",data.newEvent,"\n");
console.log("data.msg: ",data.msg,"\n");
}
Output from Chrome's console:
data: {"newEvent":{"Event":{"name":"Something","timestamp":{"month":"07","day":"27","year":"2013","hour":"07","min":"42","meridian":"pm"},"duration":"2","durationMeasure":"min"}},"msg":"Event Added"}
data['newEvent']: undefined
data['msg']: undefined
data.newEvent: undefined
data.msg: undefined
dataType:json