jquery-min version?

2019-01-25 04:40发布

I noticed that there is always a "min" version (stands for mini?) for most JavaScript libraries (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.)

8条回答
Root(大扎)
2楼-- · 2019-01-25 05:09

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 ;-)

查看更多
太酷不给撩
3楼-- · 2019-01-25 05:13

same functions...smaller size. Think of it as poor mans compression. They simply remove all unneccessary whitespace.

查看更多
beautiful°
4楼-- · 2019-01-25 05:16

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;}
查看更多
相关推荐>>
5楼-- · 2019-01-25 05:17

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

查看更多
聊天终结者
6楼-- · 2019-01-25 05:17

Smaller size because all of the white space is removed from the file. Just open both files in text editor and you will see.

查看更多
乱世女痞
7楼-- · 2019-01-25 05:21

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

查看更多
登录 后发表回答