jquery-min 版本?

发布于 2024-08-18 11:57:44 字数 121 浏览 6 评论 0原文

我注意到大多数 JavaScript 库(例如 jQuery)总是有一个“min”版本(代表 mini?)。

有什么区别?功能较少但尺寸较小?

这是有人应该考虑使用的东西吗? (有很多最小版本。)

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

琉璃梦幻 2024-08-25 11:57:45

...在计算机编程语言中,尤其是 JavaScript,是从源代码中删除所有不必要的字符的过程,不改变其功能

http://en.wikipedia.org/wiki/Minification_(programming)


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

醉生梦死 2024-08-25 11:57:45

它被“缩小”了。所有功能都在那里,只是在一个缩小版中,该版本更小以节省传输带宽。

要“缩小”的事情:

  • 删除空格
  • 重命名一些变量 - 例如函数范围的变量,而不是函数名称。

这是一个

function myFunction(someReallyLongParamName)
{
    someReallyCrazyName = someReallyLongParamName;
}

例子

function myFunction(a){b=a;}

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;}
暗地喜欢 2024-08-25 11:57:45

缩小版本只是删除了空格,以使其下载速度更快。否则,它们是相同的。

Minified versions just have whitespace removed, to make them faster to download. Otherwise, they are identical.

凉栀 2024-08-25 11:57:45

不,完全相同的功能,文本已最小化以减少下载,这意味着您无法真正在其中进行调试,但您确实获得了相同的功能

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

め七分饶幸 2024-08-25 11:57:45

尺寸更小,因为所有空白都从文件中删除。只需在文本编辑器中打开这两个文件,您就会看到。

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

我的影子我的梦 2024-08-25 11:57:45

这是文件大小较小(缩小)的 jQuery 版本。功能相同,只是浏览器需要下载的文件较小。

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.

烟凡古楼 2024-08-25 11:57:45

相同的功能...更小的尺寸。将其视为穷人的压缩。他们只是删除所有不必要的空白。

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

红尘作伴 2024-08-25 11:57:45

如果您查看 jquery.com,您通常会看到缩小版本被分类为“生产”版本。除此之外,正如其他人所说,它们是同一个文件,一个比另一个大(字节大小)。

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.

森林散布 2024-08-25 11:57:44

功能完全相同 - 只需在文本编辑器中打开缩小版本和“正常”版本,您就会看到差异。

最小版本只是为了减少文件大小,节省带宽和流量;-)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文