Re:A summary of jQuery method alternatives in native browser...
by iSnow on Friday March 31, 2017 @06:09AM
(#14002414)
Hm, over here, the 3.2-version of jQuery comes in as something like 85Kb, 323Kb when zipped. The slim build under 70Kb and compressed it's something like 20Kb. And there's zepto which comes in at around 10Kb.
Re:A summary of jQuery method alternatives in native browser...
by ge96 on Friday March 31, 2017 @02:37PM
(#14006702)
Haven't heard of Zepto. Will check that out. I realize too that ~70KB is not bad really. But I was working on a site for a client where their internet speed is 0.3Mbps and a ~300KB file was taking ~300ms+ to load. No maybe more than that actually(can't recall right now). 1KB files were taking a second to load. I don't know, had to figure out a closer data center and change the site a lot with how it loaded stuff.
Re:A summary of jQuery method alternatives in native browser...
by Jazcash on Friday March 31, 2017 @06:12AM
(#14002423)
The full version is 30KB after gzipping
Re:A summary of jQuery method alternatives in native browser...
by pluma on Friday March 31, 2017 @07:47AM
(#14002804)
FWIW while gzipped sizes are more interesting for network performance, non-gzipped sizes give a better approximation for parsing times, which can be significant on low-powered mobile devices.
Still including a 200+kb file for jQuery... to just use well these are the most common ones I use:
var targ = $("#targ"); targ.show,.hide,.val(),.text(),.css,.post(),.done,.promise(),.each(),.remove(),.on('blur" or .on({ blur: mouseup, .height(), .width(), .scrollTop(), etc...
Probably much more, yeah certainly shorter code, gotten used to using it.
edit: At this time I always build with jQuery, always include it in the <head> section. Could wait if it's a potential thing to slow down loading of site but I usually just have a copy on my server.