Introduction to jQuery
- It is free and open-source.
- It is SEO friendly and CSS3 compliant.
- It supports cross-browser compatibility which means it can work on any web browser or a mobile device.
- It can help you make animated applications just like Flash.
- It allows for faster page load times.
- It includes DOM & CSS manipulation, event handling methods, effects, animations, AJAX and other utilities.
How to get the jQuery Library?
The jQuery library is available as a simple “.js” file. There are two ways to get it:
- You can download it from its official website . There are two versions available: compressed and uncompressed. The compressed version is used for live websites. You can use the uncompressed version while development and testing. It has also got readable code.
- You can also use Content Delivery Networks (CDNs) such as Google and Microsoft. If you use a jQuery file hosted via CDN, it will load faster and efficiently as compared to if you hosted it on your server.
Note: A Content Delivery Network (CDN) is a collective system of servers distributed over a network that delivers content to the users.
document.getElementById("demo").innerHTML = "Hello";
Can you see the difference?? How logical, short and simple the jQuery code looks!
How to use the jQuery Library?
If you have downloaded the jQuery library, you have to place it in the same directory as your web pages. Next, in your web pages, add the following code in the <head> section to start using jQuery:
In case, you wish to use CDNs, write the following code in the <head> section,
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> (for Google as CDN)
And you are ready to go!!
in the <head> section of your web page.
Hi! I am Geetika, an Assistant Professor by profession and a blogger by passion. I love reading about new technologies and pen down my thoughts on them.
Be First to Comment