Autocomplete with URL as Source
in Using jQuery Plugins
•
11 years ago
Hi guys,
I want to use jQuery Autocomplete with a webservice as Source
Webservice:
http://localhost/webService/AutoCompleteData.ashx
is providing following data:
...
302011
509869
501640
305172
305211
300782
510104
...
my jQuery Autocomplete ( http://localhost/search.aspx ) looks like:
__________________________
$(document).ready(function () {
$("#fname").autocomplete("AutoCompleteData.ashx" );
});
__________________________
but it works only if search.aspx and AutoCompleteData.ashx are in the same path.
If they are not in the same path it becomes difficult for me. I've tried to solve it like this:
__________________________
$(document).ready(function () {
var urlService = 'http://localhost/webService/AutoCompleteData.ashx';
var options = { serviceUrl: urlService };
$("#fname").autocomplete(options);
});
__________________________
but it doesn't work. I see that if I want to use something like http://... as data source, the aoutocomplete has no values.
does anybody have an idea to solve this?
Thanks in advance, greY80
1