i am using this to get informations from ajax jquery in json formate but it give me error like this 0 =[object object]
$.getJSON("ajax_files/getSingleRow.php?id="+id+"&type="+type, function(json){
$.each(json, function(key, val) {
//$("#"+key).val(val);
alert(key+'='+val);
});
});
here is my josn string
[{"id":"1","ref":"RH-R-1","name":"","description_demo":"this is desc test"}]
Thanks all...here is how my json develops
while($rw = $oAppl->row($res))
{
$return[]=array('id'=>$rw['id'],
'ref'=>$rw['ref'],
'name'=>$rw['name'],
'description_demo'=>$rw['description_demo']);
}
header('Content-type: application/json');
echo json_encode($return);
alert(json)to see the data you received??alert()function is awful for debugging and displaying information, as they've just discovered, because it doesn't show the properties of objects.