gitmyhub

youmightnotneedjquery

Astro ★ 14k updated 1y ago

A reference website showing how to replace jQuery with plain built-in JavaScript, organized as side-by-side code comparisons for modern browsers and older Internet Explorer versions.

JavaScriptAstroNode.jsnpmsetup: easycomplexity 1/5

This project is the source code behind the website You Might Not Need jQuery. jQuery is a long-popular JavaScript library that web developers have used for years to do common tasks in the browser, such as finding elements on a page, reacting to clicks, or loading data. Over time, plain JavaScript built into browsers gained many of the same abilities, so jQuery is often no longer required. This resource exists to show people how to do those everyday tasks without it.

The README is short and points mainly to the live site at youmightnotneedjquery.com, where the actual content lives. The repository holds the code that builds that site. Based on the contributing notes, the site is organized into sections, and each section compares how a task is done in jQuery against how it is done in plain JavaScript.

One interesting detail is how the project handles different browser versions. To add a new example, a contributor creates a folder and adds files for the jQuery version plus plain-JavaScript versions aimed at different targets: older Internet Explorer versions 8 through 11, and a modern file for current browsers like Chrome, Safari, and Firefox. The site then shows the right version depending on which browsers a visitor needs to support.

Building the site yourself requires Node.js. The steps given are to run npm install to get the dependencies, then npm run dev to build and watch for changes while you work, or npm run build to produce the site once.

The repository is listed as using Astro, a tool for building websites. The README does not go further than this, so the bulk of the educational material is on the website rather than in the README itself.

Where it fits