How can I get only "coords" data out of my json object in jquery? And for each object its own coords?
Example of returned json from php as shown in console:
[
{
"id":"7",
"name":"EXAMPLE",
"address":"example adress",
"coords":"96.0,17.0"
},
{
same here etc.
}
]
EDIT: Problem is I can't access json object in a way you all recommended. If I type object[0]
I get "[" if I type object[1]
I get "{" then I get all the other characters in a sequence '"', "i", "d", etc.
I do my console log in a sucessfull ajax call like so:
.done(function(data) {
console.log(data[2]);
});
And my php returns data like so:
echo json_encode($myData);