mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Autocomplete: Update remote-jsonp demo with working geo webservice
The previous webservice now requires user credentials. The new one is also
in use in a jQuery Mobile demo.
Fixes #9764
(cherry picked from commit d4865dcbcd
)
This commit is contained in:
parent
2ccba55476
commit
f85ea09625
@ -27,21 +27,13 @@
|
||||
$( "#city" ).autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.ajax({
|
||||
url: "http://ws.geonames.org/searchJSON",
|
||||
url: "http://gd.geobytes.com/AutoCompleteCity",
|
||||
dataType: "jsonp",
|
||||
data: {
|
||||
featureClass: "P",
|
||||
style: "full",
|
||||
maxRows: 12,
|
||||
name_startsWith: request.term
|
||||
q: request.term
|
||||
},
|
||||
success: function( data ) {
|
||||
response( $.map( data.geonames, function( item ) {
|
||||
return {
|
||||
label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
|
||||
value: item.name
|
||||
}
|
||||
}));
|
||||
response( data );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user