tags:

views:

1026

answers:

12
+2  Q: 

Installing JQuery?

What is the procedure for installing JQuery, Because i am new to this software

+1  A: 

There is none. Use script tags to link to google's version (or download it yourself and link to your copy if you really want to).

If you don't know how to do that, learn HTML and Javascript first before attempting to learn jQuery.

Macha
+23  A: 

Get jQuery up and running in a minute or less:

Insert this into your html ( most commonly in the head, but you can throw it before the end body tag too ):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;&lt;/script&gt;

Then place a script element after your jQuery one. This would alert 'hello' after the DOM is ready.

<script>$(function() { alert('hello') });</script>

Read the documentation:

http://docs.jquery.com/Main%5FPage

Using jQuery locally:

After you get a feel, try downloading jQuery locally to your computer and link it from your script file. Structure like so:

C:/web/index.html
C:/web/js/jquery.js

index.html:
<head>
<script src="js/jquery.js"></script>
<script>$(function() { alert('hi') })</script>
</head>

You have the advantage of relying on your saved version offline if you don't have the internet/wifi. You can also make custom edits to the jQuery source and modify it at will.

Study the jQuery source [advanced]

Download the uncompressed version from:

http://code.jquery.com/jquery-latest.js

After you've gained a bit of Javascript/DOM knowledge and try to take it apart step by step.

meder
these days there is also one hosted by microsoft.
eglasius
and given multiple hosted, ways to handle if one fails to use another
Mark Schultheiss
A: 

There is no installation required. Just add jQuery to your application folder and give a reference to the js file.

<script type="text/javascript" src="jQuery.js"></script>

if jQuery is in the same folder of your referenced file.

rahul
A: 

As pointed out, you don't need to. Use the Google AJAX Libraries API, and you get CDN hosting of jQuery for free, as depending on your site assets, jQuery can be one of the larger downloads for users.

Marc Bollinger
+7  A: 

There is no installation per se.

You download jQuery and include it in your html files like this:

<script src="jquery.js" type="text/javascript"></script>

Of course, modify the filename so that it's the same as the downloaded script file.

Done!

Christian Davén
+1 local is always better.
peirix
Disagree. Local means they have to download jQuery when they visit your site. Chances are very high they already have the google version cached.
womp
A: 

JQuery is just a javascript library (simply put a javascript file), all you have to do put it into your website directory and reference it in your html to use it.

e.g., in the head tag of your webpage

<script type="text/javascript" src="../Js/jquery.js"></script>

You can down the current JQuery release from here

Scozzard
+3  A: 

It tells you at the very start of the tutorial linked from the jQuery homepage.

David Dorward
+1  A: 

There are two different ways you can utilize JQuery on your website. To start off, you need to have access to your website source, whether it be straight HTML or generated HTML from a programming language. Then you need to insert a <script> tag that will render in the final output to the web browser.

Because you are new to JQuery, I highly suggest you start reading How JQuery works.

As others have mentioned, there are Content Distribution Networks (CDNs) that host JQuery--all you need to do is point your script tag src to a specific URI. Google and Microsoft both have CDNs that are free for personal and commercial use.

Alternatively, you can download JQuery and host it on your own website.

You can also leverage both of these methods together. In the event that the Google or Microsoft CDN is down or blocked in the end user's country/firewall/proxy, you can fallback to your locally hosted copy of JQuery.

cowgod
+1  A: 

The following steps can be followed

1) Download Jquery by clicking on this link DOWNLOAD

2) Copy the js file into your root web directory eg. www.test.com/jquery-1.3.2.min.js

3) In your index.php or index.html between the head tags include the following code, and then JQuery will be installed.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
Roland
A: 

The best thing would be to link to the jQuery core is via google.
There are 3 reasons to do it this way,

  • Decreased Latency
  • Increased parallelism
  • Better caching

      see:
      http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
<script type="text/javascript">
 $(document).ready(function() {

Your code here.....

  });
</script>
adardesign
A: 

Due to recent crashes on the Google code servers, it may not be best practice (anymore) to link remotely to the Google version.

Just store a minified version on your site.

eknown
A: 

Well as most of the answers pointed out, you can include the jQuery file locally as well as use google's CDN/Microsoft CDN servers. On choosing google vs. Microsoft CDN go Google_CDN vs. Microsoft_CDN depending on your requirement.

Generally for intranet applications include jQuery file locally and never use CDN method since for intranet, the LAN is 10x times faster than internet. For internet and public facing applications use a hybrid approach as suggested by cowgod above. Also don't forget to use this nice tool JS_Compressor to compress the extra JS code you add to your jQuery library. It makes JS really fast.

A_Var