Skip to content

Commit f83c154

Browse files
committed
Create jQuery 4 cheat sheet
0 parents  commit f83c154

15 files changed

Lines changed: 2693 additions & 0 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Report a problem with the GitHub Pages site or repo tooling
4+
title: "[Bug]: "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
Describe what is broken.
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Result
20+
21+
Describe what should happen.
22+
23+
## Actual Result
24+
25+
Describe what happened instead.
26+
27+
## Environment
28+
29+
- Browser:
30+
- Device:
31+
- Page URL or section:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Content correction
3+
about: Report an inaccurate or unclear jQuery 4 example
4+
title: "[Content]: "
5+
labels: content
6+
assignees: ""
7+
---
8+
9+
## Entry
10+
11+
Link to the section or name the affected entry.
12+
13+
## Correction
14+
15+
Describe the correction.
16+
17+
## Official Source
18+
19+
Add the official jQuery URL that supports the correction.

.github/workflows/validate.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
data:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
19+
- name: Validate cheat sheet data
20+
run: node scripts/validate-data.js

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
*.log
3+
site-screenshot.png
4+
.DS_Store
5+
Thumbs.db

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributing
2+
3+
Thanks for improving this jQuery 4 cheat sheet. Keep changes factual, short, and useful for beginners.
4+
5+
## Content Rules
6+
7+
- Verify API behavior against official jQuery documentation before editing examples.
8+
- Use jQuery 4-safe examples.
9+
- Do not add removed APIs except inside the removed API section.
10+
- Prefer short examples that show one concept.
11+
- Use explicit CSS units in `.css()` and `.animate()` examples.
12+
- Mark each entry with one `jquery4Status`: `current`, `changed`, `removed`, or `caution`.
13+
- Include an official jQuery URL for every entry.
14+
15+
## Data Format
16+
17+
Edit `data/jquery-4-cheatsheet.json` for content changes.
18+
19+
```json
20+
{
21+
"id": "events-on",
22+
"title": "Attach an event handler",
23+
"syntax": ".on(events[, selector], handler)",
24+
"example": "$(\".save-button\").on(\"click\", function () {\\n $(this).text(\"Saving...\");\\n});",
25+
"notes": ".on() is the main event API for current jQuery code.",
26+
"jquery4Status": "current",
27+
"replacement": "",
28+
"officialUrl": "https://api.jquery.com/on/"
29+
}
30+
```
31+
32+
## Checks
33+
34+
Run:
35+
36+
```bash
37+
npm run validate
38+
```
39+
40+
Review the Pages site locally:
41+
42+
```bash
43+
npm run serve
44+
```
45+
46+
Open `http://localhost:4173` and check search, filters, copy buttons, dark mode, and mobile layout.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 jquery-4-cheatsheet contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)