I read more here, but I have not found the answer to my problem My problem:
I have (from php via ajax return json string)
str = '[{"id":"159","pavadinimas":"Building B","_id":"200",.................}]';
this is JSON string and I do obj = $.parseJSON(str);
i can take any value in that way like alert(obj[0]._id) I get 200.
But how I can get associative array from json like:
dataArray = [
"id":"159",
"pavadinimas":"Building B",
"_id":"200",
...
]
I want get value 200 like that
val = dataArray['_id'];
dataArray = obj[0];.objis actually an array of objects, so if you want to have a reference to the first object, you just assign it to a variable.