Hello friends, I was installing Hestia on my test server, everything was installed correctly, the problem I have is when I upload a web page to the server they do not read the javascripts files.
ReferenceError: $ is not defined
in local mode of my normal functional pc all js.
any solution please.
Hi @tecprueba12
Javascript/jQuery gets executed in the client browser, so there is nothing that hestia could do wrong here (expect not provide the file at all) .
According to a short google search, it looks like the jquery package didnt get loaded properly: https://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined
Can you checkout the developer console (in Chrome F12) and check for any error log?
2 Likes
thanks brother, the error was in my js files, they had loaded badly, I corrected it.
1 Like
Basically $ is an alias of jQuery() so when you try to call/access it before declaring the function, it will endup throwing this $ is not defined error . This usually indicates that jQuery is not loaded and JavaScript does not recognize the $. Even with $(document).ready , $ is still going to be undefined because jquery hasn’t loaded yet.
To solve this error:
Load the jQuery library at the beginning of all your javascript files/scripts which uses $ or jQuery, so that $ can be identified in scripts .
There can be multiple other reasons for this issue:
- Path to jQuery library you included is not correct
- The jQuery library file is corrupted
- Working offline
- Conflict with Other Libraries