title: Autocomplete jQuery with phonegap on large results
body: <p>I need to add an autocomplete to a input field in my app using phonegap. I am aware of the autocomplete widget that jquery has and I wanted to use that in my app too. What I need is for the autocomplete to look for strings based off a query made in the sqlite db I have installed on my tablet. </p>
  
  <pre><code>$("#searchInput").autocomplete({
       source: "script_that_queries_the_db.php"
  });
  </code></pre>
  
  <p>From another thread I got this, but since phonegap doesn't use php, are we allowed to call a JS file similarly and make that query a function, for example </p>
  
  <pre><code>function getSitenames () { 
     //stuff in here to build an array to use by autocomplete 
  }
  </code></pre>
  
  <p>Any help will be appreciated.</p>
  
  <p>EDIT: My JSON/Array I'll be grabbing from the database will contain around 1900 entries at a time. Since autocomplete will always recall the source, I was hoping to do something like</p>
  
  <pre><code>SELECT name FROM sitenames WHERE name LIKE ?
  </code></pre>
  
  <p>and parse in the <code>response.text</code> each time and build the array like that. (Since the sitesnames table holds 1900+ entries)</p>