]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Update remote-jsonp demo with working geo webservice
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 29 Jan 2014 14:12:59 +0000 (15:12 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 29 Jan 2014 14:13:54 +0000 (15:13 +0100)
The previous webservice now requires user credentials. The new one is also
in use in a jQuery Mobile demo.

Fixes #9764

demos/autocomplete/remote-jsonp.html

index 3cd718862e4955ffc7f7f50fd55425327a12f535..cb178d3c9e41e550becacdcdfdd0b68357e6de6a 100644 (file)
                $( "#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 );
                                        }
                                });
                        },