Hacker News new | ask | show | jobs
by TazeTSchnitzel 4806 days ago
>So you'll rewrite .addClass() and .removeClass()

Or, you'll use element.classList.add()

>You'll rewrite .ajax() and .when()

XHR isn't really too verbose.

>So you'll rewrite .animate()

Or you'll do elem.style.transition = ... and use elem.addEventListener;

Really, the plain DOM isn't that bad. If you make one or two sugar methods, they'll be far, far, far smaller than jQuery, and probably far faster.

1 comments

classList won't work in IE < 10. XHR with promise is quite verbose. Transitions won't work in IE < 10. etc. These were examples, not a complete case list.

What's the point to use shims or polyfills if it means including some others libraries ?

JQuery is not slow. If you .addClass() two hundred divs, sure. But for basic DOM manipulations, it's fine.

JQuery is not heavy. 32kb. It may be in cache. You'll likely gain that twice 32kb by optimizing your png.

This anti-JQuery war is a silly fad started by people who don't make websites.

And as per arguments like "a fadein should not be mandatory blablabla", explain it to the client. It may work. Or it may not.

Yes, but I'm not dealing with clients. I'm dealing with users of fun websites I make, and they aren't using oldIE. So I have a different set of requirements. I don't need jQuery, but you do.
It actually works in IE 8 and up (via shim): https://developer.mozilla.org/en-US/docs/DOM/element.classLi...