title: Get Airport code using jquery
body: <p>When I use jquery for airport code its working fine with country, But i want airport code by city name. But this is not working. I am doing this by json.
  Here is my code, Please tell me, What's wrong in my code.</p>
  
  <pre><code>  &lt;script&gt;
    function buildQuery(term) {
      return "select * from json where url = 'http://airportcode.riobard.com/search?  fmt=JSON&amp;q=" + encodeURI(term) + "'";
     }
  
     function makeRequest(request, response) {
       $.ajax({
        url: 'http://query.yahooapis.com/v1/public/yql',
        data: {
          q: buildQuery(request.term),
          format: "json"
       },
       dataType: "jsonp",
         success: function(data) {
          var airports = [];
          if (data &amp;&amp; data.query &amp;&amp; data.query.results &amp;&amp; data.query.results.json &amp;&amp;  data.query.results.json.json) {
              airports = data.query.results.json.json;
          }
  
          response($.map(airports, function(item) {
              return {
                  label: item.code + (item.name ? ", " + item.name : "") ,
                  value: item.code
              };
          }));
       },
        error: function () {
          response([]);
          }
       });
     }
  
    $(document).ready(function() {
      $("#airport").autocomplete({
         source: makeRequest,
        minLength: 2
      });
    });
  &lt;/script&gt;
  
  &lt;input id="airport" /&gt;
  
  
  &lt;!-- HTML Code is --&gt;
  </code></pre>