title: jquery ui autocomplete source from json file
body: <p>I can incorporate jquery ui autocomplete with source from database. How, I am trying to get the source from a prepared json file, the content is like this:-</p>
  
  <pre><code>{"data":[{"id":"1","country_name_en":"USA","country_name_hk":"\u7f8e\u570b"},{"id":"2","country_name_en":"China","country_name_hk":"\u4e2d\u570b"},{"id":"3","country_name_en":"British","country_name_hk":"\u82f1\u570b"}]}
  </code></pre>
  
  <p>I tried to modify the jquery codes as follow:-</p>
  
  <pre><code>&lt;script&gt;
  $( "#country" ).autocomplete({
      source: function(request,response) {
        $.getJSON('../../database/country.json',{id: data.id},function(data){
              alert(data);
        })
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>but I think I do not written the format correctly. How shall I improve the way to extract the data from the json file? </p>