作者:gfhhhgh_130 | 来源:互联网 | 2023-01-29 19:20
原因是用了jquery-3.2.1.slim.min.js,换成jquery-3.2.1.min.js就好了
关于两者的区别
看官方描述:
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.
就是去掉了ajax的功能。如果你不需要用到ajax或者使用了独立的第三方ajax库,就可以使用这个jquery.slim.js,这是个瘦身版,而不是什么插件。