How to use Autocomplete API?

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
Im not an expert in JQuery, but i try to use the autocomplete api from wunderground using jquery, i been tried a lot of times with no results. There is a lot of examples on internet but nothing works.

Please, i just need a search box, showing the autocompletes options.

there is a example of my code:

$(function() {
    options = {
      source:  function( request, response) {
        $.ajax({
          url: "http://autocomplete.wunderground.com/aq?query=queryc=MX&format=jsonp";,
          query: "aca",
 dataType: "jsonp",
          jsonp: 'cb',
          success : (function(data) {
            response (data.RESULTS);
          }),
          minChars: 3
        });
      }
    };

    a = $('#busqueda').autocomplete(options)
      .autocomplete("instance")
        ._renderItem = function (ul, item) {

        return $("<li>")
        .append( 'zmw: ' + item.zmw + ' - ' + item.name)
        .appendTo(ul);
      };
  });
Thanks
Photo of Andres Cuevas

Andres Cuevas

  • 1 Post
  • 0 Reply Likes
  • Exhaust

Posted 3 years ago

  • 1

Be the first to post a reply!