最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What is difference between jquery.js and jquery.lite.js? - Stack Overflow

programmeradmin7浏览0评论

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

  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?

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

  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?
Share Improve this question edited Dec 15, 2015 at 9:37 Alexander Wigmore 3,1864 gold badges40 silver badges60 bronze badges asked Sep 4, 2012 at 13:27 Ketan BhavsarKetan Bhavsar 5,39610 gold badges39 silver badges70 bronze badges 8
  • 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
 |  Show 3 more ments

2 Answers 2

Reset to default 26

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

发布评论

评论列表(0)

  1. 暂无评论