From 71cf6999046ebafa348e08238a8769db0373e190 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Wed, 30 Mar 2016 16:04:53 +0100 Subject: [PATCH 001/259] Build: Update grunt-jquery-content to 3.0.1 Closes gh-125 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ffeb83..8fc7a73 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,6 @@ "async": "0.9.0", "grunt": "0.4.5", "grunt-cli": "1.1.0", - "grunt-jquery-content": "3.0.0" + "grunt-jquery-content": "3.0.1" } } From baf14f912569d4bb2065b9746db91500beea3041 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Thu, 31 Mar 2016 15:05:03 +0100 Subject: [PATCH 002/259] 2.1.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fc7a73..27320b3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery.com", "title": "jQuery Homepage", - "version": "2.1.16", + "version": "2.1.17", "homepage": "https://github.com/jquery/jquery.com", "author": { "name": "jQuery Foundation and other contributors" From cfa9f6c69bfb6a23fadf2c703598059c1215fcc0 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 5 Apr 2016 15:38:23 -0400 Subject: [PATCH 003/259] Update to jQuery 1.12.3 and 2.2.3 --- pages/download.md | 22 +++++++++++----------- pages/index.html | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pages/download.md b/pages/download.md index 08664ab..ffae6b6 100644 --- a/pages/download.md +++ b/pages/download.md @@ -23,14 +23,14 @@ Read the [jQuery 1.9 Upgrade Guide](https://jquery.com/upgrade-guide/1.9/) and the [jQuery 1.9 release blog post](https://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/) for more information. -Download the compressed, production jQuery 1.12.2 +Download the compressed, production jQuery 1.12.3 -Download the uncompressed, development jQuery 1.12.2 +Download the uncompressed, development jQuery 1.12.3 -Download the map file for jQuery 1.12.2 +Download the map file for jQuery 1.12.3 -[jQuery 1.12.2 release -notes](https://blog.jquery.com/2016/03/17/jquery-1-12-2-and-2-2-2-released/) +[jQuery 1.12.3 release +notes](https://blog.jquery.com/2016/04/05/jquery-1-11-3-and-2-2-3-released/) ### jQuery 2.x @@ -40,14 +40,14 @@ Since IE 8 is still relatively common, we recommend using the 1.x version unless are certain no IE 6/7/8 users are visiting the site. Please read the [2.0 release notes](https://blog.jquery.com/2013/04/18/jquery-2-0-released/) carefully. -Download the compressed, production jQuery 2.2.2 +Download the compressed, production jQuery 2.2.3 -Download the uncompressed, development jQuery 2.2.2 +Download the uncompressed, development jQuery 2.2.3 -Download the map file for jQuery 2.2.2 +Download the map file for jQuery 2.2.3 -[jQuery 2.2.2 release -notes](https://blog.jquery.com/2016/03/17/jquery-1-12-2-and-2-2-2-released/) +[jQuery 2.2.3 release +notes](https://blog.jquery.com/2016/04/05/jquery-1-11-3-and-2-2-3-released/) ## Downloading jQuery using Bower jQuery is registered as a package with [Bower](http://bower.io). You can install the latest version of jQuery with the command: @@ -58,7 +58,7 @@ This will install jQuery to Bower's install directory, the default being `bower_ The jQuery Bower package contains additional files besides the default distribution. In most cases you can ignore these files, however if you wish to download the default release on its own you can use Bower to install jQuery from one of the above urls instead of the registered package. For example, if you wish to install just the compressed jQuery 2.1.0, you can install just that file with the following command: ``` -bower install https://code.jquery.com/jquery-2.2.2.min.js +bower install https://code.jquery.com/jquery-2.2.3.min.js ``` ## jQuery Migrate Plugin diff --git a/pages/index.html b/pages/index.html index b312ef2..79d1a9f 100644 --- a/pages/index.html +++ b/pages/index.html @@ -12,7 +12,7 @@ Download jQuery - v1.12.2 or v2.2.2 + v1.12.3 or v2.2.3
View Source on GitHub → From fd6c6e41d51bd84ac83250691624caf86b05cfbd Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 5 Apr 2016 15:38:28 -0400 Subject: [PATCH 004/259] 2.1.18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27320b3..c05d9ed 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery.com", "title": "jQuery Homepage", - "version": "2.1.17", + "version": "2.1.18", "homepage": "https://github.com/jquery/jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 048fd6b30a74ef9b3f4c41ff21863cc8c40d1035 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Mon, 11 Apr 2016 20:02:52 +0900 Subject: [PATCH 005/259] Update links to jQuery Migrate and example CDN links Closes #126 --- pages/download.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/download.md b/pages/download.md index ffae6b6..1f253ab 100644 --- a/pages/download.md +++ b/pages/download.md @@ -66,9 +66,9 @@ bower install https://code.jquery.com/jquery-2.2.3.min.js We have created the [jQuery Migrate plugin](https://github.com/jquery/jquery-migrate/#readme) to simplify the transition from older versions of jQuery. The plugin restores deprecated features and behaviors so that older code will still run properly on jQuery 1.9 and later. Use the _uncompressed development_ version to diagnose compatibility issues, it will generate warnings on the console that you can use to identify and fix problems. Use the _compressed production_ version to simply fix compatibility issues without generating console warnings. -Download the compressed, production jQuery Migrate 1.2.1 +Download the compressed, production jQuery Migrate 1.3.0 -Download the uncompressed, development jQuery Migrate 1.2.1 +Download the uncompressed, development jQuery Migrate 1.3.0 ## Cross-Browser Testing with jQuery @@ -91,8 +91,8 @@ if the visitor to your webpage has already downloaded a copy of jQuery from the To use the jQuery CDN, just reference the file directly from `https://code.jquery.com` in the script tag: ``` - - + + ``` Starting with jQuery 1.9, [sourcemap files](https://blog.jquery.com/2013/01/09/jquery-1-9-rc1-and-migrate-rc1-released/#sourcemaps) are available on the jQuery CDN as well. If compressed files are included directly from the CDN as shown above, sourcemap-aware browsers such as Google Chrome will use them when you enable sourcemap support. From da8609c5d406b343491866e45c1e441d31362bd2 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 14 Apr 2016 08:19:02 -0400 Subject: [PATCH 006/259] Docs: Clarify attr/prop examples Closes #14 --- pages/upgrade-guide/1.9.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/upgrade-guide/1.9.md b/pages/upgrade-guide/1.9.md index a47fc3f..6a7026a 100644 --- a/pages/upgrade-guide/1.9.md +++ b/pages/upgrade-guide/1.9.md @@ -120,7 +120,7 @@ jQuery 1.6 introduced the `.prop()` method for setting or getting *properties* o For example, boolean attributes such as `checked` and `disabled` on a checkbox are affected by this change. The correct behavior of `"input[checked]"` is to select checkboxes that have a `checked` attribute, regardless of its string value, and regardless of their current state. In contrast, `"input:checked"` selects checkboxes that are *currently* checked as reflected in their boolean (`true` or `false`) `checked` property, which is affected when the user clicks the box for example. Versions prior to 1.9 sometimes do not select the correct nodes with these selectors. -Here are some examples of correct and incorrect usage when setting `checked` on a checkbox; the same rules apply for `disabled`. Note that only the _property_ consistently reflects and updates the current state of the checkbox across all browsers; rarely will you need to set the attribute. +Here are some examples of correct usage when setting `checked` on a checkbox; the same rules apply for `disabled`. Note that only the _property_ consistently reflects and updates the current state of the checkbox across all browsers; rarely will you need to set the attribute. ```js // Correct if changing the attribute is desired @@ -128,7 +128,7 @@ $(elem).attr("checked", "checked"); // Correct for checking the checkbox $(elem).prop("checked", true); -// Correct if removing the attribute is desired +// Correct if removing the attribute is desired (rare) $(elem).removeAttr("checked"); // Correct for clearing the checkbox $(elem).prop("checked", false); From 0d6a16783ebb7f516da6bf88c1257d3684dd750e Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 14 Apr 2016 08:27:58 -0400 Subject: [PATCH 007/259] Docs: Remove an incorrect version --- pages/download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/download.md b/pages/download.md index 1f253ab..6a2f96d 100644 --- a/pages/download.md +++ b/pages/download.md @@ -56,7 +56,7 @@ bower install jquery ``` This will install jQuery to Bower's install directory, the default being `bower_components`. Within `bower_components/jquery/dist/` you will find an uncompressed release, a compressed release, and a map file. -The jQuery Bower package contains additional files besides the default distribution. In most cases you can ignore these files, however if you wish to download the default release on its own you can use Bower to install jQuery from one of the above urls instead of the registered package. For example, if you wish to install just the compressed jQuery 2.1.0, you can install just that file with the following command: +The jQuery Bower package contains additional files besides the default distribution. In most cases you can ignore these files, however if you wish to download the default release on its own you can use Bower to install jQuery from one of the above urls instead of the registered package. For example, if you wish to install just the compressed jQuery file, you can install just that file with the following command: ``` bower install https://code.jquery.com/jquery-2.2.3.min.js ``` From 6e06dce6e02524ba276b90fbb688e0fda5df62ba Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 14 Apr 2016 08:30:19 -0400 Subject: [PATCH 008/259] Docs: Remove references to jquery-compat version --- pages/download.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/download.md b/pages/download.md index 6a2f96d..265d61c 100644 --- a/pages/download.md +++ b/pages/download.md @@ -76,9 +76,7 @@ Be sure to test web pages that use jQuery in all the browsers you want to suppor ## jQuery Pre-Release Builds -The jQuery team is constantly working to improve the code. Each commit to the Github repo generates a work-in-progress version of the code that we update on the jQuery CDN. _These versions are sometimes unstable and not suitable for production sites._ We recommend they be used to determine whether a bug has already been fixed when reporting bugs against released versions, or to see if new bugs have been introduced. There are two versions, one for the `compat` branch (supports IE 8) and one for the `master` branch (not for use with old IE). - -Download the work-in-progress jQuery Compat build +The jQuery team is constantly working to improve the code. Each commit to the Github repo generates a work-in-progress version of the code that we update on the jQuery CDN. _These versions are sometimes unstable and never suitable for production sites._ We recommend they be used to determine whether a bug has already been fixed when reporting bugs against released versions, or to see if new bugs have been introduced. Download the work-in-progress jQuery build From d882ff2af69cb5426c3ed4e782ca6c67c66a6cf7 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 8 Feb 2016 17:57:08 +0700 Subject: [PATCH 009/259] Docs: Rename variable to avoid confusion Closes #119 --- pages/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/index.html b/pages/index.html index 79d1a9f..000a9ea 100644 --- a/pages/index.html +++ b/pages/index.html @@ -121,8 +121,8 @@

