What’s New in jQuery 3.5.0? Security Fixes and Updated Methods Explained

jQuery 3.5.0 focuses on security fixes, removes a vulnerable regex from htmlPrefilter, offers a migration plugin to restore the old behavior, and introduces .even() and .odd() methods as replacements for the deprecated positional selectors.

21CTO
21CTO
21CTO
What’s New in jQuery 3.5.0? Security Fixes and Updated Methods Explained

jQuery 3.5.0 has been released, primarily addressing security issues.

The jQuery.htmlPrefilter method previously used a regular expression to ensure that closing tags complied with XHTML rules, e.g., converting jQuery("<div class='hot' />") to jQuery("<div class='hot'></div>"). Recent reports indicated that the regex could introduce XSS vulnerabilities, so the new version removes the regex from jQuery.htmlPrefilter.

Developers who still need the regex behavior can use the latest jQuery Migration plugin to restore the jQuery.htmlPrefilter functionality.

Additionally, because jQuery 4.0 will deprecate positional selectors, this release adds two replacement methods: .even() and .odd(), which substitute the :even and :odd selectors.

For full details, see the official release notes.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

frontendmigrationJavaScriptjQueryRelease Notes
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.