$.post('ol_st_checker.php',function(d){ //this method is going to check who ever is online
$.each(d.uinfo,function(index,value) {
alert(index+'='+value);
/*$.each(this,function(index, element) {
alert(index+'='+element);
});*/
});
},'json');},
使用 PHP json_encode 发送到浏览器的数据如下所示:
[{"uinfo":{"0":"1","status":"1","1":"1001","user_id":"1001","2":"2013-05-09 22:24:10","last_update":"2013-05-09 22:24:10"}}]
在警报框中,我得到“未定义”,但是当我尝试在发布功能之后显示警报时,我得到了上述输出。