# jQuery版本更換紀錄 ###### tags: `JavaScript` > [jQuery版本低引起的漏洞——CVE-2020-11022/CVE-2020-11023](https://blog.csdn.net/Tracts/article/details/123395349) > [jquery vulnerabilities](https://security.snyk.io/package/npm/jquery) ## jQuery3.5 * [jQuery.trim()](https://api.jquery.com/jQuery.trim/) 宣告棄用(Deprecated) * 替代方案: Javascript原生函式 [String.prototype.trim()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) * 範例說明: * jQuery3.5之後 ```javascript let xString = " This is my string with spaces "; let xTrimmed = xString.trim(); ``` * jQuery3.5之前的版本 ```javascript let xString = " This is my string with spaces "; let xTrimmed = $.trim(xString); ``` * ==新增== [.even()](https://api.jquery.com/even/) * ==新增== [.odd()](https://api.jquery.com/odd/) ## jQuery3.4 * 下列選擇器(Selector)宣告棄用(Deprecated),建議改用 [`.filter( selector )`](https://api.jquery.com/filter/) * [`jQuery( ":eq(index)" )`](https://api.jquery.com/eq-selector/) * [`jQuery( ":gt()" )`](https://api.jquery.com/gt-selector/) * [`jQuery( ":lt()" )`](https://api.jquery.com/lt-selector/) * [`jQuery( ":even" )`](https://api.jquery.com/even-selector/) * [`jQuery( ":odd" )`](https://api.jquery.com/odd-selector/) * [`jQuery( ":first" )`](https://api.jquery.com/first-selector/) * [`jQuery( ":last" )`](https://api.jquery.com/last-selector/) ## jQuery3.2 * [jQuery.isArray()](https://api.jquery.com/jQuery.isArray/) 宣告棄用(Deprecated) * 替代方案: Javascript原生函式 [Array.isArray()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) ## jQuery3.0 * [jQuery.bind()](https://api.jquery.com/bind/) 宣告棄用(Deprecated) * 替代方案: [jQuery.on()](https://api.jquery.com/on/) * [jQuery.delegate()](https://api.jquery.com/delegate/) 宣告棄用(Deprecated) * 替代方案: [jQuery.on()](https://api.jquery.com/on/) * [jQuery.unbind()](https://api.jquery.com/unbind/) 宣告棄用(Deprecated) * 替代方案: [jQuery.off()](https://api.jquery.com/off/) * [jQuery.undelegate()](https://api.jquery.com/undelegate/) 宣告棄用(Deprecated) * 替代方案: [jQuery.off()](https://api.jquery.com/off/) * [jQuery.parseJSON()](https://api.jquery.com/jQuery.parseJSON/) 宣告棄用(Deprecated) * 替代方案: Javascript原生函式 [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) * [[JavaScript] JSON.stringify() and JSON.parse():變 JSON 和變物件](https://medium.com/itsems-frontend/javascript-json-stringify-and-json-parse-7a1251d3824c) * [jQuery.unique()](https://api.jquery.com/jQuery.unique/) 宣告棄用(Deprecated) * 替代方案: [jQuery.uniqueSort()](https://api.jquery.com/jQuery.uniqueSort/) * jQuery 3 調整了 jQuery.Deferred 以符合 Promise/A+,若 jQuery 已升級到 3.0,Deferred 可以當成標準 Promise 使用 ## jQuery 1.9 * [jQuery.support](https://api.jquery.com/jQuery.support/) 宣告棄用 ## jQuery 1.5 * [Deferred Object](https://api.jquery.com/category/deferred-object/) * 作業成功或失敗 Callback 寫在 [Promise 物件](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Promise) done()/then()/fail() 等方法 * 另外還有 always() 指定不論成功失敗都要執行的程序 ## jQueryUI 更版紀錄 * 參考官方文件,確認專案內程式碼有用到哪些元件,再進行調整或修正 * [jQuery UI Upgrade Guides](https://jqueryui.com/upgrade-guide/) * jQuery UI 1.13 重點調整 * **Accordion** - Added function value for a `header` option * **Datepicker** - Various `*Text` options no longer accept HTML input * jQuery UI 1.10 動點調整 * **AutoComplete** - [Removed `item.autocomplete` data; use `ui-autocomplete-item`](https://jqueryui.com/upgrade-guide/1.10/#removed-item-autocomplete-data-use-ui-autocomplete-item) > [Cannot set property '_renderItem' of undefined jQuery UI autocomplete with HTML](https://stackoverflow.com/questions/9513251/cannot-set-property-renderitem-of-undefined-jquery-ui-autocomplete-with-html) > [jQueryUI autocomplete not working with dialog and zIndex](https://stackoverflow.com/questions/8685558/jqueryui-autocomplete-not-working-with-dialog-and-zindex) * **Tabs** - [Changed `load` event to pass jQuery objects](https://jqueryui.com/upgrade-guide/1.10/#changed-load-event-to-pass-jquery-objects) > [Get the ID of the tab (div) being activated](https://stackoverflow.com/questions/14502156/get-the-id-of-the-tab-div-being-activated)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up