0

I have an auto completion script in jQuery that work fine only in a pages that contains the search results web part but not in the other pages, why does this happen and how can I resolve the problem? there is the script

 var myresult;
     var url = _spPageContextInfo.webAbsoluteUrl;
 var results;   
      $.ajax({
            url: url+"/_api/web/siteusers", 
    method: "GET",
    dataType: 'json',
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {

        results = data.d.results;
        for( j in results){
                myresult[j] = results[j].Title;
            }


        }
        });

    $( "#SearchBox input" ).autocomplete({
                source: myresult 

                    });
  • 1
    Without seeing your code it is very hard to tell why it is working in a specific matter – Robert Lindgren May 27 '14 at 8:20
  • this no code solution, it's only done with adding the web parts by configration in the Sharepoint site – Issibra May 27 '14 at 8:34
  • You say you have a jQuery auto-complete script, that must be code right? – Robert Lindgren May 27 '14 at 8:34
  • oh yeah sorry i forgot it, i note that the result of ajax is showing in the console, i note also that if i execute this code in the console the autocmplete work fine in this page – Issibra May 27 '14 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.