jQuery遍历JSON

jQuery遍历JSON

作者:LAMP小白  点击:1665  发布日期:2012-09-20 01:01:00  返回列表
今天在这里卡了一会 主要是不能用return要用echo
PHP:
$a = array(
'ha'=>1,
'ha2'=>2,
3,4,5,6);
echo json_encode($a);
JS:
$.post('1.php', {ha:'11'}, function(data){
//alert(data);
$('#haha').empty().html(data['ha']);
}, 'json')

上一篇:选择窗JS代码 下一篇:快递查询API
0