How to avoid 3 ajax calls?
问题 I wrote some code that filters a province/state select field after you choose a country: var cache = {}; function updateProvinceOptions($select, values, initial) { for(i in values) { $select.append('<option value="'+values[i][0]+'">'+values[i][1]+'</option>'); } $select.val(initial).trigger('change'); } $('<select class="province" />').insertBefore('.province').change(function() { // insert select boxes beside hidden province inputs $(this).siblings('input.province').val($(this).val()); //