asp.net中怎么将json格局的数据添加下拉菜单


<script type="text/javascript">

var optionss =[{"value" : "130200","text" : "唐山"},
       {"value" : "130300","text" : "秦皇岛"}, 
       {"value" : "130400","text" : "邯郸"}, 
       {"value" : "130500","text" : "邢台"},
       {"value" : "130600","text" : "保定"}, 
       {"value" : "130700","text" : "张家口"},
       {"value" : "130800","text" : "承德"}, 
       {"value" : "130900","text" : "沧州"}, 
       {"value" : "131000","text" : "廊坊"}, 
       {"value" : "131100","text" : "衡水"}];
    $(function(){
      $.each(optionss,function(i,n){
      $("#Dboptions")[0].options.add(new Option(n.text,n.value));
      });
    });

    </script>

image

posted @ 2011-05-18 21:58  牛奶咖啡  阅读(191)  评论(0编辑  收藏  举报