title: Assign results of JSON to array in jQuery
body: <p>I would like to take the results of my <code>$.getJSON</code> and place that JSON data, specifically the facility. FacilityName, as the values for the array availableTags.  I have tried executing a function call where you see the // TODO: but I am not getting this sorted out.  I'm sure it is easy for your jQuery experts!  I DO see the facilities displayed on my page in the <code>&lt;div id="info"&gt;&lt;/div&gt;</code> tag as I would expect.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(function () {
      $('#datePicker').datepicker();
  });
  
  var names = [];
  
  $.getJSON('FacilitiesAsync','sourceDb=myDb',processFacilities);
  function processFacilities(data) {
      $.each(data, function (facilities, facility) {
          names += facility.FacilityName;
      }); // end of each
  
      alert(names);
  
      $("#tags").autocomplete("source", names);
  };
  
  $(function () {
      $("#tags").focusout(function () {
          $.ajax({
              beforeSend: function() {
                  alert("Testing");
              },
              complete: function () {
                  alert("Done!");
              }
          });
      });
  });
  
  &lt;/script&gt;
  </code></pre>