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.pswp.cn/news/285834.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/285834.shtml
英文地址,請注明出處:http://en.pswp.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="…