Possible Dup开发者_如何学JAVAlicate:
jquery-min version?
These two files are already included while creating a new project in VS2010 . In jquery-1.4.1.js , variables are more readable and comments are minimal . So what is the exact difference between these two ? Is it something like some features are not available in min.js ? Thanks in Advance..
No, there shouldn't be any difference at all. The .min version has been minified - it's stripped down to functionally equivalent code with shorter variable names, no comments etc., so that it's a smaller, faster download. Your browser's javascript engine won't notice the difference.
You should prefer the .min version for your production code but non-minified verison is far easier to debug with.
No, if you look at the source of min version you'll notice it not very much readable. The normal version is for those who may want to read the source and make changes.
If you're only using the library you should use min version, as your clients would need less bandwidth and time to download it.
The min.js file has been minified for more efficient use in a live environment. The normal .js file is for debugging, because as you say, it's more readable.
The files have the exact same functionality. The 'min.js' file has been 'shrunk' so it is smaller in size and takes less time to be downloaded to the client machine.
Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times. When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced. Two popular tools for minifying JavaScript code are JSMin and YUI Compressor.
http://developer.yahoo.com/blogs/ydn/posts/2007/07/high_performanc_8/
min is just a "compressed version". Min is for minified
精彩评论