Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download jQuery?

I'm trying to download JQuery. When I click the minified version, I just get a bunch of code displayed in the browser. I don't actually download anything. What am I supposed to do? How do I download JQuery and do I need to put it where my other files are?

like image 270
Justin Meltzer Avatar asked Oct 15 '10 03:10

Justin Meltzer


People also ask

How do I download jQuery locally?

You can add jQuery using CDN or through downloading it on local machine. For Local Installation, download jQuery library on your local machine and include it in your HTML code. The following are the steps: Go to the jQuery website to download the latest version available.

How do I add jQuery to my HTML?

Step 1: Open the HTML file in which you want to add your jQuery with the help of CDN. Step 2: Add <script> tag between the head tag and the title tag which will specify the src attribute for adding your jQuery. Step 3: After that, you have to add the following path in the src attribute of the script tag.

Can I use jQuery without downloading?

jQuery CDN If you don't want to download and host jQuery yourself, you can include it from a CDN (Content Delivery Network).


1 Answers

There are many ways you can get this to work

(it is supposed to show you the code like that)

You can copy all the code and save it as and jquery.js file and the call it like this:

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

Or you could just call it like this:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>

You can also link to it from many different places:

http://code.jquery.com/jquery-1.4.2.js Source version

Google Ajax API CDN

http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

Microsoft CDN

http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js

Read more here:

http://docs.jquery.com/Downloading_jQuery

EDIT:

If you want to download the code you can actually do it! right-click the checkbox for example: PRODUCTION (24KB, Minified and Gzipped) and choose save as (maybe you´ll need to add the .js extension) "Thanks to: Jason McCreary & deceze"

EDIT:

To clarify your comment, you should include the jQuery like this:

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

and now work as usual:

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

or

<script language="javascript" type="text/javascript">

your javascript here

</script>
like image 162
Trufa Avatar answered Oct 25 '22 15:10

Trufa