JQuery Error Message $ is not defined

Posted on

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 :

JQuery Error Message $ is not defined
JQuery Error Message $ is not defined

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.

The error message itself is actually triggered because a simple reason. The reason for the error message happened is because the JQuery file responsible for handling JQuery process has not been imported in the web page file. JQuery is quite popular as Javascript library and it can be seen for its further information in its official website in this link. To be able to solve the problem by handling the error message above, below is the steps which is needed to be taken :

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.

  1. Define a line of code for impoting the JQuery file as shown below for an example :
<script src="js/jquery-3.2.0.js"></script>

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.

One thought on “JQuery Error Message $ is not defined

Leave a Reply