软件更新丨时隔一年,jQuery 发布 3.4.0 版本
jQuery 团队的核心开发者 Timmy Willison 今天在官网宣布了 jQuery 3.4.0,这距离上个版本 3.3.x 系列的推出已过去了一年多。
Timmy 表示这可能是 3.x 分支的最后一个小版本更新,接下来的工作重心将是 jQuery 4.0 大版本的更新。
jQuery 3.4.0 的更新内容主要是错误修复和功能改进,列举部分如下:
- 针对 .width 和 .height 的性能改进
- 支持 nonce 和 nomodule
- 针对 Radio 元素新增事件处理程序中的预期状态
// 示例代码 var $radios = jQuery(".example"); var $firstRadio = $radios.first(); var firstCheckedState = $firstRadio.prop("checked"); $radio.on("click", function() { // true in <3.4.0 console.log($firstRadio.prop("checked") === firstCheckedState); }); $radios.eq(1).click();
- 针对 Object.prototype pollution 问题的小修复
// 示例代码 Example jQuery.extend(true, {}, JSON.parse('{"__proto__": {"test": true}}') ); console.log( "test" in {} ); // true
发表评论 取消回复