I am send an array of php by json_encode to javascript. this is the array after encoding
"[{\"albumid\":\"ASaBFzCtl8\",\"albumname\":\"anni\",\"type\":\"3\",\"access\":\"2\",\"itemcount\":\"2\"},{\"albumid\":\"EmgsZ43ehT\",\"albumname\":\"testalbum\",\"type\":\"1\",\"access\":\"1\",\"itemcount\":\"0\"},{\"albumid\":\"Jf4H4SvFGk\",\"albumname\":\"test2album\",\"type\":\"3\",\"access\":\"1\",\"itemcount\":\"0\"},{\"albumid\":\"k3pacBSmIl\",\"albumname\":\"testalbumpvt\",\"type\":\"3\",\"access\":\"2\",\"itemcount\":\"0\"}]"
on javascript i used jquery.parse(data) but still not get an array.what can i do .i need type value out of it
Assuming you want to decode/parse it on client side use :
JSON.parse(yourString);
jQuery.parseJSON() returns an object, instead of an array
https://api.jquery.com/jQuery.parseJSON/
You can use
var obj = jQuery.parseJSON(...);
var myValue = obj.myValue;
instead of obj['myValue']