开发者

what is the use and purpose of uncompressed version of jquery library file provided by jquery.com?

开发者 https://www.devze.com 2022-12-15 04:48 出处:网络
Jquery.com provide 2 version of jquery library. I always use Minified version because i never edit anything in jquery base file. but what is the use and purpose of another Uncompressed Code version? D

Jquery.com provide 2 version of jquery library. I always use Minified version because i never edit anything in jquery base file. but what is the use and purpose of another Uncompressed Code version? Does people edit main library file to get something?

If yes then if we edit anything in main file then we can't use google ajax library link.

Production (19KB, Minified and Gzipped)   
Development (120KB, Uncompressed Code) 
开发者_运维百科


If you're using the minified version during development, browsers will tell you there's an error on line X, but line X might consist of hundreds or even thousands of lines of uncompressed code. This makes it very, very difficult to figure out what exactly caused the problem.

Developing against uncompressed code thus allows you to see what's causing problems and fix. Minified jQuery should always be used in production, and the core functionality of jQuery shouldn't be tweaked - that's what plugins are for.

edit 5/2014: Source maps have been implemented in many browsers to allow debugging of minified code. https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#source-maps


It just makes it much easier to read the source code of jQuery, especially during debugging to see what is happening with a problem in your application.


It's for Debugging (although I would argue that if you're using jQuery, you should be looking through the source to understand it).

In ASP.NET at least, when using the ScriptManager control, you can assign one script to use in Debug mode and another to use in Release mode, so using the uncompressed version in debug allows you to step through the source and figure out if an issue you're having is coming from there, but when you finally build the release, you'll use the minified and gzipped version.

0

精彩评论

暂无评论...
验证码 换一张
取 消