jQuery Introduction
A JavaScript
library is referred to as jQuery
.
It's simple to learn jQuery.
jQuery's goal is to make using JavaScript on your website much easier.
What You Should Already Know
You need have a basic understanding of the following before beginning to study jQuery :
- HTML
- CSS
- Javascript
What is jQuery?
jQuery is a JavaScript library that allows you to "write less, do more".
The objective of jQuery is to make JavaScript on your web site much easier to use.
jQuery encapsulates many typical operations that require multiple lines of JavaScript code into methods that can be called with a single line of code.
A lot of the more difficult aspects of JavaScript, like as AJAX calls and DOM manipulation, are simplified by jQuery.
The library of jQuery includes the following :
- HTML/DOM manipulation
- CSS manipulation
- HTML event methods
- Effects and animations
- AJAX
- Utilities
Tip: Moreover, jQuery has plugins for nearly every task.
Why jQuery?
There are a variety of alternative JavaScript libraries available, but jQuery is the most popular and extensible.
jQuery is used by several of the world's most well-known websites, including :
- IBM
- Microsoft
- Netflix
Related Links
Will jQuery work in all browsers?
The jQuery team understands everything about cross-browser problems, and has included this information to the jQuery library. In all major browsers, jQuery will run exactly the same.
Adding jQuery to Your Web Pages
On your website you have various methods to use jQuery, You could :
- JQuery library from jQuery.com is available for download.
- Inclusion of the CDN jQuery, such as Google
Related Links
Downloading jQuery
The jquery may be downloaded in two versions :
- Production version - This is because it was mined and compressed for your live web site.
- Development version - This will be used for development and testing (uncompressed and readable code).
The library is a single file called JavaScript. The HTML script
tag is referred to by the user
(note the script
tag should lie inside the head
section).
Tip : Specify the file you want to utilise in the same directory of pages.
jQuery CDN
You can use a CDN (Content Delivery Network) to add jQuery if you don't want to download and host it yourself.
Google CDN :
Google is an example of someone who host jQuery :
An important benefit of Google's host jQuery :
When visiting another site, several people already download jQuerys from Google. As a consequence, when you access your site, it is loaded from a cache, resulting in a quicker loading time. Moreover, most CDN's will ensure that a file is sent from the server nearest to them when a user requires it, resulting in quicker loading.