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 compressed one of that js file and min is minified.
So I have two questions…
- What is difference between
jquery.jsandjquery.lite.js. There looks to be no difference when I view code. - What is better to use
min.jsorpack.json a live website?
Answer to the question:
jquery.js – Full expanded including comments.
jquery.lite.js – Not really relevant anymore – new releases don’t give this – it mainly used to lack comments and less used features.
jquery.min.js – The main one to use nowadays – all whitespace and comments 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.
Uncompressed 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 compressed.
Slim builds – This version of jQuery doesn’t include a few larger libraries, such as the AJAX and effects modules.