autocomplete source function not displaying results and cannot access THIS
I am using jQuery Autocomplete.
Originally, I was using a string as the source, and it was working just fine.
Now, I am using a function:
- source: function( request, response ) {
- url = "ajaxsearchplace.cfm?term=" + request.term;
- $.getJSON(url + '&callback=?', function(data) {
- response(data);
- });
- }
This function is not displaying results under the associated text box.
In Firebug, the function is giving JSON that is identical to what is being returned when I use just the string as the source.
Also, when I include this line in my source function:
- var id = this.id;
It is returning the error: this.id is undefined
Why can I not access THIS in the source?
I am using THIS in the SELECT portion of autocomplete, and I can access THIS just fine.