You Don't Need JQuery
11–20 of 201 posts
Re: You Don't Need JQuery
#12https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0Rlh...
Pretty sure they're not all fixed, and this is just the ignorance du jour.
Re: You Don't Need JQuery
#13You 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");
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
Re: You Don't Need JQuery
#14You 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
#15Re: You Don't Need JQuery
#16I 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
#17Every 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…
Real bundling with tools like Browserify is making it more and more feasible to use single-purpose libraries instead of monolithic ones like jQuery.
Re: You Don't Need JQuery
#18You 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…
.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
[].map.call(document.querySelectorAll(".foo"), function(node) { node.classlist.remove("bold"); })Re: You Don't Need JQuery
#19You 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…
.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