javascript - AJAX Fill Dropdown based on Dropdown Parent -
im wondering what's wrong script, it's not getting values of cities based on country, please see code: controller: hotel private actionresult fillcity(int countryid) { var cities = db.cities.where(c => c.country_id == countryid); return json(cities, jsonrequestbehavior.allowget); } jquery/ajax <script> function fillcity() { var countryid = $('#country').val(); $.ajax({ url: '@url.action("fillcity")', type: "get", datatype: "json", data: { countryid: countryid }, success: function (cities) { $("#city").html(""); $.each(cities, function (i, city) { $("#city").append( $('<option></option>').val(city.id).html(city.name)); }); } }); } </script> view <div...