Earlier quoted context omitted.
.classlist() [1] is coming [2]. It'll allow you to do: document.getElementById('foo').classList.remove("bold"); Sure, it's still more verbose. But a lot of what jQuery does is slowly being obsoleted by better native javascript apis. [1] https://developer.mozilla.org/en-US/docs/Web/API/Element.cla... [2] http://caniuse.com/#feat=classlist
So when those new native api functions arrive, jQuery will start using them and gain some performance boost (using native vs. custom js code) while at the same time remaining backwards compatible (by doing feature detection). No one wants to write their own feature detection code so this whole page about using native apis is instead of jQuery is ridiculous. If the point of that website was to educate people on the ap…
You Don't Need JQuery
81–90 of 201 posts
Re: You Don't Need JQuery
#82Re: You Don't Need JQuery
#83When I first read this post, I thought the link may be to this website: http://youmightnotneedjquery.com/ . I developed a Cordova application recently, and I only needed jQuery for Bootstrap. All custom JS was able to be done using the DOM API. However, I was spoiled since I only had to develop against a recent webkit version (my target was iOS 7)
Re: You Don't Need JQuery
#84Every time I try to build something without jQuery, I regret it. Not because of selectors, that's (sometimes) easy to do for lots of (basic) selectors. Not because of DOM manipulation, as long as you're willing to sacrifice simplicity and readability, you can build iterative loops to modify a collection of HTML elements. No, it's the unexpected things that cause me pain. Want to use event handlers on dynamically gene…
There are other libraries though which provide (IMHO better) implementations of each of those things. jQuery has been around for ten years and has to remain backwards compatible. It's just not possible for it to be the best implementation of Promises, or AJAX or any of the other individual things it does. Real bundling with tools like Browserify is making it more and more feasible to use single-purpose libraries inst…
Re: You Don't Need JQuery
#85jQuery is a framework, like many others. Programming is not about learning frameworks, it's about learning the language, it's runtime behaviours and of course software development in general. Frameworks are there to speed up development time.
Re: You Don't Need JQuery
#86You can basically sum up this entire rather ridiculous site with "Yes, you don't need jQuery, you can just use the built-in methods, but using jQuery is generally more pleasant, more consistent, and involves less typing". One particularly egregious example from the site: $('#foo').removeClass('bold'); vs. document.getElementById('foo').className = document.getElementById('foo').className.replace(/^bold$/, ''); The au…
document.getElementById('foo').classList.remove('bold'); see https://developer.mozilla.org/en-US/docs/Web/API/Element.cla...
Re: You Don't Need JQuery
#87Re: You Don't Need JQuery
#88Re: You Don't Need JQuery
#89Right off the bat, on the first 3 examples, he shows how you need to use different APIs depending on the IE version. That alone is enough reason to use jQuery and not having to bother.
You're pointing out an IE problem, not a javascript problem that isn't present in other browsers.
Re: You Don't Need JQuery
#90You can basically sum up this entire rather ridiculous site with "Yes, you don't need jQuery, you can just use the built-in methods, but using jQuery is generally more pleasant, more consistent, and involves less typing". One particularly egregious example from the site: $('#foo').removeClass('bold'); vs. document.getElementById('foo').className = document.getElementById('foo').className.replace(/^bold$/, ''); The au…
It's like saying "You don't need a web browser at all -- See how we can navigate the web using cURL!"