性能疯子 Blog

倚天照海花无数,流水山高心自知

json 筛选数据 $.grep过滤数据

var data = {
    status: "ok",
    image_size_list: [
    {
        image_size_id: "22",
        ad_class: "N"
    },
    {
        image_size_id: "19",
        ad_class: "C"
    },
    {
        image_size_id: "24",
        ad_class: "N"
    },
    {
        image_size_id: "15",
        ad_class: "C"
    }]
};
data.image_size_list = $.grep(data.image_size_list,function(item){ 
    return item.ad_class=='N';
});

 

posted @ 2016-03-14 13:04  性能疯子  阅读(2712)  评论(0编辑  收藏  举报
QQ联系我