4 ms·
How to be jQuery-free?
- onion2k 13y agoThis 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-build-your-own-custom-jquery/ http://net.tutsplus.com/tutorials/javascript-ajax/how-to-bui... 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 13y agoI think there is a risk using CDN. If somehow the CDN server is down, then our app will have issues.
- whichdan 13y agohttp://stackoverflow.com/questions/1014203/best-way-to-use-googles-hosted-jquery-but-fall-back-to-my-hosted-library-on-go http://stackoverflow.com/questions/1014203/best-way-to-use-g... It's really easy to fallback to a local copy if the CDN server is down.
- franzwong 13y agoThe pop up window of your site is quite annoying
- pikexxn 13y agoThank 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.