Ajax

data: { zipcode: 97201 }, - success: function( data ) { - $( "#weather-temp" ).html( "<strong>" + data + "</strong> degrees" ); + success: function( result ) { + $( "#weather-temp" ).html( "<strong>" + result + "</strong> degrees" ); } }); From c8699203d0afafccb96a1db4396c35f513dde6ec Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 14 Apr 2016 08:57:21 -0400 Subject: [PATCH 010/259] Docs: Add SRI info and update sourcemap info Ref #112 --- pages/download.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pages/download.md b/pages/download.md index 265d61c..fc5d7fd 100644 --- a/pages/download.md +++ b/pages/download.md @@ -87,13 +87,11 @@ if the visitor to your webpage has already downloaded a copy of jQuery from the ### jQuery's CDN provided by [MaxCDN](https://www.maxcdn.com) -To use the jQuery CDN, just reference the file directly from `https://code.jquery.com` in the script tag: -``` - - -``` +The jQuery CDN supports [https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity](Subresource Integrity) (SRI) which allows the browser to verify that the files being delivered have not been modified. This [https://www.w3.org/TR/SRI/](specification) is currently being implemented by browsers. Adding the new integrity attribute will ensure your application gains this security improvement as browsers support it. + +To use the jQuery CDN, just reference the file in the script tag directly from the jQuery CDN domain. You can get the complete script tag, including Subresource Integrity attribute, by visiting https://code.jquery.com and clicking on the version of the file that you want to use. Copy and paste that tag into your HTML file. -Starting with jQuery 1.9, [sourcemap files](https://blog.jquery.com/2013/01/09/jquery-1-9-rc1-and-migrate-rc1-released/#sourcemaps) are available on the jQuery CDN as well. If compressed files are included directly from the CDN as shown above, sourcemap-aware browsers such as Google Chrome will use them when you enable sourcemap support. +Starting with jQuery 1.9, [sourcemap files](https://blog.jquery.com/2013/01/09/jquery-1-9-rc1-and-migrate-rc1-released/#sourcemaps) are available on the jQuery CDN. However, as of version 1.10.0/2.1.0 the compressed jQuery no longer includes the sourcemap comment in CDN copies because it requires the the uncompressed file and sourcemap file to be placed at the same location as the compressed file. If you are maintaining local copies and can control the locations all three files, you can add the sourcemap comment to the compressed file for easier debugging. To see all available files and versions, visit [https://code.jquery.com](https://code.jquery.com) From 2b580e333b0b1074cfa077c5ddcfe45bb9483f90 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 14 Apr 2016 09:01:53 -0400 Subject: [PATCH 011/259] 2.1.19 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c05d9ed..5387ecf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jquery.com", "title": "jQuery Homepage", - "version": "2.1.18", + "version": "2.1.19", "homepage": "https://github.com/jquery/jquery.com", "author": { "name": "jQuery Foundation and other contributors" From bfa48ce9edb0b59069f5e7a780702078779a2f62 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Fri, 22 Apr 2016 15:18:43 -0400 Subject: [PATCH 012/259] Docs: jQuery Core 3.0 Upgrade Guide, initial commit --- pages/upgrade-guide/3.0.md | 482 +++++++++++++++++++++++++++++++++++++ 1 file changed, 482 insertions(+) create mode 100644 pages/upgrade-guide/3.0.md diff --git a/pages/upgrade-guide/3.0.md b/pages/upgrade-guide/3.0.md new file mode 100644 index 0000000..e311f21 --- /dev/null +++ b/pages/upgrade-guide/3.0.md @@ -0,0 +1,482 @@ + + + + +# jQuery Core 3.0 Upgrade Guide + +## Overview + +With the major version of 3.0, the jQuery Core team has taken the opportunity to make changes to clean up the API and fix bugs that may prove to be breaking changes for some code. This includes the removal of previously deprecated public APIs, changes to or removal of undocumented APIs, and changes to the documented or undocumented behavior of existing APIs for specific inputs. + +## Browser Support + +As of jQuery 3.0, the following browsers are supported: + +* Internet Explorer: 9+ +* Chrome, Edge, Firefox, Safari: Current and Current - 1 +* Opera and Yandex Browser: Current +* Safari Mobile iOS: 7+ +* Android: 2.3 (limited) +* Android 4.0+ + +The limited Android 2.3 support may not correct minor known issues with positioning, but jQuery should not throw exceptions in Android 2.3 on valid API inputs. + +jQuery team policy is to only change browser support on major-version updates, so this list will apply until at least jQuery 4 arrives. + +## jQuery Migrate Plugin + +As with the major changes made in jQuery 1.9/2.0, we have created a new version of the [jQuery Migrate Plugin](https://github.com/jquery/jquery-migrate/#README) to simplify migration of older code to version 3.0. We strongly recommend that you use this plugin as an upgrading tool, it will give specific advice about most of the major changes that may affect your code. + +[Version 3.0 of the jQuery Migrate Plugin](https://github.com/jquery/jquery-migrate/#README) *does not* warn about or restore behaviors that were removed in previous major version changes such as jQuery 1.9/2.0. Use the following steps to upgrade from a version of jQuery older than 1.11.0 or 2.1.0 to this new version 3.0: + +1. Upgrade the version of jQuery on the page to the latest 1.x or 2.x version (currently 1.12.3 or 2.2.3). +2. Add the uncompressed [jQuery Migrate 1.x Plugin](https://github.com/jquery/jquery-migrate/tree/1.x-stable/#README) to the page. +3. Optional but recommended, update any plugins in use since later versions are usually the most compatible with recent versions of jQuery. +4. Test the page and resolve any warnings that appear on the console, using the [JQMIGRATE 1.x warning documentation](https://github.com/jquery/jquery-migrate/tree/1.x-stable/warnings.md) as a guide. +5. Remove the jQuery Migrate 1.x plugin and ensure that the updated jQuery code on the page continues to work properly with only the latest jQuery 1.x/2.x in use. +6. Upgrade the version of jQuery on the page to the latest 3.0 version (currently 3.0.0) and add the uncompressed [jQuery Migrate 3.x plugin](https://github.com/jquery/jquery-migrate/#README) to the page. +7. Test the page and resolve any warnings that appear on the console, using the [JQMIGRATE 3.x warning documentation](https://github.com/jquery/jquery-migrate/blob/master/warnings.md) as a guide. Report any bugs in third-party plugins to the plugin author. +8. Remove the jQuery Migrate 3.x plugin and ensure that the page continues to work properly with only the latest jQuery 3.x in use. + +**Running both Migrate 1.x and Migrate 3.x simultaneously on the same page is not supported.** + +The uncompressed development version of the Migrate plugin includes console log output to warn when specific deprecated and/or removed features are being used. This makes it valuable as a migration debugging tool for finding and remediating issues in existing jQuery code and plugins. + +The compressed version of the Migrate plugin does not generate any warnings, although it does issue a solitary console message that it has been installed to simplify debugging. Migrate can be used on production sites when jQuery 3.0 or higher is desired but older incompatible jQuery code or plugins must also be used. Ideally this is only used as a short-term solution, since restoring old behavior may cause conflicts with new jQuery code that expects the new behavior. + +## Summary of Important Changes + +With a library as widely used as jQuery, it is often difficult for the team to know which changes may impact developers the most before a release occurs. Despite the length of this list, we believe that the majority are edge cases. Many jQuery projects should be able to run version 3.0 with only minor changes if any. + +Changes are listed by their component category, and prefixed with a description to help you understand its impact: + +* **Breaking change:** This change *may* affect existing code, since it changes the API surface in some way. Most of the time the impacts are only for specific edge cases as noted. +* **Feature:** The change is an API addition and should not affect existing code in most cases. However, there is the possibility that new features can interact negatively with existing code. +* **Deprecated:** This feature or API is still present in jQuery 3.0, but its use is discouraged. It may be removed in a future major-version update. + +Remember that the jQuery Migrate plugin described above can detect and warn about many of these changes so that they can be fixed in your code. + +For a complete and detailed list of all code changes, see the 3.0 milestone in the [jQuery Core issue tracker](https://github.com/jquery/jquery/issues?q=is%3Aopen+is%3Aissue+milestone%3A3.0.0) or the [version diff](https://github.com/jquery/jquery/compare/2.2-stable...master). + +### Ajax +#### Breaking change: Special-case Deferred methods removed from $.ajax +The `jqXHR` object returned from `jQuery.ajax()` is a jQuery `Deferred` and has historically had three extra methods with names matching the arguments object of `success`, `error`, and `complete`. This often confused people who did not realize that the returned object should be treated like a `Deferred`. As of jQuery 3.0 these methods have been removed. As replacements, use the `Deferred` standard methods of `done`, `fail`, and `always`, or use the new `then` and `catch` methods for Promise/A+ compliance. + +Note that this does not have any impact at all on the ajax callbacks of the same name passed through the `options` object, which continue to exist and are not deprecated. This only affects the jqXHR methods. + +https://github.com/jquery/jquery/issues/2084 + +#### Breaking change: Cross-domain script requests must be declared + +When making a request via `$.ajax()` or `$.get()` for a script on a domain other than the one that hosts the document, you must now explicitly specify `dataType: "script"` in the options. This prevents the possibility of an attack where the remote site delivers non-script content but later decides to serve a script that has malicious intent. Since `$.getScript()` explicitly sets `dataType: "script"` it is unaffected by this change. + +#### Breaking change: Hash in a URL is preserved in a `$.ajax()` call + +The `$.ajax()` method no longer strips off the hash in the URL if it is provided, and sends the full URL to the transport (xhr, script, jsonp, or custom transport). If the server at the other end of the connection cannot deal with a hash on a URL, strip it off before sending the request. + +https://github.com/jquery/jquery/issues/1732 + +#### Feature: New signature for $.get() AND $.post() + +jQuery 3 adds a new signature for the `$.get()` and the `$.post()` functions by adding a `settings` parameter. It's an object that can possess many properties and its the same object that you can provide to [`$.ajax()`](http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings). + +https://github.com/jquery/jquery/issues/1986 + + +### Attributes + +#### Breaking change: `.removeAttr()` no longer sets properties to false + +Prior to jQuery 3.0, using `.removeAttr()` on a boolean attribute such as `checked`, `selected`, or `readonly` would also set the corresponding named *property* to `false`. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value. + +It is almost always a mistake to use `.removeAttr( "checked" )` on a DOM element. The only time it might be useful is if the DOM is later going to be serialized back to an HTML string. In all other cases, `.prop( "checked", false )` should be used instead. + +https://github.com/jquery/jquery/issues/1759 +https://github.com/jquery/jquery/issues/2913 + +#### Breaking change: select-multiple with nothing selected returns an empty array + +Before jQuery 3.0, a `` element with no elements selected returned `null`. This was inconvenient since if at least one value was selected the return value would be an array. Also, if all options are disabled jQuery already returned an empty array. To improve consistency, the nothing-selected case now returns an empty array. +Before jQuery 3.0, calling `.val()` on a `