You might not need jQuery
201–210 of 360 posts
Re: You might not need jQuery
#202I've never liked jQuery. I use it because I am forced to. However, I will not write my own animation library, selector engine, and other helper utilities it provides.
Re: You might not need jQuery
#203Earlier quoted context omitted.
Abstractions are meant to, well, abstract an implementation. You might very well want to abstract a native operation for a bunch of different reasons. You don't need to, but maybe you should. For example, $(el).hide() is quite more readable than el.style.display = 'none' . And I'm not even talking about the other advantages.
Its el.hidden = true; in modern browsers
" it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation — one could equally well just show all the form controls in one big page with a scrollbar"
Re: You might not need jQuery
#204I don't know if i need jQuery or not But your page is seriously a great "Cheat Sheet" for all jQuery Learners out there ! Thanks
Re: You might not need jQuery
#205Earlier quoted context omitted.
More to test than you thought. That just broke more than 20% of the Android installed base, since Android 2.3 doesn't work with classList.
A classList polyfill is like 500b compressed. No need to blow a non-existent problem out of proportion. https://github.com/remy/polyfills/blob/master/classList.js
You silly goose!
Re: You might not need jQuery
#206Oh wait -- that's what jQuery is!
Re: You might not need jQuery
#207No, please no. If size is an issue for some reason or you want to have no dependencies you can use something like http://zeptojs.com/ and just embed everything in one minified file. If you do things right only the functions you are actually using will get placed in there as well. Do not reinvent the wheel to solve problems that can't be solved in much cleaner and nicer ways. Managing dependencies can be annoying, but…
When writing web apps, brevity counts for a lot.
Re: You might not need jQuery
#208It's odd, but after reading everything and the examples at the end, I feel we need jQuery more than ever. Kind the opposite of the OP is stating. Great post though.
Re: You might not need jQuery
#209Earlier quoted context omitted.
I believe the point is that many libraries use about 1% of jQuery. That hardly justifies pulling in the entire thing. A personal anecdote: I recently un-jQueried a little piece of code and ended up with only a couple lines of extra code. Certain parts of jQuery are heavenly and well worth it, but really basic usage doesn't actually save that much. $("#something") instead of document.getElementById("something") is not…
I agree with the overall message- you should be thoughtful with all your dependencies. You should only add complexity when it makes sense. However, the author goes beyond just selector vs. getElementById(). Does the way the author uses XMLHttpRequest work in other browsers the way it works in IE? I honestly dont even remember anymore. How about the code for fade? I never even knew the details of this feature. And I'm…
Re: You might not need jQuery
#210No, please no. If size is an issue for some reason or you want to have no dependencies you can use something like http://zeptojs.com/ and just embed everything in one minified file. If you do things right only the functions you are actually using will get placed in there as well. Do not reinvent the wheel to solve problems that can't be solved in much cleaner and nicer ways. Managing dependencies can be annoying, but…
I believe the point is that many libraries use about 1% of jQuery. That hardly justifies pulling in the entire thing. A personal anecdote: I recently un-jQueried a little piece of code and ended up with only a couple lines of extra code. Certain parts of jQuery are heavenly and well worth it, but really basic usage doesn't actually save that much. $("#something") instead of document.getElementById("something") is not…