我正在使用它从 ajax jquery 在 json 格式中获取信息,但它给了我这样的错误 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);
});
});
这是我的 josn 字符串
[{"id":"1","ref":"RH-R-1","name":"","description_demo":"this is desc test"}]
谢谢大家......这是我的json如何发展
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);