gch1p / bootstrap-5-autocomplete

autocomplete/typeahead js plugin for bootstrap v5
103 stars 36 forks source link

example.html doesn't work. . . #27

Open sandynomad opened 1 year ago

sandynomad commented 1 year ago

Using Chrome 109.0.5414.87; Firefox 110.0b2 (64-bit); Safari 16.0:

Using "example.html" as is:

Uncaught SyntaxError: import declarations may only appear at top level of a module
Uncaught ReferenceError: Autocomplete is not defined
     <anonymous> file:///...../bootstrap-5-autocomplete/example/example.html:23

When using a web server I believe the "import declarations" can be fixed by changing:

<script src="../autocomplete.js"></script>

to

<script type="module" src="../autocomplete.js"></script>

However, trying to access "Autocomplete" from javascript in the main document ( Githubissues.

  • Githubissues is a development platform for aggregating issues.