· via Hacker News – Front Page (native)
jQuery 4.1.0 ships jqXHR responseURL support, ReDoS fix and querySelectorAll switch
jQuery 4.1.0 adds a responseURL field to jqXHR, fixes a ReDoS flaw in selector identifier matching, swaps getElementsBy* lookups for querySelectorAll, and serializes form-associated custom elements.
jQuery 4.1.0 has been released. According to the release notes published on GitHub, the new version of the widely deployed JavaScript library adds a responseURL property to its Ajax layer, retires legacy DOM lookup methods in favor of querySelectorAll, patches a ReDoS flaw in selector parsing, and extends form serialization to custom elements. The release was featured on the Hacker News front page.
Ajax: jqXHR learns about responseURL
The most user-visible change lands in Ajax. jQuery's jqXHR wrapper — the object its Ajax methods return and pass to handlers — now carries a responseURL field, an addition tracked as issue #4339. The property mirrors the identically named one on the browser's native XMLHttpRequest object, which reports the final URL of a response after any redirects, so calling code can now find out where a request actually landed without dropping down to raw XHR.
Transports, the pluggable components that perform the underlying HTTP work, also gained an alternative completeCallback API for signaling that a request has finished, giving authors of custom transports a second mechanism alongside the existing one.
Core and CSS cleanups
In core, jQuery has stopped using getElementsByTagName and getElementsByClassName, routing those lookups through querySelectorAll instead (issue #3642). It is a small but meaningful modernization that aligns the library with the platform's current selector engine. Loops inside the library were also rewritten so they can no longer read past the end of an array, a quiet robustness improvement.
The CSS module received two fixes: an internal probe table used for table style tests is now emptied when it might be reused, and element creation for style handling goes through createElementNS, which extends support to XML documents.
Selector module: hardening and speed
The selector code saw the heaviest churn in this release. Most notably, it fixes a ReDoS (regular expression denial of service) problem in identifier matching — a class of bug where a crafted selector string can trigger pathological regex backtracking. Around it sit a workaround for a bug in Safari 27's regex interpreter, a correction to the escape-handling regex in unescapeSelector, decoding of invalid escape code points to the replacement character U+FFFD, faster duplicate removal in jQuery.uniqueSort, stricter behavior in quick selection paths, and looser document comparisons applied consistently.
Serialization, documentation and tests
Serialization now recognizes form-associated custom elements (issue #5245), meaning custom elements built against the web components form-integration APIs are handled like native controls when jQuery serializes a form.
On the documentation side, TuxCare is listed as a new commercial support vendor, and the project has added guidelines for machine-generated contributions — a direct acknowledgment of the rising volume of AI-assisted pull requests. Test changes include accepting both the older and newer :enabled and :disabled semantics for option and optgroup elements, re-enabling the AJAX binary data tests in IE, and new coverage for jQuery.text, .data() on SVG elements, callback-only animation signatures, and the ajaxPrefilter and ajaxTransport hooks.
Why it matters
jQuery is often written off as a relic, yet it still ships on a vast number of sites and remains one of the most deployed libraries in the web's history. Releases like 4.1.0 show that this install base is not frozen: the maintainers are tracking modern platform features such as querySelectorAll and form-associated custom elements, closing security-relevant gaps like the selector ReDoS, and even codifying policy for machine-generated code. For teams still running jQuery in production, 4.1.0 is a low-drama upgrade with real fixes behind it; for everyone else, it is a reminder that 'legacy' and 'unmaintained' are not the same thing.
- #jquery
- #javascript
- #web-development
- #open-source
- #release-notes