0

I'm getting the error

SCRIPT5007: Unable to get property 'results' of undefined or null reference returned

when I'm loading a page due to the following code:

  $( function() {
   var systemNameList = [ ];
   $.ajax({
    url: "/_api/web/lists/getbytitle('Application List')/items?$select=Title&$top=1000",
    type: "GET",
    headers: {"accept" : "application.json;odata=verbose"},
    success: function (data) {
     systemNameList = data.d.results;
     console.log(systemNameList);
    }
   });
    $( "#systemName" ).autocomplete({
      source: systemNameList
    });
  } );

It's intended to retrieve a list of systems from a list that can be added to and create an array for them to then be searchable with the autocomplete to give suggestions when typing into an input box, however it seems to error around the ajax query results, though I'm not sure why.

0 Answers0