数组:
[
{
"mobile": "199202384d4",
"picture": "http://public.smart-show.com/uploads/headimg/1475724316.jpg",
"nickname": "e",
"signature": "",
"sync": "8103244",
"cup": "VISAD0020160409888GK",
"notice_sum": "18",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "7",
"accepted": "1",
"set_remind": "0",
"remark": ""
},
{
"mobile": "199202384fd",
"picture": "http://wxdev1.smart-show.com/wxSmartcup/Public/images/logo2.png",
"nickname": "深海的蓝",
"signature": "",
"sync": "8111969",
"cup": "VISAD0020160518QQ8PN",
"notice_sum": "",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "5",
"accepted": "1",
"set_remind": "0",
"remark": ""
},
{
"mobile": "199202384fe",
"picture": "http://public.smart-show.com/uploads/headimg/1473147342.jpg",
"nickname": "kathleen",
"signature": "",
"sync": "8110590",
"cup": "VISAD0020160518QQ775",
"notice_sum": "",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "3",
"accepted": "1",
"set_remind": "0",
"remark": ""
},
{
"mobile": "199202384fm",
"picture": "http://public.smart-show.com/uploads/headimg/1479178330.png",
"nickname": "zoujq185",
"signature": "只有冒险才能停止平庸!",
"sync": "8112793",
"cup": "VISADL120160518QQ9ZX",
"notice_sum": "23",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "6",
"accepted": "1",
"set_remind": "0",
"remark": ""
},
{
"mobile": "199202384gm",
"picture": "http://wxdev1.smart-show.com/wxSmartcup/Public/images/logo2.png",
"nickname": "en",
"signature": "",
"sync": "8100077",
"cup": "VISAD0020160518QQ7EL",
"notice_sum": "",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "4",
"accepted": "1",
"set_remind": "0",
"remark": "1"
},
{
"mobile": "199202384h8",
"picture": "http://public.smart-show.com/uploads/headimg/1475044033.jpg",
"nickname": "zoujq1569761",
"signature": "只有冒险才能停止平庸!",
"sync": "8110213",
"cup": "",
"notice_sum": "3",
"drink_scale": "0%",
"today_score": "0",
"score_rank": "1",
"accepted": "1",
"set_remind": "0",
"remark": "灰灰"
}
]
此方法不用去截取分割,直接解析循环出来。
function Friend_list(){
$.ajax({
type:'POST',
url: Friend_url,
dataType:'json',
cache:true,
async:true,
success:function (data){
alert(data);
var json = eval(data); //数组
$.each(json, function (index, items) {
//循环获取数据
var mobile = json[index].mobile;
alert(mobile);
});
}
})
}