Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

68
Vistas
JQuery .autocomplete not found?

I am trying to give my search bar autocomplete function.

$(function() {
  var availableTags = [{
      "game1": "title1"
    },
    {
      "game2": "title2"
    },
    {
      "game3": "title3"
    },
  ];
  $("#choices-text-preset-values").autocomplete({
    source: availableTags
  });
});
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>


<form method="GET" action="{% url 'search_results' %}" style="display: inline; background-color: transparent;" method="get">

  <div id="search_bar" class="row" style="margin-top: 0px; text-align: center;">

    <input name="q" class="sb-pos" id="choices-text-preset-values" type="text" placeholder="Aramak istediğiniz oyunu yazın!   " style="padding-left: 30px;" />
    <button type="submit" style="background-color: transparent; border: none;" class="sb-icon-pos">
                            <i class="fa fa-search" style="color: black; font-size: x-large;"></i>
                        </button>
  </div>
</form>

I am getting this error:

TypeError: $( "#choices-text-preset-values" ).autocomplete is not a function. (In '$( "#choices-text-preset-values" ).autocomplete({
      source: ['deneme','deneme2']
    })', '$( "#choices-text-preset-values" ).autocomplete' is undefined)
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The jQuery (or any javascript API in general) API might not be found for a various number of reasons.

Usually the problem is caused by the jQuery javascript code not being loaded at the moment your script executes. This can be due to a various number of reasons:

  • An adblocker might have blocked the jQuery javascript file
  • The jQuery javascript file is hosted on a CDN / other server that is offline
  • You loaded jQuery, but forgot to include jQuery UI (autocomplete is part of jQuery UI!)
  • Your code was executed before jQuery was loaded.
    This can be caused because your <script>$(document).ready(/*whatever*/);</script> code is located before the <script src="/path/to/jquery.js"></script> block, or alternately because you mistakenly made the jquery script tag async. So, make sure that:
    1. the jQuery script tag is located before your script and
    2. it is not marked as async.
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda