I have an application using JQuery 1.9.1 (uses the old version because it has functions in the menu that only work in this version), I am trying to autocomplete, but it is giving error
$(...).autocomplete is not a function
Does anyone know if this version of JQuery has this function or I'm missing something in the code?
Here is my code:
<input class="form-control form-control-sm" id="cidadesParadas" type="text"/>
//função para pegar os municipios do controller ListaMunicipios()
var municipios = new Array();
window.onload = function listaMunicipios() {
var url = "@Url.Action("ListaMunicipios", "Municipio")";
$.post(url, function (data) {
for (var i = 0; i < data.length; i++) {
municipios.push(data[i].DescMunicipio);
}
});
}
// Chama o Auto complete do JQuery setando o id do input, array com os dados e o mínimo de caracteres para disparar o AutoComplete
$('#cidadesParadas').autocomplete({ source: municipios, minLength: 3 });