The value of the src attribute is jquery.js. As you can see, the file location is not specified in the attribute. This means that it must be in the same folder as the HTML document. However, If you use the previous instruction ,the jquery Library will not be usable , There are two different solutions :
1- If your computer is not always connected to the Internet and /or if your Internet connection is not fast, you can download jQuery to any folder and reference it locally.
2- If your computer is always connected to the Internet, you can reference the jQuery library, indicating a Web address.
Let's Examine the two solutions !
Download jQuery locally :
Step1 : Go to the jQuery Official site and Click on "Download jQuery" Button in the Home page.Step2 : Choose : "Download the compressed, production jQuery 1.9.1" , a .txt file that contain the required code will open. Copy and paste it into bloc note and save the file with "jquery.js' as name in the same folder of the Html page.
Step3 : Copy and paste the code below between <head> and </head> :
All jQuery functions and Coding work must be inside the script tag. So , Now let's move to the second method to install jQuery :
Using CDN :
Using CDN (Content Management Network) , jQuery Installation become easier than downloading the library . In fact , with CDN , jQuery is hosted by Google and Microsoft , you just have to refer to it by adding a special link to your script tag .
jQuery Google CDN URL : ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
jQuery Microsoft CDN URL : ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js
Note :
the Links Provided above refers to the 1.9.1 version of jQuery , which is the recent one so far .
So if you want to use the CDN Method then add one of the below codes inside the <head> tag .
Google CDN :
Microsoft CDN :
Now that we installed jQuery , Our web page is able to execute jQuery events and functions correctly , So let's move to the next tutorial.
3 comments:
Written by an idiot starter! This article is not complete!
Codelobster PHP Edition has special wizard for it.
move purpose; this is a 20 megapixel dslr camera, and also it sporting activities a vari-angled A few.
This is the type of performance that moviemakers expect when
they are shooting scenes. Canon's new premium compact camera takes on
the interchangeable lens cameras for image quality and convenience.
Here is my homepage :: nikon d800
Post a Comment