devbridge / jQuery-Autocomplete

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
Other
3.56k stars 1.66k forks source link

Problem with tolowercase #172

Closed leknoppix closed 10 years ago

leknoppix commented 10 years ago

Hello

I'm trying your script and i'm a problem.

With the chrome's inspector, i have a problem with : toLowerCase() is not define.

I don't understand because for me, toLowerCase is a native function in simple javascript.

I put here, my code who i'm trying:

var countries = [ { "id": 0, "label": "Helixo" }, { "id": 1, "label": "Inrt" }, { "id": 2, "label": "Micronaut" }, { "id": 3, "label": "Sentia" }, { "id": 4, "label": "Miraclis" }, { "id": 5, "label": "Ginkle" }, { "id": 6, "label": "Gaptec" }, { "id": 7, "label": "Baluba" }, { "id": 8, "label": "Maximind" }, { "id": 9, "label": "Quonata" }, { "id": 10, "label": "Playce" }, { "id": 11, "label": "Apexia" }, { "id": 12, "label": "Vetron" }, { "id": 13, "label": "Straloy" }, { "id": 14, "label": "Quizmo" }, { "id": 15, "label": "Immunics" }, { "id": 16, "label": "Quantalia" }, { "id": 17, "label": "Besto" }, { "id": 18, "label": "Frenex" }, { "id": 19, "label": "Bicol" }, { "id": 20, "label": "Retrotex" }, { "id": 21, "label": "Anacho" }, { "id": 22, "label": "Ronelon" }, { "id": 23, "label": "Hyplex" }, { "id": 24, "label": "Mantrix" }, { "id": 25, "label": "Zytrek" }, { "id": 26, "label": "Vicon" }, { "id": 27, "label": "Pyrami" }, { "id": 28, "label": "Orbiflex" }, { "id": 29, "label": "Zolarity" }, { "id": 30, "label": "Stelaecor" }, { "id": 31, "label": "Enerforce" }, { "id": 32, "label": "Recognia" }, { "id": 33, "label": "Lotron" }, { "id": 34, "label": "Atomica" }, { "id": 35, "label": "Norsul" }, { "id": 36, "label": "Ezentia" }, { "id": 37, "label": "Updat" }, { "id": 38, "label": "Zilencio" }, { "id": 39, "label": "Dancity" }, { "id": 40, "label": "Endicil" }, { "id": 41, "label": "Hotcakes" }, { "id": 42, "label": "Stucco" }, { "id": 43, "label": "Octocore" }, { "id": 44, "label": "Maineland" }, { "id": 45, "label": "Sustenza" }, { "id": 46, "label": "Sultrax" }, { "id": 47, "label": "Isosphere" }, { "id": 48, "label": "Zoinage" }, { "id": 49, "label": "Unia" }, { "id": 50, "label": "Xinware" }, { "id": 51, "label": "Tropolis" }, { "id": 52, "label": "Plasmosis" }, { "id": 53, "label": "Crustatia" }, { "id": 54, "label": "Poochies" }, { "id": 55, "label": "Talkola" }, { "id": 56, "label": "Ecratic" }, { "id": 57, "label": "Accufarm" }, { "id": 58, "label": "Daido" }, { "id": 59, "label": "Satiance" }, { "id": 60, "label": "Enaut" }, { "id": 61, "label": "Exovent" }, { "id": 62, "label": "Amril" }, { "id": 63, "label": "Surelogic" }, { "id": 64, "label": "Buzzmaker" }, { "id": 65, "label": "Endipin" }, { "id": 66, "label": "Sulfax" }, { "id": 67, "label": "Songbird" }, { "id": 68, "label": "Zeam" } ];

$('.autocomplete').autocomplete({ lookup: countries, onSelect: function (suggestion) { console.log('You selected: ' + suggestion.label + ', ' + suggestion.label); } });

tkirda commented 10 years ago

You are using wrong response format. Read documentation: https://github.com/devbridge/jQuery-Autocomplete#response-format

leknoppix commented 10 years ago

thank