You Don't Need JQuery
111–120 of 201 posts
Re: You Don't Need JQuery
#112Earlier quoted context omitted.
I care as much for Android 2.x as ie below 10.
And probably 80% of our startup's revenue comes from banks stuck using IE8.
Re: You Don't Need JQuery
#113Earlier quoted context omitted.
jQuery is usually cached in your browser because of how common it is. From what I understand, the slowing is negligible. Part of a developer's role is to mitigate site performance with the speed of process. Inlining of critical CSS is one way to balance out initial page load, for example.
This is part myth. The chances your site has the same version of jQuery that the visitor's browser cache is are pretty low. iirc, someone once said it was less than 5%.
Re: You Don't Need JQuery
#114Re: You Don't Need JQuery
#115Earlier quoted context omitted.
and slowing down your website
well that's the trade-off, isn't it? unless my app is speed-heavy, i'm not gonna spend the extra man-hours needed (that jquery saves me) so that website runs negligibly faster.
Re: You Don't Need JQuery
#116Every 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…
Life is definitely too short to not be using npm, browserify and React! https://www.npmjs.com/package/browserify https://www.npmjs.com/package/react And then use just what modules you need. All the functionality of jQuery has already been ported to various modules. https://www.npmjs.com/package/extend https://www.npmjs.com/package/promise https://www.npmjs.com/package/serialize-form
Re: You Don't Need JQuery
#117You 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').className =
document.getElementById('foo').className.replace(/^bold$/, '');
fail if the element in question has more than one class? In that case, you'd need to get the className attribute, split it by spaces, do the replacement in the resulting array, and then join back and assign, I believe.[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element.cla...
Re: You Don't Need JQuery
#118This guy's argument is strikingly similar to that of the one made by those people who are anti-Apple, despite the fact that working with Apple products is a commonly pleasant experience, simply for the fact that they're Apple. Just because a lot of people use something that they're not being forced to use doesn't necessarily mean that they've been "tricked" into doing so.
Using Apple products is a pleasant experience. Using jQuery is to avoid learning how to code while purporting that it makes things easier cross browser. Of course, if that were the real reason, we would also have cQuery and c++Query and so on but, instead, we just learn how to code.
Re: You Don't Need JQuery
#119Re: You Don't Need JQuery
#120The AJAX examples fall a little flat. Yes, .ajax is a wrapper, and it was written because the API for XMLHTTPRequest is needlessly complicated and verbose. If you're developing a single page application, you only load jquery once, then do the rest with AJAX calls for JSON and assets. It's worth the <100 KB on initial page load, at least for the projects I've worked on.