在CDNJS jquery。纤细的包裹被放置。它的尺寸更小。与原作的主要区别是什么?快速查看代码并没有带来答案,在https://jquery.com我没有找到任何关于苗条包的参考资料。
那么,jquery.js和jquery.slim.js之间有什么区别呢?
在CDNJS jquery。纤细的包裹被放置。它的尺寸更小。与原作的主要区别是什么?快速查看代码并没有带来答案,在https://jquery.com我没有找到任何关于苗条包的参考资料。
那么,jquery.js和jquery.slim.js之间有什么区别呢?
当前回答
jQuery博客,jQuery 3.1.1发布!说,
Slim build Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for all your web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules. All in all, it excludes ajax, effects, and currently deprecated code. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version – 23.6k vs 30k.
其他回答
下面是jQuery 3.0最终版发布公告中的简短回答:
除了包含ajax和effects模块的常规jQuery版本外,我们还发布了一个不包含这些模块的“精简”版本。总而言之,它排除了ajax、特效和当前已弃用的代码。
文件大小(gzip)大约小了6k, 23.6k vs 30k。
如上所述,Ajax和特效模块已经被排除在jQuery slim之外,缩小版解压后的尺寸差异为85k vs 69k(精简版节省16k)或压缩版30vs24,需要注意的是,bootstrap 4使用的是精简版jQuery,所以如果有人想要完整版,他们需要调用它
查看代码,我发现jquery.js和jquery.slim.js之间有以下差异:
在jquery.slim.js中,删除了以下特性:
jQuery.fn.extend jquery.fn.load jquery。每个(附加一堆处理常见AJAX事件的函数) jQuery.expr.filters.animated AJAX设置(jQuery.ajaxSettings。xhr, jQuery。ajaxPrefilter, jQuery。ajaxSetup, jQuery。ajaxPrefilter jQuery.ajaxTransport) XML解析,jQuery.parseXML 动画效果(jQuery。宽松,jQuery。动画,jQuery.speed)
jQuery博客,jQuery 3.1.1发布!说,
Slim build Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for all your web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules. All in all, it excludes ajax, effects, and currently deprecated code. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version – 23.6k vs 30k.
我发现在创建表单联系人时有一个区别: 苗条(boostrap 4.5推荐):
在发送电子邮件后,全局变量卡住了,这使得如果用户给出f5(重载页面),它会再次发送。 分钟: 之前的错误将被解决。我多么痛苦啊!