Simon Willison’s Weblog

Subscribe

What are all the advantages of jQuery?

27th October 2010

My answer to What are all the advantages of jQuery? on Quora

jQuery’s API is astonishingly well designed. It’s extremely consistent once you learn its rules (e.g. methods often take one argument to read a value and two arguments to set one, e.g. .css(), .attr(), .width(), .height()) and its functionality is so complete that the last few major releases of the library have hardly added any new methods at all.

jQuery’s performance improves noticeably with every release, with the API staying exactly the same.

jQuery plays extremely well with other code. It doesn’t extend any built-in JavaScript objects, and it only adds one symbol to the global namespace (the jQuery symbol)—it aliases $ as well, but you can undo that with jQuery.noConflict().

Even discounting browser differences, jQuery is an enormous improvement on the DOM. It makes DOM manipulation extremely easy, which means it’s much easier to implement things using progressive enhancement—taking existing DOM elements on the page and enhancing their behaviour.

This is What are all the advantages of jQuery? by Simon Willison, posted on 27th October 2010.

Next: What is the best way to integrate MongoDB with Django?

Previous: Why does Python load imported modules separately for different files, unlike C or PHP? Isn't that inefficient in terms of memory usage?

Monthly briefing

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Pay me to send you less!

Sponsor & subscribe