Jquery Become Started
jQuery Get Started
Adding jQuery to Your Web Pages
There are several ways to firstly using jQuery on your spider web site. You can:- Download the jQuery library from jQuery.com
- Include jQuery from a CDN, similar Google
Downloading jQuery
There are 2 versions of jQuery available for downloading:- Production version - this is for your alive website because it has been minified together with compressed
- Development version - this is for testing together with evolution (uncompressed together with readable code)
The jQuery library is a unmarried JavaScript file, together with yous reference it amongst the HTML <script> tag (notice that the <script> tag should travel within the <head> section):
<head>
<script src="jquery-3.2.1.min.js"></script>
</head>
Tip: Place the downloaded file inwards the same directory equally the pages where yous want to purpose it. Do yous wonder why nosotros produce non bring type="text/javascript" within the <script> tag?
This is non required inwards HTML5. JavaScript is the default scripting linguistic communication inwards HTML5 together with inwards all modern browsers!
This is non required inwards HTML5. JavaScript is the default scripting linguistic communication inwards HTML5 together with inwards all modern browsers!
jQuery CDN
If yous don't desire to download together with host jQuery yourself, yous tin include it from a CDN (Content Delivery Network).Both Google together with Microsoft host jQuery.
To purpose jQuery from Google or Microsoft, purpose ane of the following:
Google CDN:
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
Microsoft CDN:
<head>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
</head>
One big wages of using the hosted jQuery from Google or Microsoft:
Many users already bring downloaded jQuery from Google or Microsoft when visiting or together with then other site. As a result, it volition travel loaded from cache when they catch your site, which leads to faster loading time. Also, close CDN's volition brand certain that ane time a user requests a file from it, it volition travel served from the server closest to them, which likewise leads to faster loading time.
Many users already bring downloaded jQuery from Google or Microsoft when visiting or together with then other site. As a result, it volition travel loaded from cache when they catch your site, which leads to faster loading time. Also, close CDN's volition brand certain that ane time a user requests a file from it, it volition travel served from the server closest to them, which likewise leads to faster loading time.
Comments
Post a Comment