Julien Richard-Foy’s blog

Don’t use jQuery to write a web application (part 1)

jQuery is a “fast and concise” JavaScript library which tends to be used by everybody in almost every web project and is included by default by several frameworks. Despite having very interesting qualities (I really like its fluid chaining API and its conciseness), I don’t think using jQuery by default in all your Web projects is a good idea. I’ll explain why.

Say you’re writing a web app showing lists of items. Users can add items by clicking on a “Add” button. You want the user experience to be nice (and you want to save some of your server bandwidth) so you don’t reload the whole page each time the user adds an item: you update the only part of the document that has changed. You perform this task in JavaScript and you decide to use jQuery because every others do so.

Basically the markup we’re interested in looks like that: