<select id="CommunityList" class="form-control" > <option>請選擇社團</option> </select></td>
$.ajax({ url: ‘/Account/Personal_GetCommunityListByUserNeima‘, type: "GET", dataType: "JSON", data: { CountryCode: countryCode, Mobile: mobile }, success: function (CommunityList) { $("#CommunityList").html(""); $.each(CommunityList, function (i, Community) { $("#CommunityList").append( $(‘<option></option>‘).val(Community.CommunityID).html(Community.CommunityName)); if (i >= 1) { $("#Community").show(); $("#CommunityList").show(""); } }); } });
原文地址:https://www.cnblogs.com/chuangjie1988/p/8548494.html
时间: 2024-11-10 11:42:07