• jQuery 3.4.0 的更新内容主要是错误修复和功能改进,列举部分如下:

    • 针对 .width 和 .height 的性能改进
    • 支持 nonce 和 nomodule
    • 针对 Radio 元素新增事件处理程序中的预期状态
    • 针对 Object.prototype pollution 问题的小修复
// 示例代码 var $radios = jQuery(".example"); var $firstRadio = $radios.first(); var firstCheckedState = $firstRadio.prop("checked"); $radio.on("click", function() { 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
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。