aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2022-09-18-jqueries.md
blob: a0706f0c90c5531bfb94db39b8500d8d71762593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
slug: jqueries
title: "jQueries"
date: "2022-09-18T06:50:05-04:00"

pics:
  jqueries:
    css: "image"
    tip: "jQueries: One page, every jQuery."
    sources:
      - "/files/posts/jqueries/jqueries.webp"
      - src: "/files/posts/jqueries/jqueries.png"
        width: 800
        height: 355
---
Some people dislike [jQuery][] because it isn't really needed for
modern browsers (see [You Might Not Need jQuery][]).

Many older sites embed multiple versions of [jQuery][], often as a
[transitive dependency][].

I thought "wouldn't it be funny if there was a page that loaded *all*
versions of [jQuery][]?".

Behold:

[{{< pe-figure "jqueries" >}}][jqueries]

Notes:

* Embeds every version of [jQuery][] from 1.2 to 3.6.1, including the
  slim builds.
* Each version of [jQuery][] animates it's own row.  See the [unminified
  `script.js`][script.js] for details.
* You may have trouble hosting [jQueries][] if you have a restrictive
  [`Content-Security-Policy`][csp] ([like mine][min-csp]). In
  particular, versions of [jQuery][] older than 1.4.0 will fail
  to load.
* Deliberately serves up old versions of [jQuery][] with known security
  vulnerabilities.  Be careful where you host this.

Source code, build instructions, and additional details are available in
the [GitHub repository][repo].

[jquery]: https://jquery.com/
  "jQuery"
[transitive dependency]: https://en.wikipedia.org/wiki/Transitive_dependency
  "Dependency that is depended on indirectly by another dependency."
[jqueries]: https://pablotron.github.io/jqueries/
  "jQueries: A page which uses (almost) every version of jQuery"
[you might not need jquery]: https://youmightnotneedjquery.com/
  "You might not need jQuery."
[script.js]: https://github.com/pablotron/jqueries/blob/main/public/js/script.js
  "Unminified version of script.js."
[csp]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  "Content-Security-Policy HTTP header."
[min-csp]: {{< relref "posts/2021-10-25-the-nuclear-option-no-more-unsafe-inline.md" >}}
  "Post about minimal Content-Security-Policy header on this site."
[repo]: https://github.com/pablotron/jqueries
  "jQueries GitHub repository."