title: Ajax add option to select for each json array
body: <p>I need to populate a select item with the values that I get from an ajax call, I return such values as a json array. With the code below, the select is created without any options.</p>
  
  <pre><code>$.ajax({
    type: "GET",
    url: "/wp-content/gta/search_airport.php",
    data: {city: t_city}
  }).done(function(resp){
    var sel = $('&lt;select name="airport" id="slt"&gt;').appendTo('#pick_type');
    $.each(resp, function() {
  $.each(this, function(k, v) {
  $('&lt;option&gt;').val(k).text(v).appendTo('#slt');
     });
    });
  });
  </code></pre>
  
  <p>Example json array</p>
  
  <pre><code>[{"name":"Los Angeles","code":"LAX"},{"name":"San Francisco","code":"SFO"}]
  </code></pre>
  
  <p>I would like the options to be something like <code>&lt;option value="LAX"&gt;Los Angeles&lt;/option&gt;</code></p>