Skip to content

Upgrade to jQuery v3 - #9275

Open
gbp wants to merge 3 commits into
developfrom
jquery3
Open

Upgrade to jQuery v3 #9275
gbp wants to merge 3 commits into
developfrom
jquery3

Conversation

@gbp

@gbp gbp commented May 20, 2026

Copy link
Copy Markdown
Contributor

What does this do?

Upgrade to jQuery v3

Why was this needed?

The sprockets manifests required 'jquery' which resolved to jQuery 1.12.4. That version uses setAttribute(eventName, "t") for feature detection, which triggers CSP script-src-attr violations.

jQuery 3.4+ removed this feature detection. Switch to 'jquery3' which resolves to jQuery 3.7.1 shipped by jquery-rails 4.6.1.

gbp added 3 commits May 20, 2026 09:20
Replace .bind() with .on(), .unbind() with .off(), and $.error() with
throw new Error() to prepare for jQuery 3 upgrade. These APIs were
removed in jQuery 3.0.
Replace $.isFunction() with typeof === 'function' in jquery.flot and
jquery.flot.errorbars. Replace $.isArray() with Array.isArray() in
selectize. Replace $.error() with throw new Error() in dropit.

These jQuery utility methods were removed in jQuery 3.0.
The sprockets manifests required 'jquery' which resolved to jQuery
1.12.4. That version uses setAttribute(eventName, "t") for feature
detection, which triggers CSP script-src-attr violations.

jQuery 3.4+ removed this feature detection. Switch to 'jquery3' which
resolves to jQuery 3.7.1 shipped by jquery-rails 4.6.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant