Title: $(&#8230;).autocomplete(&#8230;).data(&#8230;) is undefined JS error
Last modified: May 14, 2018

---

# $(…).autocomplete(…).data(…) is undefined JS error

 *  Resolved [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autocomplete-data-is-undefined-js-error/)
 * I get three JS errors in my JS console from script.js, lines 799, 1002 and 838
 * $(…).autocomplete(…).data(…) is undefined JS error
 * I believe it has to do with this code.
 * The odd thing is, my instagram feed is working fine, however another module on
   my site that uses JS is not working, and I think it’s related to this JS error.
 *     ```
       $.ajax({
               url: ajaxurl,
               dataType: 'json',
               cache: false,
               data: {'action': 'get_stream_names'},
               success: function (data) {
                   if (data) {
                       $('#stream_name').autocomplete({
                           search: function (event, ui) {
                               $(this).removeClass("wait");
                           },
                           responce: function (event, ui) {
                               $(this).removeClass("wait");
                           },
                           source: function (request, response) {
                               var matches = $.map(data, function (tag) {
                                   if (tag.toUpperCase().indexOf(request.term.toUpperCase()) === 0) {
                                       return tag;
                                   }
                               });
                               response(matches);
                           },
       //                    minLength: 1,
                           select: function (event, ui) {
       //                        alert(ui.item.value);
                               var val = ui.item.value;
                               document.getElementById("streamcount").innerHTML = val.length;
                           }
                       }).data("ui-autocomplete")._renderItem = function (ul, item) {
                           var newText = String(item.value).replace(
                                   new RegExp(this.term, "gi"),
                                   "<span class='ui-state-highlight'>$&</span>");
                           return $("<li></li>")
                                   .data("item.autocomplete", item)
                                   .append("<a>" + newText + "</a>")
                                   .appendTo(ul);
                       };
                   }
               }
           });
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autocomplete-data-is-undefined-js-error/#post-10279397)
 * Apologies, I believe I got the wrong plugin. The plugin folder is called “stream-
   insta”, which I believe is a different one.
 *  [David](https://wordpress.org/support/users/dwyffels/)
 * (@dwyffels)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/autocomplete-data-is-undefined-js-error/#post-10280371)
 * Hey Jordan,
 * No problem. You are correct, that isn’t our plugin. I wish you speedy resolution
   with your issue.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘$(…).autocomplete(…).data(…) is undefined JS error’ is closed to new 
replies.

 * ![](https://ps.w.org/instagram-feed/assets/icon-256x256.png?rev=2700807)
 * [Smash Balloon Social Photo Feed – Easy Social Feeds Plugin](https://wordpress.org/plugins/instagram-feed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/instagram-feed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/instagram-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/instagram-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/instagram-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/instagram-feed/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [David](https://wordpress.org/support/users/dwyffels/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/autocomplete-data-is-undefined-js-error/#post-10280371)
 * Status: resolved