Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input class="typeahead form-control" placeholder="Type a city" type="text" />
- $('.typeahead').typeahead({
- hint: true,
- highlight: true,
- minLength: 3,
- limit: 8 }
- , {
- source: function(q, cb) {
- return $.ajax({
- dataType: 'json',
- type: 'get',
- url: 'http://gd.geobytes.com/AutoCompleteCity?callback=?&q=' + q,
- chache: false,
- success: function(data) {
- var result = [];
- $.each(data, function(index, val) {
- result.push({
- value: val
- });
- });
- cb(result);
- }
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement