I can not access my .js file from my .html file

0

I am currently using a small plugin to embellish my select within my html, the problem is that I mark the following error Uncaught TypeError: $(...).niceSelect is not a function , try to put a console.log(); and a alert(); inside the external file of .js that add to my project, delete the coockies and I gave in recharge but no change was seen or appeared the alert I had put, I put it in different locations and I understand that the error that I get now refers to my method is not declared, if it is declared only that it does not enter the file

External file

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

Code to start the selection

<script type="text/javascript">

  $(document).ready(function() {
  $('select').niceSelect();
});

</script>

This is the image of how my project is structured, the name of my file that I am calling is not incorrect and the route is not either.

The error is marked here $('select').niceSelect();

Complete error

    
asked by David 18.06.2017 в 22:07
source

1 answer

1
  • Be sure to call the .js in the correct order: first jquery and then nice.
  • Those two scripts place them at the bottom, before closing the body.
answered by 18.06.2017 / 23:11
source