Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between jquery.js and jquery.lite.js?

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...

  1. What is difference between jquery.js and jquery.lite.js. There looks to be no difference when I view code.
  2. What is better to use min.js or pack.js on a live website?
like image 781
Ketan Avatar asked Sep 04 '12 13:09

Ketan


Video Answer


2 Answers

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.

like image 186
Alexander Wigmore Avatar answered Oct 20 '22 19:10

Alexander Wigmore


If you're looking for a CDN, use Microsoft or Google cdn:

https://developers.google.com/speed/libraries/devguide#jquery

or

http://www.asp.net/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.com/Downloading_jQuery you'll find all the official information about versions of jQuery.

like image 5
Andrea Turri Avatar answered Oct 20 '22 20:10

Andrea Turri