I noticed that there is always a "min" version (stands for mini?) for most JavaScript libr开发者_如何学编程aries (e.g., jQuery).
What is the difference? Less functionality but smaller size?
Is this something someone should consider using? (There are a lot of min versions out there.)
The functionality is exactly the same - just open the minified and the "normal" versions in a text editor and you'll see the difference.
The min-Versions are just there to provide reduced filesize, to save you bandwith and traffic ;-)
...in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code, without changing its functionality.
http://en.wikipedia.org/wiki/Minification_(programming)
Its been "minified". All the functionaility is there, just in a minified version that is smaller for saving transfer bandwidth.
Things to become "minified":
- Remvoing whitespace
- Renaming some variables - such as function-scoped variables, not function names.
Here is an example
function myFunction(someReallyLongParamName)
{
someReallyCrazyName = someReallyLongParamName;
}
could be come
function myFunction(a){b=a;}
Minified versions just have whitespace removed, to make them faster to download. Otherwise, they are identical.
no, exactly the same function, the text has been minimized to reduce the download, this means you cant really debug in it but you do get the same functionality
Smaller size because all of the white space is removed from the file. Just open both files in text editor and you will see.
This is a version of jQuery that has a smaller file size (minified). Same functions, just a smaller file that the browser has to download.
same functions...smaller size. Think of it as poor mans compression. They simply remove all unneccessary whitespace.
If you look at jquery.com you'll usually see the minified version is classified as the "production" version. Other than that, as others have said, they're the same file, one larger (byte size) than the other.
精彩评论