javascript - Errors with basic EasyComplete input -


trying include easycomplete plugin (version 1.3.5) future website, have tested simple input tag (the 'basics' one) no success ... not see autcomplete list while typing letters in input tag.

here html file:

<!doctype html> <html> <head>     <link rel="stylesheet" href="./easyautocomplete/easy-autocomplete.min.css">      <link rel="stylesheet" href="./easyautocomplete/easy-autocomplete.themes.min.css">     <script src="./easyautocomplete/jquery.easy-autocomplete.min.js"></script>      <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> </head> <body>     <input id="basics" />     <script>         $(document).ready(function() {             var options = {                 data: ["blue", "green", "pink", "red", "yellow"]                 };             $("#basics").easyautocomplete(options);         });     </script> </body> </html> 

i have noticed, using safari web inspector, page has 2 issues:
_ 1 html file: '$("#basics").easyautocomplete(options); not function'
_ 1 jquery.easy-autocomplete.min.js file: 'can't find variable jquery' (last line)

coud explain me i'm doing wrong basic example ?

your javascript includes in wrong order. need include jquery first, autocomplete stuff.

here's demo of code includes in correct order:

$(document).ready(function() {     var options = {       data: ["blue", "green", "pink", "red", "yellow"]     };     $("#basics").easyautocomplete(options);   });
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.min.css">  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.themes.css">  <script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>    <input id="basics">


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -