Reputation: 51
I honestly think I'm having a brain hiccup or something, but I've been caught on this for a solid half hour. I'm posting using jQuery's .post(), and the response is a JSON object such as this:
{
"meta": {
"status": 201,
"msg": "Created"
},
"response": {
"id": 1111111
}
}
However, I don't know why I can't target anything in this JSON. Here's what I'm dealing with:
$.post('post.php',function(d){
alert(d) // Returns the JSON string above
alert(d.meta.status) // Returns 'undefined' (expecting 201)
})
Help! Thanks :)
Upvotes: 0
Views: 79