title: Jquery UI Autocomplete with Image
body: <p>I am getting an error in this code. Can anybody help me? </p>
  
  <pre><code>&lt;h4&gt;search:&lt;input type="text" id="name-list" /&gt;&lt;/h4&gt;
  &lt;script type="text/javascript" language="javascript"&gt;
  $(function () {
          $("#name-list")
      .autocomplete({
          source: function (request, response) {
                  $.ajax({
                  url: "/Home/Searchuser", type: "POST", dataType: "json",
                  data: { searchText: request.term, maxResults: 10 }
              })
  
              return false;
  
          },
  
          minLength: 1
  
          }).data("autocomplete")._renderItem = function (ul, item) {
          var inner_html = '&lt;a&gt;&lt;div class="list_item_container"&gt;&lt;div class="image"&gt;&lt;img src="' + item.PicLocation + '"&gt;&lt;/div&gt;&lt;div class="label"&gt;' + item.label + '&lt;/div&gt;&lt;div class="description"&gt;' + item.DisplayName + '&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;';
                                   return $("&lt;li&gt;&lt;/li&gt;")
                                  .data("item.autocomplete", item)
                                  .append(inner_html)
                                  .appendTo(ul);
      };
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The data is receiving correctly from the server. Where have i made mistake? </p>