When I download the jQuery zip file LINK. It gives me 4 different files:
- jquery.js
- jquery.lite.js
- jquery.min.js
- jquery.pack.js
pack.js
is the most pressed one of that js file and min
is minified.
So I have two questions...
- What is difference between
jquery.js
andjquery.lite.js
. There looks to be no difference when I view code. - What is better to use
min.js
orpack.js
on a live website?
When I download the jQuery zip file LINK. It gives me 4 different files:
- jquery.js
- jquery.lite.js
- jquery.min.js
- jquery.pack.js
pack.js
is the most pressed one of that js file and min
is minified.
So I have two questions...
- What is difference between
jquery.js
andjquery.lite.js
. There looks to be no difference when I view code. - What is better to use
min.js
orpack.js
on a live website?
- 2 Did you consider a diff or the docs? – Dave Newton Commented Sep 4, 2012 at 13:29
- 2 docs.jquery./Downloading_jQuery#Current_Release ;) – trumank Commented Sep 4, 2012 at 13:30
-
Guys, Actually I am using newer only V 1.8, but when I was googling for min and pack for jquery, I found repository of it, which es with question mark
(?)
. Why 4 different files are there??? – Ketan Bhavsar Commented Sep 4, 2012 at 13:33 - 2 @SLaks +1 from my side to balance unfair -4. Reason: Even I never heard about jquery.lite.js and jquery.pack.js but they existed in past. We can't expect everyone is old man in tech. So if someone e to know about past solutions, they could be interested to know about them. They could ask such straight forward question. I don't see anything wrong in it. – Kapil Sharma Commented Sep 4, 2012 at 13:45
- @JosephtheDreamer Please check previous ment. – Kapil Sharma Commented Sep 4, 2012 at 13:46
2 Answers
Reset to default 26Answer to the question:
jquery.js - Full expanded including ments.
jquery.lite.js - Not really relevant anymore - new releases don't give this - it mainly used to lack ments and less used features.
jquery.min.js - The main one to use nowadays - all whitespace and ments removed.
jquery.pack.js - Smaller in size - but requires 'unpacking' time, sort of like a rar/zip would.
But honestly, as others have mentioned use the latest release of jQuery if possible.
-
Updated information for 2018:
Compressed production - Removal and minification of code, no spaces/line breaks, hard for humans to read but smaller in size so it loads faster.
Unpressed production - Larger file size, easier for developers to work on but shouldn't be used in production due to unnecessary file size.
Map file - Helps developers/web browsers find references to the original location of JS code before it was pressed.
Slim builds - This version of jQuery doesn't include a few larger libraries, such as the AJAX and effects modules.
If you're looking for a CDN, use Microsoft or Google cdn:
https://developers.google./speed/libraries/devguide#jquery
or
http://www.asp/ajaxlibrary/cdn.ashx#jQuery_Releases_on_the_CDN_0
Use the latest version, the .lite.js
is not an official jQuery version, same for the .pack.js
.
On the jQuery website you can only find Production (Minified) or Development (not Minified) versions.
Here: http://docs.jquery./Downloading_jQuery you'll find all the official information about versions of jQuery.