动态从数据库中获取数据填充Select

来源:互联网 发布:scalar 矩阵 编辑:程序博客网 时间:2024/05/05 05:33
//所有版块$(function(){getMissiveType();});function getMissiveType(){     $.ajax({          type:"POST",          dataType: "json",          url:"<%=basePath%>TopicSectionModeratorServlet",          data:"doaction=sectionList",          success:function(data){                var len=data.length;                $('#sectionName-s').attr("length",'0');          for(i=0;i<len;i++){          $("#sectionName-s").append($('<option value='+data[i].key+'>'+data[i].sectionName+'</option>')); } } } ); } ===========<select name="sectionName-s" id="sectionName-s" style="width:50%">                          </select> 
0 0