

How to be jQuery-free? - pikexxn
http://www.pixelstech.cn/article/1368463977_How_to_be_jQuery-free_

======
onion2k
This is "wrong" on a few things...

Firstly, since 1.8 it's possible to remove bits of jQuery that you don't use,
so it doesn't have to be as big as even the minified and gzipped production
version (~32kb). [http://net.tutsplus.com/tutorials/javascript-ajax/how-to-
bui...](http://net.tutsplus.com/tutorials/javascript-ajax/how-to-build-your-
own-custom-jquery/) is a decent tutorial on that.

Secondly, worrying about the size ignores the advantages of using a CDN. With
about 90% of dynamic sites using it, using, for example, the Google CDN
version means a single round trip to Google and 0kb to download as it'll
already be in the user's cache. That's better than rolling your own functions
if you're really worried about code size.

Lastly, why care about the size of a library anyway? For 99% of users it's a
trivial download and it'll be there within the first 0.5s of their experience
on the site so it's not impacting very much at all. The additional dev+testing
time to roll your own functions for things jQuery gives you for free is more
important than a few extra kb saved on page size. You'd save more bandwidth
optimising a single image properly on the majority of websites rather than
removing jQuery.

However...

The article isn't wrong in the sense that it's always good to know how to code
things without library support if necessary. Many (most?) front-end JS
developers _can't_ work without jQuery, and that's a very bad thing. There
might be a time when you need to code something that jQuery can't do.

~~~
infosys
I think there is a risk using CDN. If somehow the CDN server is down, then our
app will have issues.

~~~
whichdan
[http://stackoverflow.com/questions/1014203/best-way-to-
use-g...](http://stackoverflow.com/questions/1014203/best-way-to-use-googles-
hosted-jquery-but-fall-back-to-my-hosted-library-on-go)

It's really easy to fallback to a local copy if the CDN server is down.

------
franzwong
The pop up window of your site is quite annoying

~~~
pikexxn
Thank you for your comment. The "Do not show again" checkbox is not working?
We think you can check that one if you don't it to pop up again.

