📜 ⬆️ ⬇️

You can do without jQuery

jQuery is almost a standard library of any web developer. While developing websites and web applications almost never makes sense to give up library code licked to the last byte in order to save several tens of kilobytes when loading, then when writing libraries, rejecting unnecessary dependency looks much more tempting. It may well be that it is enough to include in your code just a couple of dozen lines that implement one or more jQuery functions. Yes, and issues of compatibility and standards compliance in modern browsers are no longer as acute as a few years ago.

In January of this year, a project was launched, the purpose of which is to build a collection of snippets that show how you can implement popular jQuery functions in pure JavaScript. The project, called "You might not need jQuery", is hosted on GitHub . All snippets collected together can be viewed on the project page . Several dozen code fragments are devoted to working with DOM elements and effects, events, AJAX requests, auxiliary functions such as bind , extend , map .

The authors of the project emphasize that it is possible and necessary to refuse to use jQuery, but only if you understand very well what you are doing. They provide a document that contains links to lines in jQuery, which handle bugs and incompatibilities in individual browsers. There are about a hundred such links there - a good reason to think about whether you really really need to do without jQuery.


')

Source: https://habr.com/ru/post/211961/


All Articles