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

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

programmeradmin0浏览0评论

Jquery 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 Unpressed 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, Unpressed Code) 

Jquery. 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 Unpressed 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, Unpressed Code) 
Share Improve this question edited Dec 23, 2009 at 16:49 Jitendra Vyas asked Dec 23, 2009 at 16:41 Jitendra VyasJitendra Vyas 153k240 gold badges586 silver badges867 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

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 unpressed code. This makes it very, very difficult to figure out what exactly caused the problem.

Developing against unpressed 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./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 unpressed version in debug allows you to step through the source and figure out if an issue you're having is ing from there, but when you finally build the release, you'll use the minified and gzipped version.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论