3 ms·
jQuery once was designed to overcome JavaScript API differences in browsers and provide cross browser DOM manipluation and event handling, while still being as
by sandreas 4y ago
jQuery once was designed to overcome JavaScript API differences in browsers and provide cross browser DOM manipluation and event handling, while still being as user friendly as possible - and it worked very good. You did not have to care - just use jQuery and you were done with cross browser stuff.
But it came at a cost. jQuery basically is a function that is linked to '$':
function jQuery() {
// ...
}
$ = jQuery;
The problem with jQuery today is, that most of the time the cross browser stuff is no longer necessary and therefore slows down your app drastically (especially hooking in every event handler). Most jQuery 'advanced' features are not used very often. This basically means, that in simple apps you could nearly replace jQuery with:
$ = document.querySelectorAll;
jQuery is also often very inconsistent. Take for example the function itself - you can use different types of arguments (jQuery(function(){}), jQuery('string'), jQuery([]), etc.). In a small app, this does not make a difference, but nowadays, with HUGE JavaScript applications, this can be a real problem.
Most users liked the easy API of jQuery and don't know about these facts, so jQuery often is still the way they go...