jQuery 3.4.0 Released(2019.4.10)

jQuery has a new release! It’s been a while since our last release, but we expect this to be the last minor release in the 3.x branch, and then we will move on to the overhaul that will be jQuery 4.0. But
before we get to 4.0, we’re excited to share the bug fixes and improvements included in jQuery 3.4.0. Here are some of the highlights:

Performance improvement in .widthand .height

When getting and setting dimensions, there were certain cases where this could cause layout thrashing, which basically means that the browser calculated layout more times than necessary. We fixed this in all browsers except IE, where it can’t be avoided.

nonceand nomodulesupport

To support adding script elements through methods like .html and .append, jQuery separates them and appends new script tags to load and execute the remote content. During this process, attributes such as nonceand nomodulewere ignored, but jQuery 3.4.0 now hangs onto them.

Radio elements: expected state in event handlers

We had already fixed the same issue with checkboxes, but accidentally left out radio inputs. In the following example, truewas logged the first time the element was clicked. We fixed it so that the checkedproperty is updated before the event handler is executed.

Example

var $radios = jQuery(".example");
var $firstRadio = $radios.first();
var firstCheckedState = $firstRadio.prop("checked");
$radio.on("click", function() {// true in <3.4.0console.log($firstRadio.prop("checked") === firstCheckedState);
});
$radios.eq(1).click();

Minor vulnerability fix: Object.prototype pollution
jQuery 3.4.0 includes a fix for some unintended behavior when usingjQuery.extend(true, {}, ...). If an unsanitized source object contained an enumerable __proto__property, it could extend the native Object.prototype. This fix is included in jQuery 3.4.0, but patch diffs exist to patch previous jQuery versions.

Example

jQuery.extend(true, {},JSON.parse('{"__proto__": {"test": true}}')
);
console.log( "test" in {} ); // true

Note that while jQuery does its best to protect users from security vulnerabilities, jQuery is a DOM manipulation library that will generally do what you tell it to do. In this case, the behavior was likely unexpected, so jQuery.extendwill no longer write any properties named __proto__. But guards such as this one are not replacements for good security practices such as user input sanitization.

Deprecating positional selectors and the sunset of Sizzle

The basic API of jQuery is to select something and then do something with what was selected. Sizzle, the selector engine in jQuery, handles the first half. It’s been a fast and efficient little engine that has paved the way for native selector APIs like querySelectorAlland additional native JavaScript and CSS selectors. Now that many of these selectors have made their way into modern browsers, it’s almost time to say goodbye to Sizzle. But in order to remove Sizzle in jQuery 4.0, we will also need to remove what we refer to as positional selectors, which are non-standard selectors.

Specifically, jQuery 3.4.0 is deprecating:first, :last, :eq, :even, :odd, :lt, :gt, and:nth. When we remove Sizzle, we’ll replace it with a small wrapper around querySelectorAll, and it would be almost impossible to reimplement these selectors without a larger selector engine.

We think this trade-off is worth it. Keep in mind we will still support the positional methods, such as .first, .last, and .eq. Anything you can do with positional selectors, you can do with positional methods instead. They perform better anyway.

Upgrading

There should be no compatibility issues if upgrading from jQuery 3.0+. If you haven’t yet upgraded to jQuery 3+, please have a look at the 3.0 Upgrade Guide. The jQuery Migrate 3.0 plugin will help you to identify compatibility issues in your code.

Please try out this new release and let us know about any issues you experienced.

Download

You can get the files from the jQuery CDN, or link to them directly:

https://code.jquery.com/jquery-3.4.0.js

https://code.jquery.com/jquery-3.4.0.min.js

You can also get this release from npm:

npm install jquery@3.4.0

From:http://blog.jquery.com/2019/04/10/jquery-3-4-0-released/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/285834.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C#-Linq源码解析之DefaultIfEmpty

前言在Dotnet开发过程中&#xff0c;DefaultIfEmpty作为IEnumerable的扩展方法&#xff0c;十分常用。本文对DefaultIfEmpty方法的关键源码进行简要分析&#xff0c;以方便大家日后更好的使用该方法。使用DefaultIfEmpty 返回 IEnumerable< T> 的元素&#xff1b;如果序列…

ArcGIS实验教程——实验三十八:基于ArcGIS的等高线、山体阴影、山顶点提取案例教程

ArcGIS实验视频教程合集:《ArcGIS实验教程从入门到精通》(附配套实验数据)》 文章目录 1. 加载DEM2. 提取等高距为15m的等高线3. 提取等高距为75m的等高线4. 生成山体阴影5. 生成三维等高线6. 提取山顶点7. 实验数据下载地址山顶点指那些在特定邻域分析范围内,该点都比周围…

Zabbix3.0 安装Graphtree

zabbix中&#xff0c;想要集中展示图形&#xff0c;唯一的选择是screen&#xff0c;zatree可以解决这个问题&#xff0c;但是性能不是很好。 Graphtree由OneOaas开发并开源出来&#xff0c;用来解决zabbix的图形展示问题&#xff0c;性能比较好 因为默认的zabbix 展示图形很麻烦…

(2.3)其他补充—— 二、solidity 基础进阶《实战NFT web3 solidity(新版本0.8.+)》

《web3 solidity0.8.版本&#xff08;持续更新新版本内容&#xff09; 基础到实战NFT开发》会及时更新新版本 solidity 内容&#xff0c;以及完成最终的 NFT 实战商业项目部分。 注&#xff1a;由于是付费专栏内容&#xff0c;若有错误请及时联系1_bit&#xff0c;博客链接&am…

Android之实现点击布局缩小然后再放大动画

