$.easyautocomplete is not a function how to fix this

458 Views Asked by At

I have tried alot but this is not getting fix. I am trying to implement easyautocomplete but all the time its giving me its not a function, any help would be appreciated .

these are the files and script code

script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>

<link href="css/easy-autocomplete.min.css" rel="stylesheet" />
<script>
$(document).ready(function(){


let countries = [
    {"name": "Afghanistan", "code": "AF"},
    {"name": "Albania", "code": "AL"},
    {"name": "Algeria", "code": "DZ"},
]
var options = {
    data: countries,
    getValue: "name",
    list: {
        match: {
            enabled: true
        }
    }
};
$("#basics").easyAutocomplete(options);
});

</script>

this is the html

 <div class="row">
      <input id="basics" />
  </div> 
1

There are 1 best solutions below

0
bharat parmar On

you have declared jQuery library twice with different versions, try this your update code:

<script src="js/jquery-1.11.2.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>
<link href="css/easy-autocomplete.min.css" rel="stylesheet" />
<script>
$(document).ready(function(){
let countries = [
    {"name": "Afghanistan", "code": "AF"},
    {"name": "Albania", "code": "AL"},
    {"name": "Algeria", "code": "DZ"},
]
var options = {
    data: countries,
    getValue: "name",
    list: {
        match: {
            enabled: true
        }
    }
};
$("#basics").easyAutocomplete(options);
});

</script>