title: Select2 undefined issue
body: <p>The following function gets json data from URL and populates a select element with jQuery. I am than using <a href="http://ivaynberg.github.io/select2/#documentation">Select2</a> to transform that drop down in a field with autocomplete function.</p>
  
  <p>Everything works fine apart from the writing 'undefined' that I get as soon as the select elements get displayed. The autocomplete and drop down work perfectly. I have tried to use the data placeholder even by adding an empty 'option' element but no success.</p>
  
  <pre><code>function CitiesList(callback){
   $.getJSON(document.URL+'getCities/sdfsfs', function(data){
      var html = '';
      var len = data.length;
      var option = '&lt;option&gt;&lt;/option&gt;';
      for (var i = 0; i&lt; len; i++) {
          html += '&lt;option value="' + data[i] + '"&gt;' + data[i] + '&lt;/option&gt;';
      }
      $('.select_cities select').append(option);
      $('.select_cities select').append(html);
      if(callback &amp;&amp; typeof callback == 'function'){
          callback.call(null);
      }
  
  });
  }
  
              &lt;select data-placeholder="Select a city" name="cities" id="cities"&gt;
              &lt;/select&gt;
  </code></pre>
  
  <p>'select_cities' is the div wrapper around the select element.</p>