jquery 讀取json讀不出來

php端輸出:

{"1":[{"userid":"1","username":"mary"}],"3":[{"userid":"3","username":"hello"}]}


頁面:

$.ajax({
        type:"POST",
        url:"/findsing.php",
        data:"newtime="+newtime,
        success: function(data, textStatus){
                    alert(data);//這裏沒有問題可以彈出上面的信息
                    $.each(data, function(kewy,valw) {

                     可是我想把username調出來,試了以下方法都不行
                        alert(kewy+"**"+data[kewy].username);
                        //alert(valw.username);
                        //alert(kewy+"^^"+valw.username);
                          // alert(valw.username);
                            //alert(data[kewy]);
                    })
                }
    });   


我想把username輸出出來可是試過上面的都不行????

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章