Reputation: 5210
I'm returning JSON from a php file to a jQuery function, and am getting an object output
with the properties agt_id
and agt_type
. With the webkit dev tools I can print see the object, expand it and see the properties. However, I get undefined when I try:
console.log(output.agt_id);
Here's what I'm seeing in my console with console.log(output)
:
Upvotes: 0
Views: 104
Reputation: 48761
From your screen shot, it looks like your object is in an Array. You can access the object at index 0
of the Array.
console.log(output[0].agt_id);
Upvotes: 5