title: Does jQuery autocomplete work with a dynamic array as source
body: <p>I am currently trying to create an autocomplete with a source that is stored in a javascript variable but this variable can be updated by another function. So, what I would like is that at each time the user updates the autocomplete field, the <code>source</code> field of autocomplete is generated. </p>
  
  <p>Here is the code I use: </p>
  
  <pre><code>&lt;head&gt;
      &lt;script&gt;
          var availableTags = ['java', 'javascript']
          // can be called anytime
          var addToTags = function(str){availableTags.push(str)}
  
          $(function() {
              $( "#tags" ).autocomplete({
                  source: availableTags
              });
          });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="ui-widget"&gt;
          &lt;label for="tags"&gt;Tags: &lt;/label&gt;
          &lt;input id="tags" /&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Do I need to do a callback-like function? </p>