1、需求 现在需要实现点击View先缩小然后再放大效果 2、代码实现 在res的anim目录下面&#xff0c;写anim_small.xml文件 <?xml version"1.0" encoding"utf-8"?> <set xmlns:android"http://schemas.android.com/apk/res/android"…

如何在web api中使用SignalR

说明&#xff1a; 在webapi中使用signalr&#xff0c;使用IIS 环境&#xff1a; vs2012, .net4.5 第一步&#xff1a;建web api项目 第二步&#xff1a;nuget导入signalr Install-Package Microsoft.AspNet.SignalR Install-Package Microsoft.Owin.Cors &#xff08;用于…

Directx11学习笔记【二】 将HelloWin封装成类

我们把上一个教程的代码封装到一个类中来方便以后的使用。 首先新建一个空工程叫做MyHelloWin&#xff0c;添加一个main.cpp文件&#xff0c;然后新建一个类叫做MyWindow,将于窗体有关的操作封装到里面 MyWindow.h文件 1 /***************************************************…

Badboy自动化测试工具11 导出脚本用于Jmeter并发测试

本节主要讲解利用Jmeter进行并发测试和引入图像报表 1. 在Jmeter中打开上节课&#xff08;10&#xff09;Badboy导出的在拉手网查询KTV的脚本Lashou_Search.jmx. 2. 右击Lashou节点&#xff0c;Add->Listener->Aggregate Graph & Graph Results 3. 对图像报表进行配置…

ArcGIS实验教程——实验三十九:ArcGIS多元分类(ISO聚类分析、最大似然分类、主成分分析)案例教程

ArcGIS实验视频教程合集:《ArcGIS实验教程从入门到精通》(附配套实验数据)》 文章目录 一、ISO聚类1. ISO聚类简介2. ISO聚类进行非监督分类实验操作二、最大似然分类1. 最大似然简介2. 最大似然分类实验案例三、主成分分析1. 主成分分析简介2. 主成分分析实验案例四、配套实…

ABP Framework 5.3.0 版本新增功能和变更说明

ABP Framework 5.3.0 稳定版已在2022年6月14日正式发布。以下是本版本的新增功能&#xff1a;• “开始”页面提供创建单层项目选项• 启动模板提供 PWA 支持• Volo.Abp.Gdpr.Abstractions 包介绍• 将发件箱中的事件批量发布到事件总线• eShopOnAbp 项目改进和电子书公告• …

智能合约开发——TypeScript 基础(全)

TS 准备 首先我们准备一个目录&#xff0c;使用 dos 进入到某目录&#xff0c;当然你直接 vs 打开终端执行也是没有问题的&#xff1a; 执行以下命令安装 typescrip&#xff08;不用进入目录&#xff0c;直接安装即可&#xff09;&#xff1a; npm install -g typescript我是…

查看MySQL的当前日期

select current_date(); 查看MySQL的当前日期转载于:https://www.cnblogs.com/dengyg200891/p/5972698.html

【ArcGIS风暴】ArcGIS支持的栅格数据格式大全及格式转换案例精解

ArcGIS功能异常强大,支持多种常见的栅格数据格式,并可实现多个栅格格式的自由转换。 在ArcGIS中,常见的栅格数据格式有:TIFF、BMP、ENVI、Esri BIL、Esri BIP、Esri BSQ、GIF、GRID、IMAGINE Image、JP2、JPG、和PNG。 BIL —Esri 波段按行交叉格式文件BIP —Esri 波段按像…

Android之靠谱的获取本地相册图片

1、需要申请手机读写的权限 AndroidMani.xml里面配置权限 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 我们一般采用RxPe…

利用Signalr实现手机端App扫码登录web页面

实现原理&#xff1a; 1、web登录页面&#xff0c;利用jquery.qrcode展示一个随机生成的登录码的二维码&#xff1b; 2、手机App扫描二维码取得登录码&#xff1b; 3、手机App将本地用户id登录码通过api提交服务器&#xff1b; 4、服务器api&#xff0c;收到手机App请求&am…

【ArcGIS风暴】ArcGIS栅格影像(NDVI)归一化处理的两种方法精解

【ArcGIS遇上Python】ArcGIS批量处理栅格影像(NDVI)归一化完整案例代码 图像归一化是指对图像进行了一系列标准的处理变换,使之变换为一固定标准形式的过程,该标准图像称作归一化图像。 原始图像在经历一些处理或攻击后可以得到多种副本图像,这些图像在经过相同参数的图像…

[从C到C++] 1.3 C++布尔类型(bool)

布尔类型(bool)是C新增的一种基本数据类型。在标准的C语言中并未定义bool类型&#xff0c;如果需要使用bool类型&#xff0c;程序员可以通过宏定义来自定义一个bool类型&#xff0c;定义语句如下&#xff1a; #define bool int #define false 0 #define true 1 也就是将int型定…

以小见大:一个领域建模的简单示例,理解“领域驱动”。

背景&#xff1a;航空公司为了确保飞行路线不发生冲突&#xff0c;需要开发一款飞行路线管理软件。过程&#xff1a;我们先去找这个领域的专家&#xff0c;自然是作为平时管理和维护机场飞行秩序的工作人员&#xff1b;我们第一个目标就是与他们沟通&#xff0c;也许我们并不能…

hibernate -- hello world

http://developer.51cto.com/art/201202/315931_all.htm转载于:https://www.cnblogs.com/iOS-mt/p/5973646.html

Android之底部Dialog里面放EditText点击布局顶上去效果

1、需求 在底部Dialog里面放EditText点击,布局需要顶上去,不顶上去很烦。 2、Dialog里面关键样式属性 <item name="android:windowFullscreen">false</item> 3、布局代码简单试下 样式 <style name="DialogTheme" tools:ignore="…