This is article which is specifically discuss an error message stated in the title of the article. The error stated is a JQuery error message : ‘$ is not defined’. The error message itself can be seen in the following image :
In the above image, the error message is triggered and then presented in the plugin added or installed in a Web Browser. The plugin or tool is firebug which is added or installed in a specific Web Browser named ‘Mozilla Firefox’. A plugin or tool which has the specific function can be provided or exist in another Web Browser. But in the context of this article, the Web Browser used is Mozilla Firefox and further more it is displaying the error message as shown in the above image.
1. To be able to use or import the JQuery file, one of the method available is by downloading the JQuery file from its official website. The JQuery file downloaded is provided in the download page of JQuery which exist in this link.
2. After downloading the file, place it into the local folder which can be accessed by the web page file.
- Define a line of code for impoting the JQuery file as shown below for an example :
Depends on the location of the JQuery file library, just change the value of the attribute ‘src’. In the context of this article, the location of the file is stored in a folder named ‘js’. So, based on the location relative to the file, below is the actual structure :
web-page-file.html js |---jquery-3.2.0.js
By doing the above steps described, the error message can be solved.