json - Jquery receiving return value from $.post as array -
I have read many threads about it and still it is not working, but actually got passed i jquery My database will return a record: $ row ['parcel_id]' '
and $ row [' address]
, just 2 columns, Which is then json_encode ()
.
json is encoded using
However I can not So my question is, what is the return value is? Is this an array? Objection? How can I use each element? data in my query return. I have something like this:
var arr = $ .parseJSON (data); Warning (data); This return:
{"parcel_id": "1", "address": "5000 Charlotte Avenue"}
data.parcel_id or data ['parcel_id']
Since you have arr
, you have to:
arr.parcel_id
or
arr [parcel_id] ']
Comments
Post a Comment