Hello
I have this php code
$ids = array(1,2,3);
$names = array("cat","elephant","cow");
$originalSettings = array ('ids'=>$ids,'names'=>$names);
$jsonSettings = json_encode($originalSettings);
echo $jsonSettings;
and this is the jQuery code
$.post("ajax.php", {},
function(data){
data.ids.each(function(i) {
alert(data.names[i]);
}
//is it possible to receive the arrays and navigate them
}, "json");
How can I pass arrays using json and receive them in javascript?
Thanks