dropdown menu populate another c# mvc json ajax
问题 Below is my code, I am not sure what i am doing wrong? Ajax json jquery code function FillCity() { var countryid = $("select[name$='.countryid']").val(); //<---- this is dynamic $.ajax({ url: "Controller/FillMyCity", type: "POST", dataType: "json", data: { country: countryid } , success: function (city) { $("select[name$='.cityid']").html(""); // <--- this is dynamic $.each(city, function (i, pp) { $("select[name$='.cityid']").append( $('<option></option>').val(pp.cityid).html(pp.name)); });