2

How can I implement it in the jQuery Autocomplete?

    $("#searchForm input").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "http://en.wikipedia.org/w/api.php",
                dataType: "jsonp",
                data: {
                    maxRows: 10,
                },
            });
        },

    });
jQuerybeast
  • 14,130
  • 38
  • 118
  • 196

1 Answers1

2

edit:

if you look at this example, you'll see a remote call with jsonp example

look at the source of their example and the sucess function. It looks like they are mapping the jsonp fields to use the data as needed for the autocomplete. use fiddler to see the json coming down from their example.

success: function( data ) {
 response( $.map( data.geonames, function( item ) {
                        return {
                            label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
                            value: item.name
                        }
                    }));
                }
Eonasdan
  • 7,563
  • 8
  • 55
  • 82
  • so does that answer your question or do you still need help? if this answered your question please mark it as such. thanks – Eonasdan Oct 20 '11 at 13:03
  • It doesn't answer my question. Answering by letting me know to read something that ive mentioned that I read already, doesn't answer my question. – jQuerybeast Oct 20 '11 at 13:11
  • I still need help because it doesn't parse anything. – jQuerybeast Oct 20 '11 at 13:11
  • see my edit, let me know if that helps better. I did completely miss the part where you mentioned you were using jquery ui autocomplete. – Eonasdan Oct 20 '11 at 13:24