title: Cannot set property '_renderItem' of undefined jQuery UI autocomplete with HTML
body: <p>I'm using the following code to render my jQuery UI autocomplete items as HTML.
  The items render correctly in the autocomplete control, but I keep getting this javascript error and can't move past it.</p>
  
  <p>Firefox <strong>Could not convert JavaScript argument</strong></p>
  
  <p>Chrome  <strong>Cannot set property '_renderItem' of undefined</strong></p>
  
  <pre><code>  donor.GetFriends(function (response) {
      // setup message to friends search autocomplete
      all_friends = [];
      if (response) {
          for (var i = 0; i &lt; response.all.length - 1; i++) {                
                  all_friends.push({
                      "label":"&lt;img style='padding-top: 5px; width: 46px; height: 46px;' src='/uploads/profile-pictures/" +
                          response.all[i].image + "'/&gt;&lt;br/&gt;&lt;strong style='margin-left: 55px; margin-top: -40px; float:left;'&gt;" +
                          response.all[i].firstname + " " + response.all[i].lastname + "&lt;/strong&gt;",
  
                      "value":response.all[i].firstname + " " + response.all[i].lastname,
                      "id":response.all[i].user_id});
              }
          }        
  
      $('#msg-to').autocomplete({
          source:all_friends,
          select:function (event, ui) {               
              // set the id of the user to send a message to
              mail_message_to_id = ui.item.id;
          }
  
      }).data("autocomplete")._renderItem = function (ul, item) {
          return $("&lt;li&gt;&lt;/li&gt;")
              .data("item.autocomplete", item)
              .append($("&lt;a&gt;&lt;/a&gt;").html(item.label))
              .appendTo(ul);
      };
  });
  </code></pre>
  
  <p>Not sure why it is throwing this error, or what I have to do to get past it...Any help is appreciated. </p>