How to load JQuery Library File in a Webpage

Posted on

This article is written just to inform or simply to describe about the process of loading JQuery Library file in a web page. Before a web page can be processed with script or snippet code of JQuery inserted in it, the first thing to be executed is naturally just to define the JQuery Library file in the associated web page. But to be more elaborate and to be able to explain it in detail, below is the actual process of how to do it :

1. Download the JQuery Library file.

The first step is the download process of the JQuery library file itself. The file can be found in its official website page which is currently at the time this article is being written, it is located at http://jquery . It can be visited in this link. Just go straight to the download link or the download menu provided in the web page and then select the appropriate file.

  1. Store the JQuery Library file to the appropriate location.

After downloading the JQuery Library File, save or move the file to the appropriate location. It is actually done in order to specify the path which is needed in order to define or to load the file itself in the web page which is associated.

  1. Define the JQuery Library file in the web page file associated.

After moving or placing the JQuery Library file downloaded before,  just define it in the web page file which is going to be executed. In this context, the web page can be in any kinds of format. Below is the actual definition of defining the JQuery Library file in the web page file :

<script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/jquery-2.0.0.min.js"></script>

Normally, it is placed in the head section of the web page file. For an example, the following is the head definition part with the definition of the JQuery Library file inserted in the head section :

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Web Page</title>
....
<script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/jquery-2.0.0.min.js"></script>
</head>
....
</html>

Leave a Reply