ajax异步请求的list集合,怎么循环添加到select下拉框中?

在jsp页面中,通过异步请求,返回的list集合,需要循环添加到select下拉框中,如下:

$("#fundCode").change(function(){
  var fundCode = $(this).val();
  var financeAcc = $("#financeAcc2").val();
  $.ajax({
url: "${pageContext.request.contextPath}/admin/convert/convertJson",
type: 'GET',
contentType: 'application/json',
data:{fundCode: fundCode,financeAcc:financeAcc},
success: function(result) {
$("#allowtradeVol").val(result.map["allowtradeVol"]);
$("#shortName").val(result.map["shortName"]);
var fundRiskLevel = result.map["riskLevels"];
var riskLevelx = $("#riskLevel2").val();
$("#fundRiskLevel").value = fundRiskLevel;
if(parseInt(fundRiskLevel) != parseInt(riskLevelx)){
$("#aDiv").show();
}
var convertLists = result.convertList;
$.each(convertLists, function (i, item) {
                        jQuery("#targetFundCode").append("");
               });
},
});

  });

select下拉框标签:


     
    

    

你可能感兴趣的:(it,前端,jsp,ajax,jsp,select下拉框)