autocomplete(travelpayouts)

Пытаюсь сделать autocomplete, но он не понимаю что делаю не так. В чём может быть проблема?

<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Autocomplete - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
  <script>
    $("#tags").autocomplete({
      source: function(request, response) {
        $.ajax({
          type: "GET",
          url: "https://autocomplete.travelpayouts.com/places2?locale=ru&types[]=airport&types[]=city&term=Моск",
          dataType: "json",
          data: data,
          success: function(data) {
            var transformed = $.map(data, function(el) {
              return {
                label: el.code,
                label: el.name,
                label: el.country_name
              };
            });
            response(transformed);
          },
          error: function() {
            response([]);
          }
        });
      }
    });
  </script>
</head>

<body>

  <div class="ui-widget">
    <label for="tags">Ввод: </label>
    <input id="tags">
  </div>

</body>

</html>

Пример работы

Пример работы


Ответы (1 шт):

Автор решения: BlackStar1991

Возможно в настройках браузера отключена функция. Атрибут autocomplete это по безопасности не очень секюрно....

→ Ссылка