I recently did a project that didn't use jQuery in order to keep my code smaller. It was an embedded 3rd-party widget, so keeping the code as small as possible was a key requirement. The code I wrote supports down to IE7, but IE7 wasn't really the biggest issue. The real problem with not using jQuery is that all of the collective knowledge we have about browser inconsistencies is encapsulated in jQuery. When you run…
http://caniuse.com/
You might not need jQuery
271–280 of 360 posts
Re: You might not need jQuery
#272Earlier quoted context omitted.
You don't need an abstraction to do something that's natively implemented on your platform.
No thanks, I'll take something that I'm sure 99% of web developer know by heart and works cross browser. I don't want/need to spend hours upon hours writing "clean" code that doesn't use jQuery. I have business problems to solve.
Re: You might not need jQuery
#273Earlier quoted context omitted.
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
are you serious ? thats actually a good example on why you should use jquery. First of all the dev needs to know exactly on which platforms he will run into problems and how to solve them...And what if you need not one but several polyfills ? That gets messy pretty quickly.
What if you need several polyfills? Drop them in too. You should always know what browser feature you are using. The same argument goes for using libraries. What if you need more than jQuery? Bring them in too. There are asset pipelines and/or pure front end packaging solutions like AMD to help you. What's the problem?
Re: You might not need jQuery
#274Earlier quoted context omitted.
Care to substantiate your benchmark where you compare jQ1, jQ2, and the native DOM API?
Here is the mentioned pull request: https://github.com/jashkenas/backbone/pull/2959 Here is his benchmark: http://jsperf.com/backbone-patch-22be8f9/2 It only compares jQuery 1 and the DOM API, no jQuery 2. TestBaseView: DOM API TestPaulView: Reduced jQuery usage TestView: jQuery
Re: You might not need jQuery
#275Earlier quoted context omitted.
JavaScript is a dynamic language, and it is arguably the case that many of the frameworks that exist for it hide or transform enough of the "native" implementation details as to be different languages. Or supersets of it, if you like. I don't think it's at all unreasonable to suggest that a developer who uses jQuery (or any other framework) doesn't have to have more than a vague, fleeting understanding of the "native…
Such a viewpoint would be ignorant of the distinction between a language and an API.
Re: You might not need jQuery
#276No, 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…
Re: You might not need jQuery
#277Re: You might not need jQuery
#278Earlier quoted context omitted.
Such a viewpoint would be ignorant of the distinction between a language and an API.
Yes, that's rather the parent's point, I think.
Re: You might not need jQuery
#279Re: You might not need jQuery
#280No, 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…
Size really is issue when dealing with mobile devices. Even from disk cache each KB increases startuptime by about 1ms (and jquery 2 is ~32kb minified, for Also, last time I checked jquery uses "querySelectorAll" for that fancy $("selector") syntax, which is slow as hell with every possible browser compared to "getElementBy*". This might not be issue with desktop machines, but you will probably lose most of your mobi…