开发者

Minified Sizzle

开发者 https://www.devze.com 2022-12-30 11:51 出处:网络
I can\'t find minified sizzle =( And if i trying to make it myself by yuicompresso开发者_高级运维r, after that, some features not work.

I can't find minified sizzle =( And if i trying to make it myself by yuicompresso开发者_高级运维r, after that, some features not work. Please help.


Get the latest uncompressed version here and compress it using any of these free tools:

  • JSCompress
  • YUI Online version (Check minify only!)

The above are all paste/get result, not console applications, so pretty quick to get results. The reason a minified version isn't maintained is it's not meant to be a standalone library, but rather integrated into whatever's using it...so the build processes/minification of the whole library, e.g. jQuery or Prototype 2.0 would include minifying Sizzle.


Try using the minifier at http://fmarcia.info/jsmin/test.html to minify it on your own.


The sizzle website claims "Only 4KB minified and gzipped". Most webservers serve the contents gzipped (transparently).

So I guess if you minify it, then your webserver serves it gzipped, then the transmission will only be 4K. You can probably check that with a packet capture tool (like wireshark). I don't think there is a way to include a gzipped script in your HTML sources, it has to be done at the server level.


The basic function of Sizzle can be replicated as such:

function Sizzle(query){return document.querySelectorAll(query)}

All done. No need for library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号