What is jQuery and how to add it to web pages?
7 minute(s) read
Published on: Jul 23, 2021
Updated on: Dec 14, 2021
What is HTML?
HTML stands for HyperText Markup Language, which is a language that is often used in the design of web pages. In fact, in this language, the code is converted to HTML and displayed by the browser.
What is CSS?
CSS stands for Cascading Style Sheets. It describes how HTML elements are displayed on various sites. Simply put, if you think of HTML as the skeletons of a human body, CSS can be considered the flesh and skin, which ultimately make up a human appearance. It can be used to control the layout of multiple web pages at the same time, if CSS did not exist, you wouldn't even be able to imagine how ugly the web world would be, and users would be tired of navigating it and unwilling to spend long hours in it to get the answers they need.
What is jQuery?
Adding jQuery to your web pages:
To use it, you can take action in different ways. In the following section, you can review an example of the available methods.
- Downloading jQuery:
There are two versions available for you to download, the Production version and the Development version. The production version is actually for your live website, which is small and compressed, but the Development version, as its name implies, contains readable code. It is not compressed like the previous version, which can be used for website development.
jQuery.com has made it possible for you to download and use both versions of it easily to design some kinds of websites that make different users satisfied so that they will gain a better user experience by using your website. While downloading, one thing to keep in mind is to place the downloaded file in the same directory as the pages where you wish to use it.
The jQuery library is a single JS file which you reference it with the HTML
Before we get into that, we need to give a brief overview of CDN, so that you can understand more about it.
What is a Content Delivery Network (CDN)?
There are a set of interconnected servers and networks that generally deliver pages and other web content to the user according to the user's geographical location. These servers reduce users' access time to servers in different parts of the world and cause information circulates inside the server.
There are large networks around the world to reduce site traffic. All of these networks connect the user to the nearest server in any geographical location and act as a bridge if you want to have users from all over the world and be able to exchange information between your server and users with a high speed as well as keeping all users by providing the best services on your site, you should use the Content Delivery Network.
This system has gained a good position, and now many reputable websites and brands prefer to use it. By now, you are familiar with CDN. It's time to explain the main point.
There is a possibility that you can include it from a CDN, and if you do, you no longer need to download and host jQuery yourself. Now consider the example below for Google CDN.
The result of the above example will be as follows.
This is a heading
This is a paragraph.
This is another paragraph.
If you click on the button, you can get the following result.
This is a heading