Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
function doSearch(term) { 
alert("search here");
  return  $.ajax({
                    url: "URL",
                    data: {
                        q: term,
                    },
                    dataType: "json",
                    contentType: "text/plain",
                    type: "GET"
                  //,
                  //  success: function (data) {
                    //       searchResponse = data;
                      //  }
                });         
}


$(document).ready(function () {
alert("Hi");
       $("#txtSearchBox").autocomplete({
	   
	   source : function (request, response) {
                   doSearch(request.term);   
            }
	   })
	   alert(data);
	   });
Posted
Updated 29-Jun-15 1:54am
v2
Comments
Andy Lanng 29-Jun-15 7:55am    
I just need to check: Have you a reference to jquery-ui.js?
ZurdoDev 29-Jun-15 8:04am    
The error means it can't find where autocomplete is. So, you need to make sure the js file that has it is loaded.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900