title: jQuery UI autocomplete - syntax for external javascript data source?
body: <p>and thanks in advance for reading.  I'm attempting to customize the jQuery UI autocomplete search to display results that are clickable links, and I've been successful. I've successfully mimiced code from another question on this forum.</p>
  
  <p>However, I will eventually have too many links to store on the page as a variable. I used to use the old version of jQuery autocomplete (before it became jQuery UI) and was able to store the variable "updates" in a javascript file.  With the new version in UI, I don't know to do it.  The old version was here...</p>
  
  <p><a href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" rel="nofollow">http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/</a></p>
  
  <p>And the javascript file used there was "localdata.js"</p>
  
  <p>Does anyone know how to change the source from a variable on the same HTML page to a external javascript file that has the exact same text as my variable in the jQuery UI version??? </p>
  
  <p>I've also tried the migration guide here;  <a href="http://www.learningjquery.com/2010/06/autocomplete-migration-guide" rel="nofollow">http://www.learningjquery.com/2010/06/autocomplete-migration-guide</a> but I was not able to figure this out.</p>
  
  <p>The working code I have, that doesn't reference an outside file is below...</p>
  
  <p>====================================================</p>
  
  <pre><code>    &lt;script&gt;
      $(function() {
  
  
      var updates = [ 
  
      { value: "http://www.google.com", label: "Google"},
      { value: "http://www.yahoo.com", label: "Yahoo!"},
      ];
  
      $("input#autocomplete").autocomplete({
      source: updates,
      select: function( event, ui ) { 
      window.location.href = ui.item.value;
      }
      });
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>=====================================</p>
  
  <p>I know the change is on the "source;updates," line, but I don't know what to do.  Thank you very, very much again for reading.</p>