js 遍历 后台json返回的map

来源:互联网 发布:苹果手机摄影软件 编辑:程序博客网 时间:2024/05/16 13:50


js

success: function (map) {

                    html+='<option value=' + '>'+ '--请选择--' +'</option>';
                    for(var key in map){
                        if (!map.hasOwnProperty(key)) {
                            continue
                        }
                        var f_unit_num  = key;
                        html+='<option value='+ f_unit_num +'>'+ map[key] +'</option>';
                    }
                    valu.html(html);

                },


java


List<String> unitNums = ProjectHousePrices.dao
            if(unitNums.size()==0){
                map.put("", "--单元号为空--");
            }
            for (String num : unitNums)
            {
                map.put(num, num);
            }
        }
        renderJson(map);

0 0
原创粉丝点击