What is jQuery?
It does so by wrapping those tasks into methods that can be called with just a single line of code. And thus, it save a lot of your time – that you otherwise – would have spend in writing monotonous code and rather can work with adding cool effects right away.
Uses of jQuery
So, now that you have a slight of idea of what jQuery is let us talk about its use.
How jQuery Works and How It Can Be Implemented?
There are two different ways that makes jQuery work:
2. The second and the preferred way requires you to include jQuery from a CDN (Content Distribution Network). There are two benefits of choosing this option. First off, it ensures that we make use of the recent version of the jQuery library. Secondly it helps to reduce the server load, as this option takes up less bandwidth. In order to include jQuery from CDN (such as Google), you will have to use the following code:
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> </head>
Now, to see how jQuery can be implemented in your website let us consider a simple example:
<html> <head> <meta charset="utf-8"> <title>Demo</title> </head> <body> <script src="https://domain_name.com/">jQuery</script> <script src = "jquery-1.11.2.min.js"></script> <script> //You code will come here </script> </body> </html>
As you can see, the latest version of the jQuery library is included in the