From ae855972e765f433d9d17e559eba7db6b7adeab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Thu, 18 Nov 2021 13:47:51 +0100 Subject: [PATCH 001/101] jQuery.getScript: Update the jQuery Color link to a versioned one --- entries/jQuery.getScript.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index 357b9e1a..906f03e4 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -92,7 +92,7 @@ $.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) { Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. Date: Wed, 27 Apr 2022 01:46:34 +0200 Subject: [PATCH 003/101] Ajax Events: Promote on() instead of bind() (#1202) Closes gh-1202 --- pages/Ajax_Events.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html index 26a59f0f..6b1249be 100644 --- a/pages/Ajax_Events.html +++ b/pages/Ajax_Events.html @@ -19,9 +19,9 @@

Local Events

Global Events

These events are triggered on the document, calling any handlers which may be listening. You can listen for these events like so:

-
 $(document).bind("ajaxSend", function(){
+
 $(document).on("ajaxSend", function(){
    $("#loading").show();
- }).bind("ajaxComplete", function(){
+ }).on("ajaxComplete", function(){
    $("#loading").hide();
  });
 
From 1940bb86d41d89386b7952319cc4d23339790734 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 14:49:35 +0200 Subject: [PATCH 004/101] Build: Bump grunt from 1.4.0 to 1.5.2 Bumps [grunt](https://github.com/gruntjs/grunt) from 1.4.0 to 1.5.2. - [Release notes](https://github.com/gruntjs/grunt/releases) - [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG) - [Commits](https://github.com/gruntjs/grunt/compare/v1.4.0...v1.5.2) Closes gh-1203 --- updated-dependencies: - dependency-name: grunt dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 60 +++++++++++++++++++++++++++++++++++------------ package.json | 2 +- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 876ec538..895cfa1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,9 +75,9 @@ } }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -290,9 +290,9 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "getobject": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.0.tgz", - "integrity": "sha512-tbUz6AKKKr2YiMB+fLWIgq5ZeBOobop9YMMAU9dC54/ot2ksMXt3DOFyBuhZw6ptcVszEykgByK20j7W9jHFag==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", + "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==" }, "gilded-wordpress": { "version": "1.0.5", @@ -366,17 +366,17 @@ } }, "grunt": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.4.0.tgz", - "integrity": "sha512-yRFc0GVCDu9yxqOFzpuXQ2pEdgtLDnFv5Qz54jfIcNnpJ8Z7B7P7kPkT4VMuRvm+N+QOsI8C4v/Q0DSaoj3LgQ==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.2.tgz", + "integrity": "sha512-XCtfaIu72OyDqK24MjWiGC9SwlkuhkS1mrULr1xzuJ2XqAFhP3ZAchZGHJeSCY6mkaOXU4F7SbmmCF7xIVoC9w==", "requires": { "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", "exit": "~0.1.2", "findup-sync": "~0.3.0", "glob": "~7.1.6", - "grunt-cli": "~1.4.2", - "grunt-known-options": "~1.1.1", + "grunt-cli": "~1.4.3", + "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", "iconv-lite": "~0.4.13", @@ -385,6 +385,36 @@ "mkdirp": "~1.0.4", "nopt": "~3.0.6", "rimraf": "~3.0.2" + }, + "dependencies": { + "grunt-cli": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", + "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", + "requires": { + "grunt-known-options": "~2.0.0", + "interpret": "~1.1.0", + "liftup": "~3.0.1", + "nopt": "~4.0.1", + "v8flags": "~3.2.0" + }, + "dependencies": { + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + } + } + }, + "grunt-known-options": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==" + } } }, "grunt-check-modules": { @@ -1015,11 +1045,11 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" }, "underscore.string": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", - "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", "requires": { - "sprintf-js": "^1.0.3", + "sprintf-js": "^1.1.1", "util-deprecate": "^1.0.2" } }, diff --git a/package.json b/package.json index 720284ce..485bfa55 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "grunt lint" }, "dependencies": { - "grunt": "1.4.0", + "grunt": "1.5.2", "grunt-cli": "1.4.2", "grunt-jquery-content": "3.1.0" } From bf40aa39ca5f9d8a429b18d9fae78c50b22a4d09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 17:36:28 +0200 Subject: [PATCH 005/101] Build: Bump grunt from 1.5.2 to 1.5.3 Bumps [grunt](https://github.com/gruntjs/grunt) from 1.5.2 to 1.5.3. - [Release notes](https://github.com/gruntjs/grunt/releases) - [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG) - [Commits](https://github.com/gruntjs/grunt/compare/v1.5.2...v1.5.3) Closes gh-1204 --- updated-dependencies: - dependency-name: grunt dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 895cfa1e..e02106bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -366,9 +366,9 @@ } }, "grunt": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.2.tgz", - "integrity": "sha512-XCtfaIu72OyDqK24MjWiGC9SwlkuhkS1mrULr1xzuJ2XqAFhP3ZAchZGHJeSCY6mkaOXU4F7SbmmCF7xIVoC9w==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", + "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", "requires": { "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", diff --git a/package.json b/package.json index 485bfa55..0c97e7d3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "grunt lint" }, "dependencies": { - "grunt": "1.5.2", + "grunt": "1.5.3", "grunt-cli": "1.4.2", "grunt-jquery-content": "3.1.0" } From 5274a1135ff2afad208783de25cc1c96298a6201 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 18 Nov 2022 13:24:40 +0100 Subject: [PATCH 006/101] jQuery.getScript: Script has been executed before the `success` callback When executing a callback provided to the optional `success` parameter of `$.getScript()`, we can assume the script has been executed already. Just like when using `.done()` on the returned jqXHR object. Fixes gh-1207 Closes gh-1209 --- entries/jQuery.getScript.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index 906f03e4..a234e9d1 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -27,7 +27,7 @@ $.ajax({

Success Callback

-

The callback is fired once the script has been loaded but not necessarily executed.

+

The callback is fired once the script has been loaded and executed.

Scripts are included and run by referencing the file name:


 $.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {

From b15e83e412351d9271a7ee4c7b16bb20958f7b66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
 
Date: Fri, 18 Nov 2022 13:26:03 +0100
Subject: [PATCH 007/101] 3.1.2

---
 package-lock.json | 2 +-
 package.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index e02106bf..19b7b10d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "api.jquery.com",
-  "version": "3.1.1",
+  "version": "3.1.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/package.json b/package.json
index 0c97e7d3..4e291494 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "name": "api.jquery.com",
   "title": "jQuery API Docs",
   "description": "API reference documentation for the jQuery JavaScript Library.",
-  "version": "3.1.1",
+  "version": "3.1.2",
   "homepage": "https://github.com/jquery/api.jquery.com",
   "author": {
     "name": "jQuery Foundation and other contributors"

From de6fdcb76b3b0cf064aa5b27e715706fa4c53eaa Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 18 Nov 2022 13:28:31 +0100
Subject: [PATCH 008/101] Build: Bump async from 3.2.0 to 3.2.4

Bumps [async](https://github.com/caolan/async) from 3.2.0 to 3.2.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/master/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v3.2.0...v3.2.4)

Closes gh-1213

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] 

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
 package-lock.json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 19b7b10d..aa4f92df 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -43,9 +43,9 @@
       "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w=="
     },
     "async": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
-      "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
+      "version": "3.2.4",
+      "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
+      "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
     },
     "balanced-match": {
       "version": "1.0.2",
@@ -307,7 +307,7 @@
         "async": {
           "version": "0.9.2",
           "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
-          "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
+          "integrity": "sha512-l6ToIJIotphWahxxHyzK9bnLR6kM4jJIIgLShZeqLY7iboHoGkdgFl7W2/Ivi4SkMJYGKqW8vSuk0uKUj6qsSw=="
         },
         "glob": {
           "version": "4.5.3",

From 6d46d38962fde24bd8d4d913736149d12eb5541f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
 
Date: Fri, 18 Nov 2022 13:28:40 +0100
Subject: [PATCH 009/101] 3.1.3

---
 package-lock.json | 2 +-
 package.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index aa4f92df..ea007635 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "api.jquery.com",
-  "version": "3.1.2",
+  "version": "3.1.3",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/package.json b/package.json
index 4e291494..5a227e51 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "name": "api.jquery.com",
   "title": "jQuery API Docs",
   "description": "API reference documentation for the jQuery JavaScript Library.",
-  "version": "3.1.2",
+  "version": "3.1.3",
   "homepage": "https://github.com/jquery/api.jquery.com",
   "author": {
     "name": "jQuery Foundation and other contributors"

From 3706b06bd7bb3f9f70a57c4d23abab70c9c0423f Mon Sep 17 00:00:00 2001
From: Andrew Dawes 
Date: Fri, 18 Nov 2022 13:29:51 +0100
Subject: [PATCH 010/101] mousemove: Fix a typo

Closes gh-1210
---
 entries/mousemove.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/entries/mousemove.xml b/entries/mousemove.xml
index d2341e65..f6e33860 100644
--- a/entries/mousemove.xml
+++ b/entries/mousemove.xml
@@ -66,7 +66,7 @@ $( "#other" ).click(function() {
     

When tracking mouse movement, you usually need to know the actual position of the mouse pointer. The event object that is passed to the handler contains some information about the mouse coordinates. Properties such as .clientX, .offsetX, and .pageX are available, but support for them differs between browsers. Fortunately, jQuery normalizes the .pageX and .pageY properties so that they can be used in all browsers. These properties provide the X and Y coordinates of the mouse pointer relative to the top-left corner of the document, as illustrated in the example output above.

Keep in mind that the mousemove event is triggered whenever the mouse pointer moves, even for a pixel. This means that hundreds of events can be generated over a very small amount of time. If the handler has to do any significant processing, or if multiple handlers for the event exist, this can be a serious performance drain on the browser. It is important, therefore, to optimize mousemove handlers as much as possible, and to unbind them as soon as they are no longer needed.

-

A common pattern is to bind the mousemove handler from within a mousedown hander, and to unbind it from a corresponding mouseup handler. If implementing this sequence of events, remember that the mouseup event might be sent to a different HTML element than the mousemove event was. To account for this, the mouseup handler should typically be bound to an element high up in the DOM tree, such as <body>.

+

A common pattern is to bind the mousemove handler from within a mousedown handler, and to unbind it from a corresponding mouseup handler. If implementing this sequence of events, remember that the mouseup event might be sent to a different HTML element than the mousemove event was. To account for this, the mouseup handler should typically be bound to an element high up in the DOM tree, such as <body>.

From ce90864c03b0a1aae4ab7fe8f616f250efab3f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 18 Nov 2022 13:31:29 +0100 Subject: [PATCH 011/101] Build: Update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index ea007635..7dd81f2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -307,7 +307,7 @@ "async": { "version": "0.9.2", "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha512-l6ToIJIotphWahxxHyzK9bnLR6kM4jJIIgLShZeqLY7iboHoGkdgFl7W2/Ivi4SkMJYGKqW8vSuk0uKUj6qsSw==" + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" }, "glob": { "version": "4.5.3", From 57a7ff7e539dd463fee7e0a1a62f47c0e8694af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 18 Nov 2022 13:31:34 +0100 Subject: [PATCH 012/101] 3.1.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7dd81f2e..96119daa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.1.3", + "version": "3.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a227e51..45cdbada 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.1.3", + "version": "3.1.4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9f6bbf1c186557e253120544b7bf8904a053be6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 19 Dec 2022 22:20:06 +0100 Subject: [PATCH 013/101] prevAll: Document issues with reverse doc order `.prevAll()` returns elements in the reverse document order. This can pose issues when used with APIs like `.append()` or `.wrapAll()`. Document how to deal with the issue with help from `jQuery.uniqueSort()`. Ref jquery/jquery#5149 Closes gh-1215 --- entries/prevAll.xml | 95 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/entries/prevAll.xml b/entries/prevAll.xml index 73f3f3f5..4b5f6062 100644 --- a/entries/prevAll.xml +++ b/entries/prevAll.xml @@ -7,7 +7,7 @@ A string containing a selector expression to match elements against. - Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector, in the reverse document order.

Given a jQuery object that represents a set of DOM elements, the .prevAll() method searches through the predecessors of these elements in the DOM tree and construct a new jQuery object from the matching elements; the elements are returned in order beginning with the closest sibling.

The method optionally accepts a selector expression of the same type that we can pass to the $() function. If the selector is supplied, the elements will be filtered by testing whether they match it.

@@ -26,6 +26,36 @@ $( "li.third-item" ).prevAll().css( "background-color", "red" );

The result of this call is a red background behind items 1 and 2. Since we do not supply a selector expression, these preceding elements are unequivocally included as part of the object. If we had supplied one, the elements would be tested for a match before they were included.

+

Note: Many APIs, like append or wrapAll process node in the order in which they appear in the jQuery object. This can pose issues with APIs like .prevAll() in which the reverse document order is used. Consider the following example:

+

+<div>
+  <div>First</div>
+  <div>Second</div>
+  <div class="last-item">Last</div>
+</div>
+    
+

The following call:

+

+$( ".last-item" )
+  .prevAll()
+  .wrapAll( "<div class='wrapper'></div>" );
+    
+

would result in the following HTML:

+

+<div>
+  <div class="wrapper">
+    <div>Second</div>
+    <div>First</div>
+  </div>
+  <div class="last-item">Last</div>
+</div>
+    
+

because "Item 2" gets appended to the wrapper div first. To work around the issue, you may use $.uniqueSort() on the .prevAll() output first:

+

+var prevSiblings = $( ".last-item" ).prevAll();
+$.uniqueSort( prevSiblings );
+prevSiblings.wrapAll( "<div class='wrapper'></div>" );
+    
Locate all the divs preceding the last div and give them a class. @@ -50,6 +80,69 @@ $( "div" ).last().prevAll().addClass( "before" );
+]]> +
+ + Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without $.uniqueSort(). + + + From a9dbdbcf660bccd90de9c81c171547201dd8f932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 19 Dec 2022 22:20:24 +0100 Subject: [PATCH 014/101] 3.1.5 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96119daa..864b3e95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.1.4", + "version": "3.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45cdbada..e4e29229 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.1.4", + "version": "3.1.5", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9685f8ad8656f7e51923add83406539a28696726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 9 Jan 2023 18:49:23 +0100 Subject: [PATCH 015/101] jQuery.map:jQuery.uniqueSort: Accept array-like input, fix typos Changes: * `jQuery.map`: Accept array-like input * `jQuery.uniqueSort`: Accept array-like input, fix typos. Apart from array-like inputs being officially allowed in `jQuery.uniqueSort` now, in a few places in examples it used to be referred to as `unique` instead of `uniqueSort`. Closes gh-1214 --- entries/jQuery.map.xml | 17 +++++++---------- entries/jQuery.uniqueSort.xml | 14 +++++++------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 3c499e6c..2016df87 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -3,8 +3,8 @@ jQuery.map() 1.0 - - The Array to translate. + + The Array or an Array-like object to translate. @@ -16,7 +16,7 @@ 1.6 - The Object to translate. + The non-Array-like Object to translate. @@ -28,16 +28,13 @@ Translate all items in an array or object to new array of items.

If you wish to process a jQuery object — for example, $('div').map( callback ); — use .map() instead.

-

The $.map() method applies a function to each item in an array or object and maps the results into a new array. Prior to jQuery 1.6, $.map() supports traversing arrays only. As of jQuery 1.6 it also traverses objects.

-

Array-like objects — those with a .length property and a value on the .length - 1 index — must be converted to actual arrays before being passed to $.map(). The jQuery library provides $.makeArray() for such conversions.

+

The $.map() method applies a function to each item in an array or object and maps the results into a new array. Prior to jQuery 1.6, $.map() supports traversing arrays and array-like objects only. As of jQuery 1.6 it also traverses objects.

+

Array-like objects — those with a .length property and a value on the .length - 1 index — may be passed to $.map().


-// The following object masquerades as an array.
+// The following object is array-like.
 var fakeArray = { "length": 2, 0: "Addy", 1: "Subtracty" };
 
-// Therefore, convert it to a real array
-var realArray = $.makeArray( fakeArray )
-
-// Now it can be used reliably with $.map()
+// It can be used reliably with $.map()
 $.map( realArray, function( val, i ) {
   // Do something
 });
diff --git a/entries/jQuery.uniqueSort.xml b/entries/jQuery.uniqueSort.xml
index 9d149af3..4cc08664 100644
--- a/entries/jQuery.uniqueSort.xml
+++ b/entries/jQuery.uniqueSort.xml
@@ -3,28 +3,28 @@
   jQuery.uniqueSort()
   
     1.12-and-2.2
-    
-      The Array of DOM elements.
+    
+      The Array or an Array-like object of DOM elements.
     
   
-  Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
+  Sorts an array or an array-like object of DOM elements, in place, with the duplicates removed. Note that this only works on arrays/array-likes of DOM elements, not strings or numbers.
   
-    

The $.uniqueSort() function searches through an array of objects, sorting the array, and removing any duplicate nodes. A node is considered a duplicate if it is the exact same node as one already in the array; two different nodes with identical attributes are not considered to be duplicates. This function only works on plain JavaScript arrays of DOM elements, and is chiefly used internally by jQuery. You probably will never need to use it.

+

The $.uniqueSort() function searches through an array or an array-like object of DOM elements, sorting the array/array-like, and removing any duplicate nodes. A node is considered a duplicate if it is the exact same node as one already in the input; two different nodes with identical attributes are not considered to be duplicates. This function only works on plain JavaScript arrays/array-like objects of DOM elements, and is chiefly used internally by jQuery. You probably will never need to use it.

Prior to jQuery 3.0, this method was called jQuery.unique().

As of jQuery 1.4 the results will always be returned in document order.

Removes any duplicate elements from the array of divs. Date: Sun, 15 Jan 2023 22:09:27 +0100 Subject: [PATCH 017/101] All: Update jQuery in examples from 3.5.0 to 3.6.3 --- entries2html.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries2html.xsl b/entries2html.xsl index 44ddfdbf..8b06fadf 100755 --- a/entries2html.xsl +++ b/entries2html.xsl @@ -12,7 +12,7 @@ <meta charset="utf-8"> <title> demo</title> <style> </style> - <script src="https://code.jquery.com/jquery-3.5.0.js"></script> + <script src="https://code.jquery.com/jquery-3.6.3.js"></script> <script> </script> From 8b7a184e25601d1ce2d77a00c860239057991f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Sun, 15 Jan 2023 22:09:33 +0100 Subject: [PATCH 018/101] 3.1.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c1d6814..95ceee66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.1.6", + "version": "3.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3a8268db..1d6a6e5b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.1.6", + "version": "3.1.7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 29bf132340c6f5db7e839ac2788de9456cf0f312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 3 Apr 2023 18:45:10 +0200 Subject: [PATCH 019/101] contains-selector: Mark :contains() as a jQuery extension For some reason, the relevant category was missing despite `:contains()` definitely not being a standard pseudo. Closes gh-1219 --- entries/contains-selector.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/contains-selector.xml b/entries/contains-selector.xml index e1488269..c471083f 100644 --- a/entries/contains-selector.xml +++ b/entries/contains-selector.xml @@ -25,5 +25,6 @@ $( "div:contains('John')" ).css( "text-decoration", "underline" ); ]]> + From b415ca6c0f1988da1341467694f3f7927d2a7f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 3 Apr 2023 18:45:41 +0200 Subject: [PATCH 020/101] 3.1.8 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95ceee66..458a6801 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.1.7", + "version": "3.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1d6a6e5b..a4ee7333 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.1.7", + "version": "3.1.8", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 56301c125ec36d5c9b7b5d61fb7b0f2206aeaa94 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 14 Apr 2023 17:53:53 -0700 Subject: [PATCH 021/101] Build: Add `typesense` and `spider-check` jobs Ref https://github.com/qunitjs/qunitjs.com/blob/main/docsearch.config.json Ref https://github.com/jquery/infrastructure-puppet/blob/staging/doc/search.md --- .github/workflows/spider-check.yaml | 28 +++++++++++++++++ .github/workflows/typesense.yaml | 30 ++++++++++++++++++ .travis.yml | 7 ----- docsearch.config.json | 48 +++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/spider-check.yaml create mode 100644 .github/workflows/typesense.yaml delete mode 100644 .travis.yml create mode 100644 docsearch.config.json diff --git a/.github/workflows/spider-check.yaml b/.github/workflows/spider-check.yaml new file mode 100644 index 00000000..daa13e89 --- /dev/null +++ b/.github/workflows/spider-check.yaml @@ -0,0 +1,28 @@ +name: spider-check +on: + # Once a week on Friday at 00:00 + schedule: + - cron: '0 0 * * 5' + # Or manually + workflow_dispatch: + # Or when developing this workflow + push: + paths: + - .github/workflows/spider-check.yaml + pull_request: + paths: + - .github/workflows/spider-check.yaml + +jobs: + spider-check: + env: + MY_SITE: https://api.jquery.com + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'jquery' }} # skip on forks + steps: + - uses: actions/checkout@v2 + with: + repository: jquery/hydra-link-checker + ref: v2.0.0 + - name: Run hydra-link-checker + run: python3 hydra.py "$MY_SITE" diff --git a/.github/workflows/typesense.yaml b/.github/workflows/typesense.yaml new file mode 100644 index 00000000..7d39b05a --- /dev/null +++ b/.github/workflows/typesense.yaml @@ -0,0 +1,30 @@ +name: typesense +on: + # Once a day at 11:30 UTC + schedule: + - cron: '30 11 * * *' + # Or after a deployment + push: + branches: + - main + # Or manually + workflow_dispatch: + +jobs: + typesense: + name: Update Typesense + if: ${{ github.repository_owner == 'jquery' }} # skip on forks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Docsearch Scraper + shell: bash + run: | + # 0.6.0.rc1: https://github.com/typesense/typesense-docsearch-scraper/issues/36 + docker run \ + -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_ADMIN_KEY }} \ + -e TYPESENSE_HOST="${{ secrets.TYPESENSE_HOST }}" \ + -e TYPESENSE_PORT="443" \ + -e TYPESENSE_PROTOCOL="https" \ + -e CONFIG="$(cat docsearch.config.json | jq -r tostring)" \ + typesense/docsearch-scraper:0.6.0.rc2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c4177e89..00000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "10" -addons: - apt: - packages: - - libxml2-utils diff --git a/docsearch.config.json b/docsearch.config.json new file mode 100644 index 00000000..5325f6f7 --- /dev/null +++ b/docsearch.config.json @@ -0,0 +1,48 @@ +{ + "index_name": "jquery_com", + "start_urls": [ + { "url": "https://jquery.com" }, + { "url": "https://api.jquery.com", "selectors_key": "api" } + ], + "stop_urls": [ + ".com/category/" + ], + "selectors": { + "default": { + "lvl0": { + "selector": "#menu-top .menu-item.current > a", + "global": true, + "default_value": "Documentation" + }, + "lvl1": "#content h1", + "lvl2": "#content h2", + "lvl3": "#content h3", + "lvl4": "#content h4", + "lvl5": "#content h5", + "text": "#content p, #content li, #content tr" + }, + "api": { + "lvl0": { + "selector": "#categories .cat-item.current-cat > a", + "global": true, + "default_value": "API" + }, + "lvl1": "#content h1", + "lvl2": "#content h2, #content h4.name", + "lvl3": "#content h3, #content h4:not(.name)", + "lvl4": "#content h5, #content strong:first-child", + "text": ".entry-content p, .entry-content li" + } + }, + "selectors_exclude": [ + "header ~ article", + ".returns", + ".version-details", + ".section-title", + ".icon-link.toc-link", + "[class^=toclevel]", + "#toctitle" + ], + "min_indexed_level": 2, + "scrape_start_urls": false +} From c149300c7e427aa83a8c38b163f3557f32eadd21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 24 Apr 2023 18:43:54 +0200 Subject: [PATCH 022/101] All: Mark event aliases as deprecated Mark all event shorthands as deprecated, including the AJAX ones. Create separate pages for deprecated shorthands, for example: * `/click/` describes the `click` event and how to use it with `.on()` or `.trigger()` * `/click-shorthand/` describes the deprecated `.click()` method * `/ajaxStart/` describes the `ajaxStart` event and how to use it with `.on()` * `/ajaxStart-shorthand/` describes the deprecated `.ajaxStart()` method The reason for such an approach is that event pages often contained useful information about those specific events and we didn't want to lose that. Also, the new shorthand pages all look the same and mostly redirect to the event pages so we didn't want to treat them as the primary page to go to when searching for an event. To make it less confusing, both the event page & its associated shorthand method page link to each other. Separate shorthand pages have also been created for `.load()`, `.unload()` and `.error()` methods. Those methods have already been removed in jQuery 3.0 but they also contained useful info about the associated events so it made sense to treat them like other event shorthands. Because there's no way to include both `.on()` & `.trigger()` usage in a single entry, event pages (except for AJAX ones) now have two entries each. This required wrapping the previous single `` with the new ``. To maintain Git history, the inner `` tags are left de-indented. Usage of deprecated event shorthand methods have been removed across all API entries. Fixes gh-1205 Closes gh-1223 --- entries/ajaxComplete-shorthand.xml | 19 +++++ entries/ajaxComplete.xml | 37 +++++---- entries/ajaxError-shorthand.xml | 19 +++++ entries/ajaxError.xml | 36 ++++---- entries/ajaxSend-shorthand.xml | 19 +++++ entries/ajaxSend.xml | 37 +++++---- entries/ajaxStart-shorthand.xml | 19 +++++ entries/ajaxStart.xml | 33 +++++--- entries/ajaxStop-shorthand.xml | 19 +++++ entries/ajaxStop.xml | 31 ++++--- entries/ajaxSuccess-shorthand.xml | 19 +++++ entries/ajaxSuccess.xml | 35 ++++---- entries/animate.xml | 24 +++--- entries/animated-selector.xml | 2 +- entries/attr.xml | 6 +- entries/bind.xml | 4 +- entries/blur-shorthand.xml | 37 +++++++++ entries/blur.xml | 72 ++++++++++------ entries/button-selector.xml | 4 +- entries/change-shorthand.xml | 36 ++++++++ entries/change.xml | 77 ++++++++++------- entries/checkbox-selector.xml | 4 +- entries/children.xml | 4 +- entries/clearQueue.xml | 4 +- entries/click-shorthand.xml | 36 ++++++++ entries/click.xml | 71 +++++++++------- entries/contextmenu-shorthand.xml | 36 ++++++++ entries/contextmenu.xml | 59 ++++++++----- entries/css.xml | 4 +- entries/data.xml | 2 +- entries/dblclick-shorthand.xml | 36 ++++++++ entries/dblclick.xml | 73 ++++++++++------- entries/delay.xml | 2 +- entries/delegate.xml | 2 +- entries/dequeue.xml | 2 +- entries/detach.xml | 4 +- entries/each.xml | 12 +-- entries/empty.xml | 4 +- entries/error-shorthand.xml | 37 +++++++++ entries/error.xml | 58 ++++++++----- entries/event.currentTarget.xml | 4 +- entries/event.isDefaultPrevented.xml | 2 +- .../event.isImmediatePropagationStopped.xml | 2 +- entries/event.isPropagationStopped.xml | 4 +- entries/event.metaKey.xml | 2 +- entries/event.namespace.xml | 2 +- entries/event.preventDefault.xml | 2 +- entries/event.relatedTarget.xml | 4 +- entries/event.result.xml | 4 +- entries/event.stopImmediatePropagation.xml | 6 +- entries/event.stopPropagation.xml | 2 +- entries/event.target.xml | 4 +- entries/event.timeStamp.xml | 2 +- entries/event.type.xml | 2 +- entries/fadeIn.xml | 8 +- entries/fadeOut.xml | 10 +-- entries/fadeTo.xml | 22 ++--- entries/fadeToggle.xml | 10 +-- entries/file-selector.xml | 8 +- entries/focus-shorthand.xml | 37 +++++++++ entries/focus.xml | 82 +++++++++++-------- entries/focusin-shorthand.xml | 37 +++++++++ entries/focusin.xml | 52 ++++++++---- entries/focusout-shorthand.xml | 37 +++++++++ entries/focusout.xml | 64 +++++++++------ entries/get.xml | 2 +- entries/height.xml | 6 +- entries/hide.xml | 12 +-- entries/hover.xml | 19 +++-- entries/html.xml | 2 +- entries/image-selector.xml | 8 +- entries/index.xml | 2 +- entries/input-selector.xml | 4 +- entries/is.xml | 8 +- entries/jQuery.ajax.xml | 2 +- entries/jQuery.ajaxSetup.xml | 2 +- entries/jQuery.data.xml | 4 +- entries/jQuery.dequeue.xml | 2 +- entries/jQuery.fx.interval.xml | 2 +- entries/jQuery.fx.off.xml | 6 +- entries/jQuery.getScript.xml | 8 +- entries/jQuery.post.xml | 6 +- entries/jQuery.queue.xml | 14 ++-- entries/jQuery.sub.xml | 2 +- entries/jQuery.xml | 4 +- entries/keydown-shorthand.xml | 36 ++++++++ entries/keydown.xml | 75 ++++++++++------- entries/keypress-shorthand.xml | 36 ++++++++ entries/keypress.xml | 75 ++++++++++------- entries/keyup-shorthand.xml | 36 ++++++++ entries/keyup.xml | 77 ++++++++++------- entries/length.xml | 4 +- entries/live.xml | 2 +- entries/load-event.xml | 63 ++++++++------ entries/load-shorthand.xml | 40 +++++++++ entries/map.xml | 4 +- entries/mousedown-shorthand.xml | 36 ++++++++ entries/mousedown.xml | 69 ++++++++++------ entries/mouseenter-shorthand.xml | 36 ++++++++ entries/mouseenter.xml | 75 ++++++++++------- entries/mouseleave-shorthand.xml | 36 ++++++++ entries/mouseleave.xml | 75 ++++++++++------- entries/mousemove-shorthand.xml | 36 ++++++++ entries/mousemove.xml | 75 ++++++++++------- entries/mouseout-shorthand.xml | 36 ++++++++ entries/mouseout.xml | 73 ++++++++++------- entries/mouseover-shorthand.xml | 36 ++++++++ entries/mouseover.xml | 75 ++++++++++------- entries/mouseup-shorthand.xml | 36 ++++++++ entries/mouseup.xml | 69 ++++++++++------ entries/nth-child-selector.xml | 2 +- entries/nth-last-child-selector.xml | 2 +- entries/nth-last-of-type-selector.xml | 2 +- entries/off.xml | 4 +- entries/offset.xml | 2 +- entries/on.xml | 2 +- entries/parents.xml | 2 +- entries/password-selector.xml | 8 +- entries/prev.xml | 2 +- entries/prop.xml | 4 +- entries/queue.xml | 14 ++-- entries/radio-selector.xml | 8 +- entries/remove.xml | 6 +- entries/removeAttr.xml | 2 +- entries/replaceWith.xml | 4 +- entries/reset-selector.xml | 8 +- entries/resize-shorthand.xml | 36 ++++++++ entries/resize.xml | 57 ++++++++----- entries/scroll-shorthand.xml | 36 ++++++++ entries/scroll.xml | 69 ++++++++++------ entries/select-shorthand.xml | 36 ++++++++ entries/select.xml | 69 ++++++++++------ entries/selected-selector.xml | 6 +- entries/serializeArray.xml | 10 +-- entries/show.xml | 16 ++-- entries/size.xml | 6 +- entries/slice.xml | 2 +- entries/slideDown.xml | 18 ++-- entries/slideToggle.xml | 6 +- entries/slideUp.xml | 8 +- entries/stop.xml | 6 +- entries/submit-selector.xml | 10 +-- entries/submit-shorthand.xml | 36 ++++++++ entries/submit.xml | 67 +++++++++------ entries/text-selector.xml | 8 +- entries/toggle.xml | 10 +-- entries/toggleClass.xml | 10 +-- entries/trigger.xml | 12 +-- entries/triggerHandler.xml | 12 +-- entries/unbind.xml | 4 +- entries/undelegate.xml | 4 +- entries/unload-shorthand.xml | 37 +++++++++ entries/unload.xml | 55 ++++++++----- entries/unwrap.xml | 2 +- entries/val.xml | 10 +-- entries/visible-selector.xml | 8 +- entries/width.xml | 12 +-- notes.xsl | 9 +- pages/Types.html | 10 +-- 159 files changed, 2497 insertions(+), 1042 deletions(-) create mode 100644 entries/ajaxComplete-shorthand.xml create mode 100644 entries/ajaxError-shorthand.xml create mode 100644 entries/ajaxSend-shorthand.xml create mode 100644 entries/ajaxStart-shorthand.xml create mode 100644 entries/ajaxStop-shorthand.xml create mode 100644 entries/ajaxSuccess-shorthand.xml create mode 100644 entries/blur-shorthand.xml create mode 100644 entries/change-shorthand.xml create mode 100644 entries/click-shorthand.xml create mode 100644 entries/contextmenu-shorthand.xml create mode 100644 entries/dblclick-shorthand.xml create mode 100644 entries/error-shorthand.xml create mode 100644 entries/focus-shorthand.xml create mode 100644 entries/focusin-shorthand.xml create mode 100644 entries/focusout-shorthand.xml create mode 100644 entries/keydown-shorthand.xml create mode 100644 entries/keypress-shorthand.xml create mode 100644 entries/keyup-shorthand.xml create mode 100644 entries/load-shorthand.xml create mode 100644 entries/mousedown-shorthand.xml create mode 100644 entries/mouseenter-shorthand.xml create mode 100644 entries/mouseleave-shorthand.xml create mode 100644 entries/mousemove-shorthand.xml create mode 100644 entries/mouseout-shorthand.xml create mode 100644 entries/mouseover-shorthand.xml create mode 100644 entries/mouseup-shorthand.xml create mode 100644 entries/resize-shorthand.xml create mode 100644 entries/scroll-shorthand.xml create mode 100644 entries/select-shorthand.xml create mode 100644 entries/submit-shorthand.xml create mode 100644 entries/unload-shorthand.xml diff --git a/entries/ajaxComplete-shorthand.xml b/entries/ajaxComplete-shorthand.xml new file mode 100644 index 00000000..73d766d5 --- /dev/null +++ b/entries/ajaxComplete-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxComplete() + Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxComplete", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index f96dc4cf..168865e7 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -1,8 +1,12 @@ - - .ajaxComplete() + + ajaxComplete event + Register a handler to be called when Ajax requests complete. This is an AjaxEvent. - 1.0 + 1.7 + + The string "ajaxComplete". + @@ -10,9 +14,11 @@ The function to be invoked. - Register a handler to be called when Ajax requests complete. This is an AjaxEvent. -

Whenever an Ajax request completes, jQuery triggers the ajaxComplete event. Any and all handlers that have been registered with the .ajaxComplete() method are executed at this time.

+
+

This page describes the ajaxComplete event. For the deprecated .ajaxComplete() method, see .ajaxComplete().

+
+

Whenever an Ajax request completes, jQuery triggers the ajaxComplete event. Any and all registered ajaxComplete handlers are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -21,38 +27,39 @@
     

Attach the event handler to the document:


-$( document ).ajaxComplete(function() {
+$( document ).on( "ajaxComplete", function() {
   $( ".log" ).text( "Triggered ajaxComplete handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger)" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request completes, the log message is displayed.

All ajaxComplete handlers are invoked, regardless of what Ajax request was completed. If you must differentiate between the requests, use the parameters passed to the handler. Each time an ajaxComplete handler is executed, it is passed the event object, the XMLHttpRequest object, and the settings object that was used in the creation of the request. For example, you can restrict the callback to only handling events dealing with a particular URL:


-$( document ).ajaxComplete(function( event, xhr, settings ) {
+$( document ).on( "ajaxComplete", function( event, xhr, settings ) {
   if ( settings.url === "ajax/test.html" ) {
     $( ".log" ).text( "Triggered ajaxComplete handler. The result is " +
       xhr.responseText );
   }
-});
+} );
     

Note: You can get the returned Ajax contents by looking at xhr.responseText.

- - + + Show a message when an Ajax request completes. +
diff --git a/entries/ajaxError-shorthand.xml b/entries/ajaxError-shorthand.xml new file mode 100644 index 00000000..c1a306bd --- /dev/null +++ b/entries/ajaxError-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxError() + Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxError", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 19abee09..d18cf977 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -1,8 +1,12 @@ - - .ajaxError() + + ajaxError event + Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxError". + The function to be invoked. @@ -11,9 +15,11 @@ - Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. -

Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have been registered with the .ajaxError() method are executed at this time. Note: This handler is not called for cross-domain script and cross-domain JSONP requests.

+
+

This page describes the ajaxError event. For the deprecated .ajaxError() method, see .ajaxError().

+
+

Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all registered ajaxError handlers are executed at this time. Note: This handler is not called for cross-domain script and cross-domain JSONP requests.

To observe this method in action, set up a basic Ajax load request.


 <button class="trigger">Trigger</button>
@@ -22,35 +28,37 @@
     

Attach the event handler to the document:


-$( document ).ajaxError(function() {
+$( document ).on( "ajaxError", function() {
   $( ".log" ).text( "Triggered ajaxError handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


 $( "button.trigger" ).on( "click", function() {
   $( "div.result" ).load( "ajax/missing.html" );
-});
+} );
     

When the user clicks the button and the Ajax request fails, because the requested file is missing, the log message is displayed.

All ajaxError handlers are invoked, regardless of what Ajax request was completed. To differentiate between the requests, use the parameters passed to the handler. Each time an ajaxError handler is executed, it is passed the event object, the jqXHR object (prior to jQuery 1.5, the XHR object), and the settings object that was used in the creation of the request. When an HTTP error occurs, the fourth argument (thrownError) receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." For example, to restrict the error callback to only handling events dealing with a particular URL:


-$( document ).ajaxError(function( event, jqxhr, settings, thrownError ) {
+$( document ).on( "ajaxError", function( event, jqxhr, settings, thrownError ) {
   if ( settings.url == "ajax/missing.html" ) {
     $( "div.log" ).text( "Triggered ajaxError handler." );
   }
-});
+} ); +
- - + + Show a message when an Ajax request fails. + diff --git a/entries/ajaxSend-shorthand.xml b/entries/ajaxSend-shorthand.xml new file mode 100644 index 00000000..4c1dc9cc --- /dev/null +++ b/entries/ajaxSend-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxSend() + Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxSend", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index db814fee..ad01194e 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -1,8 +1,12 @@ - - .ajaxSend() + + ajaxSend event + Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxSend". + The function to be invoked. @@ -10,9 +14,11 @@ - Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. -

Whenever an Ajax request is about to be sent, jQuery triggers the ajaxSend event. Any and all handlers that have been registered with the .ajaxSend() method are executed at this time.

+
+

This page describes the ajaxSend event. For the deprecated .ajaxSend() method, see .ajaxSend().

+
+

Whenever an Ajax request is about to be sent, jQuery triggers the ajaxSend event. Any and all registerd ajaxSend handlers are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -21,36 +27,37 @@
     

Attach the event handler to the document:


-$( document ).ajaxSend(function() {
+$( document ).on( "ajaxSend", function() {
   $( ".log" ).text( "Triggered ajaxSend handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger)" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request is about to begin, the log message is displayed.

All ajaxSend handlers are invoked, regardless of what Ajax request is to be sent. If you must differentiate between the requests, use the parameters passed to the handler. Each time an ajaxSend handler is executed, it is passed the event object, the jqXHR object (in version 1.4, XMLHttpRequestobject), and the settings object that was used in the creation of the Ajax request. For example, you can restrict the callback to only handling events dealing with a particular URL:


-$( document ).ajaxSend(function( event, jqxhr, settings ) {
+$( document ).on( "ajaxSend", function( event, jqxhr, settings ) {
   if ( settings.url == "ajax/test.html" ) {
     $( ".log" ).text( "Triggered ajaxSend handler." );
   }
-});
+} );
     
- - + + Show a message before an Ajax request is sent. +
diff --git a/entries/ajaxStart-shorthand.xml b/entries/ajaxStart-shorthand.xml new file mode 100644 index 00000000..41c7c71a --- /dev/null +++ b/entries/ajaxStart-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxStart() + Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxStart", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index bf7fc14a..3d8f4df4 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -1,15 +1,21 @@ - - .ajaxStart() + + ajaxStart event + Register a handler to be called when the first Ajax request begins. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxStart". + The function to be invoked. - Register a handler to be called when the first Ajax request begins. This is an Ajax Event. -

Whenever an Ajax request is about to be sent, jQuery checks whether there are any other outstanding Ajax requests. If none are in progress, jQuery triggers the ajaxStart event. Any and all handlers that have been registered with the .ajaxStart() method are executed at this time.

+
+

This page describes the ajaxStart event. For the deprecated .ajaxStart() method, see .ajaxStart().

+
+

Whenever an Ajax request is about to be sent, jQuery checks whether there are any other outstanding Ajax requests. If none are in progress, jQuery triggers the ajaxStart event. Any and all handlers that have been registered with .on( "ajaxStart", ... ) are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
     

Attach the event handler to any element:


-$( document ).ajaxStart(function() {
+$( document ).on( "ajaxStart", function() {
   $( ".log" ).text( "Triggered ajaxStart handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request is sent, the log message is displayed.

- - + + Show a loading message whenever an Ajax request starts (and none is already active). +
diff --git a/entries/ajaxStop-shorthand.xml b/entries/ajaxStop-shorthand.xml new file mode 100644 index 00000000..e4b5ab83 --- /dev/null +++ b/entries/ajaxStop-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxStop() + Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxStop", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 073dd208..f42c7444 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -1,15 +1,21 @@ - - .ajaxStop() + + ajaxStop event Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxStop". + The function to be invoked. -

Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the ajaxStop event. Any and all handlers that have been registered with the .ajaxStop() method are executed at this time. The ajaxStop event is also triggered if the last outstanding Ajax request is cancelled by returning false within the beforeSend callback function.

+
+

This page describes the ajaxStop event. For the deprecated .ajaxStop() method, see .ajaxStop().

+
+

Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the ajaxStop event. Any and all registered ajaxStop handlers are executed at this time. The ajaxStop event is also triggered if the last outstanding Ajax request is cancelled by returning false within the beforeSend callback function.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
     

Attach the event handler to the document:


-$( document ).ajaxStop(function() {
+$( document ).on( "ajaxStop", function() {
   $( ".log" ).text( "Triggered ajaxStop handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request completes, the log message is displayed.

- - + + Hide a loading message after all the Ajax requests have stopped. +
diff --git a/entries/ajaxSuccess-shorthand.xml b/entries/ajaxSuccess-shorthand.xml new file mode 100644 index 00000000..358b5ff5 --- /dev/null +++ b/entries/ajaxSuccess-shorthand.xml @@ -0,0 +1,19 @@ + + + .ajaxSuccess() + Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + + 1.0 + + The function to be invoked. + + + +
+

This API is deprecated. Use .on( "ajaxSuccess", handler ) instead.

+
+
+ + + +
diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 840ec028..e92a1269 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -1,8 +1,12 @@ - - .ajaxSuccess() + + ajaxSuccess event + Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. - 1.0 + 1.7 + + The string "ajaxSuccess". + The function to be invoked. @@ -11,9 +15,11 @@ - Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. -

Whenever an Ajax request completes successfully, jQuery triggers the ajaxSuccess event. Any and all handlers that have been registered with the .ajaxSuccess() method are executed at this time.

+
+

This page describes the ajaxSuccess event. For the deprecated .ajaxSuccess() method, see .ajaxSuccess().

+
+

Whenever an Ajax request completes successfully, jQuery triggers the ajaxSuccess event. Any and all registered ajaxSuccess handlers are executed at this time.

To observe this method in action, set up a basic Ajax load request:


 <div class="trigger">Trigger</div>
@@ -22,38 +28,39 @@
     

Attach the event handler to any element:


-$(document).ajaxSuccess(function() {
+$( document ).on( "ajaxSuccess", function() {
   $( ".log" ).text( "Triggered ajaxSuccess handler." );
-});
+} );
     

Now, make an Ajax request using any jQuery method:


 $( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
-});
+} );
     

When the user clicks the element with class trigger and the Ajax request completes successfully, the log message is displayed.

All ajaxSuccess handlers are invoked, regardless of what Ajax request was completed. If you must differentiate between the requests, you can use the parameters passed to the handler. Each time an ajaxSuccess handler is executed, it is passed the event object, the XMLHttpRequest object, and the settings object that was used in the creation of the request. For example, you can restrict the callback to only handling events dealing with a particular URL:


-$( document ).ajaxSuccess(function( event, xhr, settings ) {
+$( document ).on( "ajaxSuccess", function( event, xhr, settings ) {
   if ( settings.url == "ajax/test.html" ) {
     $( ".log" ).text( "Triggered ajaxSuccess handler. The Ajax response was: " +
       xhr.responseText );
   }
-});
+} );
     

Note: You can get the returned Ajax contents by looking at xhr.responseXML or xhr.responseText for xml and html respectively.

- - + + Show a message when an Ajax request completes successfully. +
diff --git a/entries/animate.xml b/entries/animate.xml index 57af4823..1ece251c 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -45,7 +45,7 @@

To animate the opacity, left offset, and height of the image simultaneously:


-$( "#clickme" ).click(function() {
+$( "#clickme)" ).on( "click", function() {
   $( "#book" ).animate({
     opacity: 0.25,
     left: "+=50",
@@ -101,7 +101,7 @@ $( "li" ).animate({
     

As of jQuery version 1.4, you can set per-property easing functions within a single .animate() call. In the first version of .animate(), each property can take an array as its value: The first member of the array is the CSS property and the second member is an easing function. If a per-property easing function is not defined for a particular property, it uses the value of the .animate() method's optional easing argument. If the easing argument is not defined, the default swing function is used.

For example, to simultaneously animate the width and height with the swing easing function and the opacity with the linear easing function:


-$( "#clickme" ).click(function() {
+$( "#clickme)" ).on( "click", function() {
   $( "#book" ).animate({
     width: [ "toggle", "swing" ],
     height: [ "toggle", "swing" ],
@@ -113,7 +113,7 @@ $( "#clickme" ).click(function() {
     

In the second version of .animate(), the options object can include the specialEasing property, which is itself an object of CSS properties and their corresponding easing functions. For example, to simultaneously animate the width using the linear easing function and the height using the easeOutBounce easing function:


-$( "#clickme" ).click(function() {
+$( "#clickme)" ).on( "click", function() {
   $( "#book" ).animate({
     width: "toggle",
     height: "toggle"
@@ -137,7 +137,7 @@ $( "#clickme" ).click(function() {
     
@@ -191,7 +191,7 @@ $( "#left" ).click(function(){
 
 The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.
     
       
diff --git a/entries/blur-shorthand.xml b/entries/blur-shorthand.xml
new file mode 100644
index 00000000..589a1ceb
--- /dev/null
+++ b/entries/blur-shorthand.xml
@@ -0,0 +1,37 @@
+
+
+  .blur()
+  Bind an event handler to the "blur" event, or trigger that event on an element.
+  
+    1.0
+    
+      A function to execute each time the event is triggered.
+      
+    
+  
+  
+    1.4.3
+    
+      An object containing data that will be passed to the event handler.
+    
+    
+      A function to execute each time the event is triggered.
+      
+    
+  
+  
+    1.0
+  
+  
+    
+

This API is deprecated.

+

Instead of .blur( handler ) or .blur( eventData, handler ), use .on( "blur", handler ) or .on( "blur", eventData, handler ), respectively.

+

Instead of .blur(), use .trigger( "blur" ).

+
+
+ + + + + +
diff --git a/entries/blur.xml b/entries/blur.xml index 11afbd6a..d99003e9 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -1,16 +1,15 @@ - - .blur() - Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. + + +Bind an event handler to the "blur" event, or trigger that event on an element. + + blur event + Bind an event handler to the "blur" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "blur". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,11 +18,10 @@ - - 1.0 - -

This method is a shortcut for .on( "blur", handler ) in the first two variations, and .trigger( "blur" ) in the third.

+
+

This page describes the blur event. For the deprecated .blur() method, see .blur().

+

The blur event is sent to an element when it loses focus. Originally, this event was only applicable to form elements, such as <input>. In recent browsers, the domain of the event has been extended to include all element types. An element can lose focus via keyboard commands, such as the Tab key, or by mouse clicks elsewhere on the page.

For example, consider the HTML:


@@ -34,33 +32,53 @@
 <div id="other">
   Trigger the handler
 </div>
-The event handler can be bound to the first input field:
-$( "#target" ).blur(function() {
-  alert( "Handler for .blur() called." );
-});
+    
+

The event handler can be bound to the first input field:

+

+$( "#target" ).on( "blur", function() {
+  alert( "Handler for `blur` called." );
+} );
     

Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert:

- Handler for .blur() called. + Handler for `blur` called.

-

To trigger the event programmatically, apply .blur() without an argument:

+

To trigger the event programmatically, call .trigger( "blur" ):


-$( "#other" ).click(function() {
-  $( "#target" ).blur();
-});
+$( "#other" ).on( "click", function() {
+  $( "#target" ).trigger( "blur" );
+} );
     

After this code executes, clicks on Trigger the handler will also alert the message.

-

The blur event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the blur event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping blur to the focusout event in its event delegation methods, .live() and .delegate().

+

The blur event does not bubble. As of version 1.4.2, jQuery works around this limitation by mapping blur to the focusout event in its event delegation methods.

- To trigger the blur event on all paragraphs: - + +
+ + + blur event + Trigger the "blur" event on an element. + + 1.0 + + The string "blur". + + + +

See the description for .on( "blur", ... ).

+
+ + +
+ +
diff --git a/entries/button-selector.xml b/entries/button-selector.xml index 858522e5..12c8471c 100644 --- a/entries/button-selector.xml +++ b/entries/button-selector.xml @@ -16,9 +16,9 @@ var input = $( ":button" ).addClass( "marked" ); $( "div" ).text( "For this type jQuery found " + input.length + "." ); // Prevent the form from submitting -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]>
- + + + + + change event + Trigger the "change" event on an element. + + 1.0 + + The string "change". + + + +

See the description for .on( "change", ... ).

+
+ +
+ + diff --git a/entries/checkbox-selector.xml b/entries/checkbox-selector.xml index 843cdaf7..ba0fd815 100644 --- a/entries/checkbox-selector.xml +++ b/entries/checkbox-selector.xml @@ -26,9 +26,9 @@ $( "div" ) .css( "color", "red" ); // Prevent the form from submitting -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]> - Trigger the click event on all of the paragraphs on the page: + Trigger the click event on all the paragraphs on the page: - + + + + + click event + Trigger the "click" event on an element. + + 1.0 + + The string "click". + + + +

See the description for .on( "click", ... ).

+
+ +
+ + diff --git a/entries/contextmenu-shorthand.xml b/entries/contextmenu-shorthand.xml new file mode 100644 index 00000000..9b1f4873 --- /dev/null +++ b/entries/contextmenu-shorthand.xml @@ -0,0 +1,36 @@ + + + .contextmenu() + Bind an event handler to the "contextmenu" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
+

This API is deprecated.

+

Instead of .contextmenu( handler ) or .contextmenu( eventData, handler ), use .on( "contextmenu", handler ) or .on( "contextmenu", eventData, handler ), respectively.

+

Instead of .contextmenu(), use .trigger( "contextmenu" ).

+
+
+ + + + +
diff --git a/entries/contextmenu.xml b/entries/contextmenu.xml index 9849f7e9..63d9c179 100644 --- a/entries/contextmenu.xml +++ b/entries/contextmenu.xml @@ -1,7 +1,10 @@ - - .contextmenu() - Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. + +Bind an event handler to the "contextmenu" event, or trigger that event on an element. + + + contextmenu event + Bind an event handler to the "contextmenu" event. 1.0 @@ -19,12 +22,11 @@ - - 1.0 - -

This method is a shortcut for .on( "contextmenu", handler ) in the first two variations, and .trigger( "contextmenu" ) in the third. - The contextmenu event is sent to an element when the right button of the mouse is clicked on it, but before the context menu is displayed. In case the context menu key is pressed, the event is triggered on the html element or the currently focused element. Any HTML element can receive this event. +

+

This page describes the contextmenu event. For the deprecated .contextmenu() method, see .contextmenu().

+
+

The contextmenu event is sent to an element when the right button of the mouse is clicked on it, but before the context menu is displayed. In case the context menu key is pressed, the event is triggered on the html element or the currently focused element. Any HTML element can receive this event. For example, consider the HTML:


 <div id="target">
@@ -33,35 +35,34 @@
     

The event handler can be bound to the <div> as follows:


-$( "#target" ).contextmenu(function() {
-  alert( "Handler for .contextmenu() called." );
-});
+$( "#target" ).on( "contextmenu", function() {
+  alert( "Handler for `contextmenu` called." );
+} );
     

Now right-clicking on this element displays the alert:

- Handler for .contextmenu() called. + Handler for `contextmenu` called.

-

To trigger the event manually, call .contextmenu() without an argument:

+

To trigger the event manually, use .trigger( "contextmenu" ):


-$( "#target" ).contextmenu();
+$( "#target" ).trigger( "contextmenu" );
     
- To show a "Hello World!" alert box when the contextmenu event is triggered on a paragraph on the page: Right click to toggle background color. Get the data named "blah" stored at for an element. Double click to toggle background color. diff --git a/entries/dequeue.xml b/entries/dequeue.xml index 7caca4e3..24f89c3a 100644 --- a/entries/dequeue.xml +++ b/entries/dequeue.xml @@ -14,7 +14,7 @@ Use dequeue to end a custom queue function which allows the queue to keep going. - - - + +
+ + + error event + Trigger the "error" event on an element. + + 1.0 + + The string "error". + + + +

See the description for .on( "error", ... ).

+
+ +
+ +
diff --git a/entries/event.currentTarget.xml b/entries/event.currentTarget.xml index f70a8626..859cb8d4 100644 --- a/entries/event.currentTarget.xml +++ b/entries/event.currentTarget.xml @@ -14,11 +14,11 @@ Alert that currentTarget matches the `this` keyword. -
\ No newline at end of file + diff --git a/entries/event.isDefaultPrevented.xml b/entries/event.isDefaultPrevented.xml index 676b31f3..d9ada314 100644 --- a/entries/event.isDefaultPrevented.xml +++ b/entries/event.isDefaultPrevented.xml @@ -9,7 +9,7 @@ Checks whether event.preventDefault() was called. diff --git a/entries/event.namespace.xml b/entries/event.namespace.xml index ed661c92..bbebcda4 100644 --- a/entries/event.namespace.xml +++ b/entries/event.namespace.xml @@ -14,7 +14,7 @@ $( "p" ).on( "test.something", function( event ) { alert( event.namespace ); }); -$( "button" ).click(function( event ) { +$( "button" ).on( "click", function( event ) { $( "p" ).trigger( "test.something" ); }); ]]> diff --git a/entries/event.preventDefault.xml b/entries/event.preventDefault.xml index ac534fcb..82b4e104 100644 --- a/entries/event.preventDefault.xml +++ b/entries/event.preventDefault.xml @@ -11,7 +11,7 @@ Cancel the default action (navigation) of the click. diff --git a/entries/event.result.xml b/entries/event.result.xml index fa5cd9ad..40bd1872 100644 --- a/entries/event.result.xml +++ b/entries/event.result.xml @@ -11,10 +11,10 @@ Display previous handler's return value diff --git a/entries/event.stopImmediatePropagation.xml b/entries/event.stopImmediatePropagation.xml index e5b53eba..dd86bd7c 100644 --- a/entries/event.stopImmediatePropagation.xml +++ b/entries/event.stopImmediatePropagation.xml @@ -25,14 +25,14 @@ } ]]>
@@ -40,7 +40,7 @@ function handler( event ) { target.children().toggle(); } } -$( "ul" ).click( handler ).find( "ul" ).hide(); +$( "ul" ).on( "click", handler ).find( "ul" ).hide(); ]]>
diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml index a73fdc06..4af0872f 100644 --- a/entries/fadeIn.xml +++ b/entries/fadeIn.xml @@ -29,7 +29,7 @@ <img id="book" src="book.png" alt="" width="100" height="123"> // With the element initially hidden, we can show it slowly: -$( "#clickme" ).click(function() { +$( "#clickme)" ).on( "click", function() { $( "#book" ).fadeIn( "slow", function() { // Animation complete }); @@ -52,9 +52,9 @@ $( "#clickme" ).click(function() { Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. @@ -76,7 +76,7 @@ $( "p" ).click(function() { Fades out spans in one section that you click on. @@ -131,23 +131,23 @@ $( "p" ).each(function( n ) { $( this ).text( $( "p" ).eq( r ).text() ); $( "p" ).eq( r ).text( tmp ); $( this ).css( "left", getPos( n ) ); -}); +} ); $( "div" ) .each(function( n ) { $( this ).css( "left", getPos( n ) ); - }) + } ) .css( "cursor", "pointer" ) - .click( function() { + .on( "click", function() { $( this ).fadeTo( 250, 0.25, function() { $( this ) .css( "cursor", "" ) .prev() - .css({ + .css( { "font-weight": "bolder", "font-style": "italic" - }); - }); - }); + } ); + } ); + } ); ]]> To focus on a login input box with id 'login' on page startup, try: - + + + + + focus event + Trigger the "focus" event on an element. + + 1.0 + + The string "focus". + + + +

See the description for .on( "focus", ... ).

+
+ + +
+ + diff --git a/entries/focusin-shorthand.xml b/entries/focusin-shorthand.xml new file mode 100644 index 00000000..ff8f548e --- /dev/null +++ b/entries/focusin-shorthand.xml @@ -0,0 +1,37 @@ + + + .focusin() + Bind an event handler to the "focusin" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
+

This API is deprecated.

+

Instead of .focusin( handler ) or .focusin( eventData, handler ), use .on( "focusin", handler ) or .on( "focusin", eventData, handler ), respectively.

+

Instead of .focusin(), use .trigger( "focusin" ).

+
+
+ + + + + +
diff --git a/entries/focusin.xml b/entries/focusin.xml index aaff429d..7b5288f6 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -1,16 +1,15 @@ - - .focusin() + + +Bind an event handler to the "focusin" event, or trigger that event on an element. + + focusin event Bind an event handler to the "focusin" event. - 1.4 - - A function to execute each time the event is triggered. - + 1.7 + + The string "focusin". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,15 +18,13 @@ - - 1.0 - -

This method is a shortcut for .on( "focusin", handler ) in the first two variations, and .trigger( "focusin" ) in the third.

+
+

This page describes the focusin event. For the deprecated .focusin() method, see .focusin().

+

The focusin event is sent to an element when it, or any element inside of it, gains focus. This is distinct from the focus event in that it supports detecting the focus event on parent elements (in other words, it supports event bubbling).

This event will likely be used together with the focusout event.

- Watch for a focus to occur within the paragraphs on the page.
diff --git a/entries/hide.xml b/entries/hide.xml index b90aed05..53aab56d 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -49,7 +49,7 @@ $( ".target" ).hide();

 // With the element initially shown, we can hide it slowly:
-$( "#clickme" ).click(function() {
+$( "#clickme)" ).on( "click", function() {
   $( "#book" ).hide( "slow", function() {
     alert( "Animation complete." );
   });
@@ -68,7 +68,7 @@ $( "#clickme" ).click(function() {
     Hides all paragraphs then the link on click.
     
@@ -101,13 +101,13 @@ $( "button" ).click(function() {
   
     Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.
     
@@ -134,7 +134,7 @@ $( "#shower" ).click(function() {
 for ( var i = 0; i < 5; i++ ) {
   $( "
" ).appendTo( document.body ); } -$( "div" ).click(function() { +$( "div)" ).on( "click", function() { $( this ).hide( 2000, function() { $( this ).remove(); }); diff --git a/entries/hover.xml b/entries/hover.xml index 2ddab1fa..a924d368 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -1,7 +1,7 @@ Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. - + .hover() Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. @@ -16,12 +16,15 @@ +
+

This API is deprecated. Use .on( "mouseenter", handlerIn ).on( "mouseleave", handlerOut ) instead.

+

The .hover() method binds handlers for both mouseenter and mouseleave events. You can use it to simply apply behavior to an element during the time the mouse is within the element.

Calling $( selector ).hover( handlerIn, handlerOut ) is shorthand for:


-$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );
+$( selector ).on( "mouseenter", handlerIn ).on( "mouseleave", handlerOut );
       
-

See the discussions for .mouseenter() and .mouseleave() for more details.

+

See the discussions for mouseenter and mouseleave for more details.

To add a special style to list items that are being hovered over, try: @@ -80,8 +83,10 @@ $( "td" ).off( "mouseenter mouseleave" ); +
- + + Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. 1.4 @@ -91,12 +96,15 @@ $( "td" ).off( "mouseenter mouseleave" ); +
+

This API is deprecated. Use .on( "mouseenter mouseleave", handlerInOut ) instead.

+

The .hover() method, when passed a single function, will execute that handler for both mouseenter and mouseleave events. This allows the user to use jQuery's various toggle methods within the handler or to respond differently within the handler depending on the event.type.

Calling $(selector).hover(handlerInOut) is shorthand for:


 $( selector ).on( "mouseenter mouseleave", handlerInOut );
       
-

See the discussions for .mouseenter() and .mouseleave() for more details.

+

See the discussions for mouseenter and mouseleave for more details.

Slide the next sibling LI up or down on hover, and toggle a class. @@ -143,5 +151,6 @@ $( "li" ) +
diff --git a/entries/html.xml b/entries/html.xml index b830c566..4be065f3 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -29,7 +29,7 @@ $( "div.demo-container" ).html(); Click a paragraph to convert it from html to text.
diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index 74bfd60a..3c93466d 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -20,10 +20,10 @@ var toggleFx = function() { $.fx.off = !$.fx.off; }; toggleFx(); -$( "button" ).click( toggleFx ); -$( "input" ).click(function() { +$( "button" ).on( "click", toggleFx ); +$( "input)" ).on( "click", function() { $( "div" ).toggle( "slow" ); -}); +} ); ]]> Queue a custom function. Selector Context

By default, selectors perform their searches within the DOM starting at the document root. However, an alternate context can be given for the search by using the optional second parameter to the $() function. For example, to do a search within an event handler, the search can be restricted like so:


-$( "div.foo" ).click(function() {
+$( "div.foo)" ).on( "click", function() {
   $( "span", this ).addClass( "bar" );
 });
       
@@ -62,7 +62,7 @@ $( "div.foo" ).click(function() {

Please note that although you can pass text nodes and comment nodes into a jQuery collection this way, most operations don't support them. The few that do will have an explicit note on their API documentation page.

A common use of single-DOM-element construction is to call jQuery methods on an element that has been passed to a callback function through the keyword this:


-$( "div.foo" ).click(function() {
+$( "div.foo)" ).on( "click", function() {
   $( this ).slideUp();
 });
       
diff --git a/entries/keydown-shorthand.xml b/entries/keydown-shorthand.xml new file mode 100644 index 00000000..98b125b3 --- /dev/null +++ b/entries/keydown-shorthand.xml @@ -0,0 +1,36 @@ + + + .keydown() + Bind an event handler to the "keydown" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
+

This API is deprecated.

+

Instead of .keydown( handler ) or .keydown( eventData, handler ), use .on( "keydown", handler ) or .on( "keydown", eventData, handler ), respectively.

+

Instead of .keydown(), use .trigger( "keydown" ).

+
+
+ + + + +
diff --git a/entries/keydown.xml b/entries/keydown.xml index f21ae4e0..576a1ad0 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -1,15 +1,15 @@ - - .keydown() + +Bind an event handler to the "keydown" event, or trigger that event on an element. + + + keydown event + Bind an event handler to the "keydown" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "keydown". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -18,12 +18,10 @@ - - 1.0 - - Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. -

This method is a shortcut for .on( "keydown", handler ) in the first and second variations, and .trigger( "keydown" ) in the third.

+
+

This page describes the keydown event. For the deprecated .keydown() method, see .keydown().

+

The keydown event is sent to an element when the user presses a key on the keyboard. If the key is kept pressed, the event is sent every time the operating system repeats the key. It can be attached to any element, but the event is only sent to the element that has the focus. Focusable elements can vary between browsers, but form elements can always get focus so are reasonable candidates for this event type.

For example, consider the HTML:


@@ -36,42 +34,41 @@
     

The event handler can be bound to the input field:


-$( "#target" ).keydown(function() {
-  alert( "Handler for .keydown() called." );
-});
+$( "#target" ).on( "keydown", function() {
+  alert( "Handler for `keydown` called." );
+} );
     

Now when the insertion point is inside the field, pressing a key displays the alert:

- Handler for .keydown() called. + Handler for `keydown` called.

-

To trigger the event manually, apply .keydown() without an argument:

+

To trigger the event manually, use .trigger( "keydown" ):


-$( "#other" ).click(function() {
-  $( "#target" ).keydown();
-});
+$( "#other" ).on( "click", function() {
+  $( "#target" ).trigger( "keydown" );
+} );
     

After this code executes, clicks on Trigger the handler will also alert the message.

If key presses anywhere need to be caught (for example, to implement global shortcut keys on a page), it is useful to attach this behavior to the document object. Because of event bubbling, all key presses will make their way up the DOM to the document object unless explicitly stopped.

To determine which key was pressed, examine the event object that is passed to the handler function. While browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve the key code. This code corresponds to a key on the keyboard, including codes for special keys such as arrows. For catching actual text entry, .keypress() may be a better choice.

- Show the event object for the keydown handler when a key is pressed in the input. diff --git a/entries/live.xml b/entries/live.xml index e88a67ce..26e7a563 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -104,7 +104,7 @@ $( "p" ).live( "myCustomEvent", function( event, myName, myValue ) { .fadeIn( 30 ) .fadeOut( 1000 ); }); -$( "button" ).click(function() { +$( "button)" ).on( "click", function() { $( "p" ).trigger( "myCustomEvent" ); }); ]]> diff --git a/entries/load-event.xml b/entries/load-event.xml index b9669cc6..f7dbc65a 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -1,16 +1,15 @@ - - .load() - Bind an event handler to the "load" JavaScript event. + +Bind an event handler to the "load" event, or trigger that event on an element. + + + load event + Bind an event handler to the "load" event. - 1.0 - - A function to execute when the event is triggered. - + 1.7 + + The string "load". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -21,9 +20,8 @@
-

Note: This API has been removed in jQuery 3.0; please use .on( "load", handler ) instead of .load( handler ) and .trigger( "load" ) instead of .load().

+

This page describes the load event. For the .load() method removed in jQuery 3.0, see .load().

-

This method is a shortcut for .on( "load", handler ).

The load event is sent to an element when it and all sub-elements have been completely loaded. This event can be sent to any element associated with a URL: images, scripts, frames, iframes, and the window object.

For example, consider a page with a simple image:


@@ -31,20 +29,17 @@
     

The event handler can be bound to the image:


-$( "#book" ).load(function() {
-  // Handler for .load() called.
-});
+$( "#book" ).on( "load", function() {
+  // Handler for `load` called.
+} );
     

As soon as the image has been loaded, the handler is called.

In general, it is not necessary to wait for all images to be fully loaded. If code can be executed earlier, it is usually best to place it in a handler sent to the .ready() method.

-
-

The Ajax module also has a method named .load(). Which one is fired depends on the set of arguments passed.

-

Caveats of the load event when used with images -

A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

+

A common challenge developers attempt to solve using the load shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

  • It doesn't work consistently nor reliably cross-browser
  • It doesn't fire correctly in WebKit if the image src is set to the same src as before
  • @@ -60,24 +55,40 @@ $( "#book" ).load(function() { Run a function when the page is fully loaded including graphics. Add the class bigImg to all images with height greater than 100 upon each image load. - - - + + + + + load event + Trigger the "load" event on an element. + + 1.0 + + The string "load". + + + +

    See the description for .on( "load", ... ).

    +
    + +
    + + diff --git a/entries/load-shorthand.xml b/entries/load-shorthand.xml new file mode 100644 index 00000000..1c5873cb --- /dev/null +++ b/entries/load-shorthand.xml @@ -0,0 +1,40 @@ + + + .load() + Bind an event handler to the "load" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API has been removed in jQuery 3.0.

    +

    Instead of .load( handler ) or .load( eventData, handler ), use .on( "load", handler ) or .on( "load", eventData, handler ), respectively.

    +

    Instead of .load(), use .trigger( "load" ).

    +
    +
    +

    The Ajax module also has a method named .load(). Which one is fired depends on the set of arguments passed.

    +
    +
    + + + + + +
    diff --git a/entries/map.xml b/entries/map.xml index c151e831..101fa001 100644 --- a/entries/map.xml +++ b/entries/map.xml @@ -135,9 +135,9 @@ $.fn.equalizeHeights = function() { return this.height( Math.max.apply( this, maxHeight ) ); }; -$( "input" ).click(function() { +$( "input" ).on( "click", function() { $( "div" ).equalizeHeights(); -}); +} ); ]]> 300 " ) .parent() - .css({ + .css( { background: "yellow", border: "3px red solid" - }); + } ); $( "div" ) .text( "For this type jQuery found " + input.length + "." ) .css( "color", "red" ); // Prevent form submission -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { event.preventDefault(); -}); +} ); ]]> diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml index 92a92b22..46ce85b2 100644 --- a/entries/removeAttr.xml +++ b/entries/removeAttr.xml @@ -22,7 +22,7 @@ console.log( "onclick property: ", $element[ 0 ].onclick ); @@ -108,7 +108,7 @@ $( "p" ).replaceWith( "Paragraph. " ); On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. diff --git a/entries/reset-selector.xml b/entries/reset-selector.xml index 301b0e5e..db558608 100644 --- a/entries/reset-selector.xml +++ b/entries/reset-selector.xml @@ -13,18 +13,18 @@ Finds all reset inputs. - + + + + + resize event + Trigger the "resize" event on an element. + + 1.0 + + The string "resize". + + + +

    See the description for .on( "resize", ... ).

    +
    + +
    + + diff --git a/entries/scroll-shorthand.xml b/entries/scroll-shorthand.xml new file mode 100644 index 00000000..67b7997e --- /dev/null +++ b/entries/scroll-shorthand.xml @@ -0,0 +1,36 @@ + + + .scroll() + Bind an event handler to the "scroll" event, or trigger that event on an element. + + 1.0 + + A function to execute each time the event is triggered. + + + + + 1.4.3 + + An object containing data that will be passed to the event handler. + + + A function to execute each time the event is triggered. + + + + + 1.0 + + +
    +

    This API is deprecated.

    +

    Instead of .scroll( handler ) or .scroll( eventData, handler ), use .on( "scroll", handler ) or .on( "scroll", eventData, handler ), respectively.

    +

    Instead of .scroll(), use .trigger( "scroll" ).

    +
    +
    + + + + +
    diff --git a/entries/scroll.xml b/entries/scroll.xml index 8529cb0c..5f46ddfe 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -1,16 +1,15 @@ - - .scroll() - Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. + + +Bind an event handler to the "scroll" event, or trigger that event on an element. + + scroll event + Bind an event handler to the "scroll" event. - 1.0 - - A function to execute each time the event is triggered. - + 1.7 + + The string "scroll". - - - 1.4.3 An object containing data that will be passed to the event handler. @@ -19,11 +18,10 @@ - - 1.0 - -

    This method is a shortcut for .on( "scroll", handler ) in the first and second variations, and .trigger( "scroll" ) in the third.

    +
    +

    This page describes the scroll event. For the deprecated .scroll() method, see .scroll().

    +

    The scroll event is sent to an element when the user scrolls to a different place in the element. It applies to window objects, but also to scrollable frames and elements with the overflow CSS property set to scroll (or auto when the element's explicit height or width is less than the height or width of its contents).

    For example, consider the HTML:

    
    @@ -41,7 +39,7 @@
       Trigger the handler
     </div>
     <div id="log"></div>
    -
    +

The style definition is present to make the target element small enough to be scrollable:

@@ -49,33 +47,32 @@

The scroll event handler can be bound to this element:


-$( "#target" ).scroll(function() {
-  $( "#log" ).append( "<div>Handler for .scroll() called.</div>" );
-});
+$( "#target" ).on( "scroll", function() {
+  $( "#log" ).append( "<div>Handler for `scroll` called.</div>" );
+} );
     

Now when the user scrolls the text up or down, one or more messages are appended to <div id="log"></div>:

- Handler for .scroll() called. + Handler for `scroll` called.

-

To trigger the event manually, apply .scroll() without an argument:

+

To trigger the event manually, use .trigger( "scroll" ):


-$( "#other" ).click(function() {
-  $( "#target" ).scroll();
-});
+$( "#other" ).on( "click", function() {
+  $( "#target" ).trigger( "scroll" );
+} );
     

After this code executes, clicks on Trigger the handler will also append the message.

A scroll event is sent whenever the element's scroll position changes, regardless of the cause. A mouse click or drag on the scroll bar, dragging inside the element, pressing the arrow keys, or using the mouse's scroll wheel could cause this event.

- To do something when your page is scrolled: - + + + + + select event + Trigger the "select" event on an element. + + 1.0 + + The string "select". + + + +

See the description for .on( "select", ... ).

+
+ +
+ + diff --git a/entries/selected-selector.xml b/entries/selected-selector.xml index c96bf422..5eb6cef8 100644 --- a/entries/selected-selector.xml +++ b/entries/selected-selector.xml @@ -14,13 +14,13 @@ Attaches a change event to the select that gets the text for each selected option and writes them in the div. It then triggers the event for the initial text draw. @@ -84,13 +84,13 @@ $( "button" ).click(function() { Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. @@ -120,19 +120,19 @@ function doIt() { $( "span,div" ).show( "slow" ); } // Can pass in function name -$( "button" ).click( doIt ); +$( "button" ).on( "click", doIt ); -$( "form" ).submit(function( event ) { +$( "form" ).on( "submit", function( event ) { if ( $( "input" ).val() === "yes" ) { $( "p" ).show( 4000, function() { $( this ).text( "Ok, DONE! (now showing)" ); - }); + } ); } $( "span,div" ).hide( "fast" ); // Prevent form submission event.preventDefault(); -}); +} ); ]]> diff --git a/entries/slice.xml b/entries/slice.xml index 81d76c98..8f94ce16 100644 --- a/entries/slice.xml +++ b/entries/slice.xml @@ -62,7 +62,7 @@ function colorEm() { ").css( 'background', 'yellow' );" ); } -$( "button" ).click( colorEm ); +$( "button" ).on( "click", colorEm ); ]]> @@ -84,7 +84,7 @@ $( "button" ).click(function() { Animates divs between dividers with a toggle that makes some appear and some disappear. diff --git a/entries/submit-selector.xml b/entries/submit-selector.xml index a4c9aa01..f6c48b8f 100644 --- a/entries/submit-selector.xml +++ b/entries/submit-selector.xml @@ -15,25 +15,25 @@ " ); -}) +} ); ]]> To trigger the submit event on the first form on the page, try: - + + + + submit event + Trigger the "submit" event on an element. + + 1.0 + + The string "submit". + + + +

See the description for .on( "submit", ... ).

+
+ + +
+ + diff --git a/entries/text-selector.xml b/entries/text-selector.xml index 9af4dc44..4886c3a5 100644 --- a/entries/text-selector.xml +++ b/entries/text-selector.xml @@ -19,19 +19,19 @@ $( "<input>" ).is( ":text" ); // true Finds all text inputs. @@ -126,7 +126,7 @@ $( "button" ).click(function() { Shows all paragraphs, then hides them all, back and forth. diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index 3ce8196c..fcb8da42 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -99,7 +99,7 @@ $( "div.foo" ).toggleClass(function() { Toggle the class 'highlight' when a paragraph is clicked. @@ -128,15 +128,15 @@ $( "p" ).click(function() { Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click. Clicks to button #2 also trigger a click for button #1. diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index d72516a8..fb2da985 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -37,15 +37,15 @@ If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event. - - - + + + + + unload event + Trigger the "unload" event on an element. + + 1.0 + + The string "unload". + + + +

See the description for .on( "unload", ... ).

+
+ +
+ + diff --git a/entries/unwrap.xml b/entries/unwrap.xml index ff6d6100..1ba959aa 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -18,7 +18,7 @@ Wrap/unwrap a div around each of the paragraphs. Set the value of an input box. Date: Mon, 24 Apr 2023 19:03:32 +0200 Subject: [PATCH 024/101] All: Mark AJAX event shorthands as deprecated in 3.5 Previously, they've been incorrectly marked as deprecated in 3.3. Ref gh-1205 Ref gh-1223 --- entries/ajaxComplete-shorthand.xml | 2 +- entries/ajaxError-shorthand.xml | 2 +- entries/ajaxSend-shorthand.xml | 2 +- entries/ajaxStart-shorthand.xml | 2 +- entries/ajaxStop-shorthand.xml | 2 +- entries/ajaxSuccess-shorthand.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/ajaxComplete-shorthand.xml b/entries/ajaxComplete-shorthand.xml index 73d766d5..8e9cc6bf 100644 --- a/entries/ajaxComplete-shorthand.xml +++ b/entries/ajaxComplete-shorthand.xml @@ -15,5 +15,5 @@ - + diff --git a/entries/ajaxError-shorthand.xml b/entries/ajaxError-shorthand.xml index c1a306bd..c1794365 100644 --- a/entries/ajaxError-shorthand.xml +++ b/entries/ajaxError-shorthand.xml @@ -15,5 +15,5 @@ - + diff --git a/entries/ajaxSend-shorthand.xml b/entries/ajaxSend-shorthand.xml index 4c1dc9cc..37d39222 100644 --- a/entries/ajaxSend-shorthand.xml +++ b/entries/ajaxSend-shorthand.xml @@ -15,5 +15,5 @@ - + diff --git a/entries/ajaxStart-shorthand.xml b/entries/ajaxStart-shorthand.xml index 41c7c71a..496152b3 100644 --- a/entries/ajaxStart-shorthand.xml +++ b/entries/ajaxStart-shorthand.xml @@ -15,5 +15,5 @@ - + diff --git a/entries/ajaxStop-shorthand.xml b/entries/ajaxStop-shorthand.xml index e4b5ab83..d5fe7f30 100644 --- a/entries/ajaxStop-shorthand.xml +++ b/entries/ajaxStop-shorthand.xml @@ -15,5 +15,5 @@ - + diff --git a/entries/ajaxSuccess-shorthand.xml b/entries/ajaxSuccess-shorthand.xml index 358b5ff5..95fa6e0e 100644 --- a/entries/ajaxSuccess-shorthand.xml +++ b/entries/ajaxSuccess-shorthand.xml @@ -15,5 +15,5 @@ - + From a8581e2f19a289abb3698d220c5c1a7f8e8b5031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 24 Apr 2023 19:04:12 +0200 Subject: [PATCH 025/101] 3.2.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c4265b8..382479f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.2.0", + "version": "3.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2850202e..c628acd1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.2.0", + "version": "3.2.1", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a71164b950e76735604c13f8542f0e3949a1a1a7 Mon Sep 17 00:00:00 2001 From: Christopher Bonnell Date: Wed, 3 May 2023 17:37:25 -0400 Subject: [PATCH 026/101] All: Fix button selectors A few selectors erroneously used `button)` instead of `button`. This has been fixed. Fixes gh-1226 Closes gh-1227 --- entries/bind.xml | 2 +- entries/data.xml | 2 +- entries/delay.xml | 2 +- entries/delegate.xml | 2 +- entries/dequeue.xml | 2 +- entries/detach.xml | 2 +- entries/each.xml | 4 ++-- entries/hide.xml | 2 +- entries/jQuery.dequeue.xml | 2 +- entries/live.xml | 2 +- entries/nth-child-selector.xml | 2 +- entries/nth-last-child-selector.xml | 2 +- entries/nth-last-of-type-selector.xml | 2 +- entries/prev.xml | 2 +- entries/remove.xml | 2 +- entries/removeAttr.xml | 2 +- entries/replaceWith.xml | 2 +- entries/show.xml | 2 +- entries/slideToggle.xml | 2 +- entries/slideUp.xml | 2 +- entries/toggle.xml | 4 ++-- entries/unwrap.xml | 2 +- entries/val.xml | 2 +- entries/visible-selector.xml | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/entries/bind.xml b/entries/bind.xml index def89e62..aa45c455 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -221,7 +221,7 @@ $( "p" ).bind( "myCustomEvent", function( e, myName, myValue ) { .fadeIn( 30 ) .fadeOut( 1000 ); }); -$( "button)" ).on( "click", function() { +$( "button" ).on( "click", function() { $( "p" ).trigger( "myCustomEvent", [ "John" ] ); }); ]]> diff --git a/entries/data.xml b/entries/data.xml index 5a4c4181..d998d38c 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -111,7 +111,7 @@ $( "div" ).data( "options" ).name === "John"; Get the data named "blah" stored at for an element. diff --git a/entries/dequeue.xml b/entries/dequeue.xml index 24f89c3a..c54401c7 100644 --- a/entries/dequeue.xml +++ b/entries/dequeue.xml @@ -14,7 +14,7 @@ Use dequeue to end a custom queue function which allows the queue to keep going. diff --git a/entries/jQuery.dequeue.xml b/entries/jQuery.dequeue.xml index d88b0779..c9b6faf2 100644 --- a/entries/jQuery.dequeue.xml +++ b/entries/jQuery.dequeue.xml @@ -18,7 +18,7 @@ Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going. diff --git a/entries/nth-child-selector.xml b/entries/nth-child-selector.xml index e2994d7d..8a5efc4c 100644 --- a/entries/nth-child-selector.xml +++ b/entries/nth-child-selector.xml @@ -53,7 +53,7 @@ $( "ul li:nth-child(2)" ).append( " - 2nd!" ); This is a playground to see how the selector works with different strings. Notice that this is different from the even and odd which have no regard for parent and just filter the list of elements to every other one. The :nth-child, however, counts the index of the child to its particular parent. In any case, it's easier to see than explain so... diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml index 46ce85b2..6df34820 100644 --- a/entries/removeAttr.xml +++ b/entries/removeAttr.xml @@ -22,7 +22,7 @@ console.log( "onclick property: ", $element[ 0 ].onclick ); diff --git a/entries/show.xml b/entries/show.xml index 0185aed7..5a807d52 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -67,7 +67,7 @@ $( "#clickme)" ).on( "click", function() { Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml index 217b9088..f3fc2352 100644 --- a/entries/slideToggle.xml +++ b/entries/slideToggle.xml @@ -63,7 +63,7 @@ $( "#clickme)" ).on( "click", function() { Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds. diff --git a/entries/slideUp.xml b/entries/slideUp.xml index c6d32eef..d21f3354 100644 --- a/entries/slideUp.xml +++ b/entries/slideUp.xml @@ -83,7 +83,7 @@ Click me! Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert. @@ -126,7 +126,7 @@ $( "button)" ).on( "click", function() { Shows all paragraphs, then hides them all, back and forth. diff --git a/entries/unwrap.xml b/entries/unwrap.xml index 1ba959aa..b2dde604 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -18,7 +18,7 @@ Wrap/unwrap a div around each of the paragraphs. Set the value of an input box. From 21e195805b73f1457e0fc26e17e9d612d8e5a342 Mon Sep 17 00:00:00 2001 From: Christopher Bonnell Date: Thu, 4 May 2023 18:26:33 -0400 Subject: [PATCH 027/101] All: Fix event selectors Multiple selectors erroneously used `selector)` instead of `selector`. This has been fixed. The typos were accidentally introduced during a mass-replace in gh-1223. Fixes gh-1228 Closes gh-1229 Ref gh-1223 Ref gh-1226 Ref gh-1227 --- entries/ajaxComplete.xml | 4 ++-- entries/ajaxSend.xml | 2 +- entries/animate.xml | 22 +++++++++++----------- entries/animated-selector.xml | 2 +- entries/clearQueue.xml | 4 ++-- entries/css.xml | 4 ++-- entries/detach.xml | 2 +- entries/each.xml | 2 +- entries/fadeIn.xml | 4 ++-- entries/fadeOut.xml | 10 +++++----- entries/fadeTo.xml | 4 ++-- entries/height.xml | 6 +++--- entries/hide.xml | 8 ++++---- entries/html.xml | 2 +- entries/index.xml | 2 +- entries/is.xml | 8 ++++---- entries/jQuery.fx.interval.xml | 2 +- entries/jQuery.fx.off.xml | 2 +- entries/jQuery.getScript.xml | 2 +- entries/jQuery.queue.xml | 6 +++--- entries/jQuery.sub.xml | 2 +- entries/jQuery.xml | 4 ++-- entries/off.xml | 4 ++-- entries/parents.xml | 2 +- entries/queue.xml | 4 ++-- entries/replaceWith.xml | 2 +- entries/show.xml | 6 +++--- entries/slideDown.xml | 2 +- entries/slideToggle.xml | 4 ++-- entries/slideUp.xml | 2 +- entries/stop.xml | 6 +++--- entries/toggle.xml | 2 +- entries/toggleClass.xml | 2 +- entries/triggerHandler.xml | 4 ++-- entries/unbind.xml | 4 ++-- entries/undelegate.xml | 4 ++-- entries/width.xml | 4 ++-- 37 files changed, 78 insertions(+), 78 deletions(-) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 168865e7..0c133516 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -7,7 +7,7 @@ The string "ajaxComplete". - + @@ -33,7 +33,7 @@ $( document ).on( "ajaxComplete", function() {

Now, make an Ajax request using any jQuery method:


-$( ".trigger)" ).on( "click", function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
 } );
     
diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index ad01194e..cbd1641c 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -33,7 +33,7 @@ $( document ).on( "ajaxSend", function() {

Now, make an Ajax request using any jQuery method:


-$( ".trigger)" ).on( "click", function() {
+$( ".trigger" ).on( "click", function() {
   $( ".result" ).load( "ajax/test.html" );
 } );
     
diff --git a/entries/animate.xml b/entries/animate.xml index 1ece251c..c4ac9e70 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -45,7 +45,7 @@

To animate the opacity, left offset, and height of the image simultaneously:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     opacity: 0.25,
     left: "+=50",
@@ -101,7 +101,7 @@ $( "li" ).animate({
     

As of jQuery version 1.4, you can set per-property easing functions within a single .animate() call. In the first version of .animate(), each property can take an array as its value: The first member of the array is the CSS property and the second member is an easing function. If a per-property easing function is not defined for a particular property, it uses the value of the .animate() method's optional easing argument. If the easing argument is not defined, the default swing function is used.

For example, to simultaneously animate the width and height with the swing easing function and the opacity with the linear easing function:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: [ "toggle", "swing" ],
     height: [ "toggle", "swing" ],
@@ -113,7 +113,7 @@ $( "#clickme)" ).on( "click", function() {
     

In the second version of .animate(), the options object can include the specialEasing property, which is itself an object of CSS properties and their corresponding easing functions. For example, to simultaneously animate the width using the linear easing function and the height using the easeOutBounce easing function:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).animate({
     width: "toggle",
     height: "toggle"
@@ -137,7 +137,7 @@ $( "#clickme)" ).on( "click", function() {
     
@@ -191,7 +191,7 @@ $( "#left)" ).on( "click", function(){
 
 The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.
     
     Detach all paragraphs from the DOM
     
@@ -76,7 +76,7 @@ $( "p)" ).on( "click", function() {
   
     Fades out spans in one section that you click on.
     
diff --git a/entries/height.xml b/entries/height.xml
index 604be8fb..3a57f603 100644
--- a/entries/height.xml
+++ b/entries/height.xml
@@ -34,13 +34,13 @@ $( document ).height();
 function showHeight( element, height ) {
   $( "div" ).text( "The height for the " + element + " is " + height + "px." );
 }
-$( "#getp)" ).on( "click", function() {
+$( "#getp" ).on( "click", function() {
   showHeight( "paragraph", $( "p" ).height() );
 });
-$( "#getd)" ).on( "click", function() {
+$( "#getd" ).on( "click", function() {
   showHeight( "document", $( document ).height() );
 });
-$( "#getw)" ).on( "click", function() {
+$( "#getw" ).on( "click", function() {
   showHeight( "window", $( window ).height() );
 });
 ]]>
diff --git a/entries/hide.xml b/entries/hide.xml
index 3db8c718..01f88a15 100644
--- a/entries/hide.xml
+++ b/entries/hide.xml
@@ -49,7 +49,7 @@ $( ".target" ).hide();
     

 // With the element initially shown, we can hide it slowly:
-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).hide( "slow", function() {
     alert( "Animation complete." );
   });
@@ -101,13 +101,13 @@ $( "button" ).on( "click", function() {
   
     Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.
     
@@ -134,7 +134,7 @@ $( "#shower)" ).on( "click", function() {
 for ( var i = 0; i < 5; i++ ) {
   $( "
" ).appendTo( document.body ); } -$( "div)" ).on( "click", function() { +$( "div" ).on( "click", function() { $( this ).hide( 2000, function() { $( this ).remove(); }); diff --git a/entries/html.xml b/entries/html.xml index 4be065f3..0eae2f74 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -29,7 +29,7 @@ $( "div.demo-container" ).html(); Click a paragraph to convert it from html to text. diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index 3c93466d..8464f69f 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -21,7 +21,7 @@ var toggleFx = function() { }; toggleFx(); $( "button" ).on( "click", toggleFx ); -$( "input)" ).on( "click", function() { +$( "input" ).on( "click", function() { $( "div" ).toggle( "slow" ); } ); ]]> diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index d6e091ab..d44d1f3a 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -94,7 +94,7 @@ $.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) { Set a queue array to delete the queue. Selector Context

By default, selectors perform their searches within the DOM starting at the document root. However, an alternate context can be given for the search by using the optional second parameter to the $() function. For example, to do a search within an event handler, the search can be restricted like so:


-$( "div.foo)" ).on( "click", function() {
+$( "div.foo" ).on( "click", function() {
   $( "span", this ).addClass( "bar" );
 });
       
@@ -62,7 +62,7 @@ $( "div.foo)" ).on( "click", function() {

Please note that although you can pass text nodes and comment nodes into a jQuery collection this way, most operations don't support them. The few that do will have an explicit note on their API documentation page.

A common use of single-DOM-element construction is to call jQuery methods on an element that has been passed to a callback function through the keyword this:


-$( "div.foo)" ).on( "click", function() {
+$( "div.foo" ).on( "click", function() {
   $( this ).slideUp();
 });
       
diff --git a/entries/off.xml b/entries/off.xml index c35a537c..fba3925c 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -46,13 +46,13 @@ function flash() { $( "div" ).show().fadeOut( "slow" ); } -$( "#bind)" ).on( "click", function() { +$( "#bind" ).on( "click", function() { $( "body" ) .on( "click", "#theone", flash ) .find( "#theone" ) .text( "Can Click!" ); }); -$( "#unbind)" ).on( "click", function() { +$( "#unbind" ).on( "click", function() { $( "body" ) .off( "click", "#theone", flash ) .find( "#theone" ) diff --git a/entries/parents.xml b/entries/parents.xml index 57b860b4..ab51cde9 100644 --- a/entries/parents.xml +++ b/entries/parents.xml @@ -82,7 +82,7 @@ function showParents() { .length; $( "b" ).text( "Unique div parents: " + len ); } -$( "span)" ).on( "click", function() { +$( "span" ).on( "click", function() { $( this ).toggleClass( "selected" ); showParents(); }); diff --git a/entries/queue.xml b/entries/queue.xml index 1a6a38ac..ec66c39f 100644 --- a/entries/queue.xml +++ b/entries/queue.xml @@ -156,7 +156,7 @@ Click here... Set a queue array to delete the queue. Paragraph. " ); On click, replace each paragraph with a div that is already in the DOM and selected with the $() function. Notice it doesn't clone the object but rather moves it to replace the paragraph. diff --git a/entries/show.xml b/entries/show.xml index 5a807d52..2ce1c4a4 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -49,7 +49,7 @@ $( ".target" ).show(); </div> <img id="book" src="book.png" alt="" width="100" height="123"> With the element initially hidden, we can show it slowly: -$( "#clickme)" ).on( "click", function() { +$( "#clickme" ).on( "click", function() { $( "#book" ).show( "slow", function() { // Animation complete. }); @@ -84,13 +84,13 @@ $( "button" ).on( "click", function() { Show the first div, followed by each next adjacent sibling div in order, with a 200ms animation. Each animation starts when the previous sibling div's animation ends. diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 749a19a7..e70c81f7 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -30,7 +30,7 @@

With the element initially hidden, we can show it slowly:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).slideDown( "slow", function() {
     // Animation complete.
   });
diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml
index f3fc2352..9a91bed8 100644
--- a/entries/slideToggle.xml
+++ b/entries/slideToggle.xml
@@ -30,7 +30,7 @@
     

We will cause .slideToggle() to be called when another element is clicked:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).slideToggle( "slow", function() {
     // Animation complete.
   });
@@ -84,7 +84,7 @@ $( "button" ).on( "click", function() {
   
     Animates divs between dividers with a toggle that makes some appear and some disappear.
     
diff --git a/entries/toggle.xml b/entries/toggle.xml
index 199c93f6..7d74577f 100644
--- a/entries/toggle.xml
+++ b/entries/toggle.xml
@@ -51,7 +51,7 @@ $( ".target" ).toggle();
     

We will cause .toggle() to be called when another element is clicked:


-$( "#clickme)" ).on( "click", function() {
+$( "#clickme" ).on( "click", function() {
   $( "#book" ).toggle( "slow", function() {
     // Animation complete.
   });
diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml
index fcb8da42..da2c894f 100644
--- a/entries/toggleClass.xml
+++ b/entries/toggleClass.xml
@@ -99,7 +99,7 @@ $( "div.foo" ).toggleClass(function() {
     
       Toggle the class 'highlight' when a paragraph is clicked.
       
diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml
index fb2da985..83b2a576 100644
--- a/entries/triggerHandler.xml
+++ b/entries/triggerHandler.xml
@@ -37,10 +37,10 @@
   
     If you called .triggerHandler() on a focus event - the browser's default focus action would not be triggered, only the event handlers bound to the focus event.
      'token_separators': ['_', '-']

This should make it so that "jQuery.ajax" is tokenised as "jquery ajax"
instead of "jqueryajax".

Ref https://github.com/typesense/typesense-docsearch-scraper/issues/40.
---
 docsearch.config.json | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/docsearch.config.json b/docsearch.config.json
index 5325f6f7..ed567926 100644
--- a/docsearch.config.json
+++ b/docsearch.config.json
@@ -1,8 +1,8 @@
 {
   "index_name": "jquery_com",
   "start_urls": [
-    { "url": "https://jquery.com" },
-    { "url": "https://api.jquery.com", "selectors_key": "api" }
+    { "url": "https://api.jquery.com", "selectors_key": "api", "page_rank": 20 },
+    { "url": "https://jquery.com", "page_rank": 10 }
   ],
   "stop_urls": [
     ".com/category/"
@@ -34,6 +34,9 @@
       "text": ".entry-content p, .entry-content li"
     }
   },
+  "custom_settings": {
+    "token_separators": ["_", "-", "."]
+  },
   "selectors_exclude": [
     "header ~ article",
     ".returns",

From e7c8ccd58f034db300b76be09588e7d14dedb602 Mon Sep 17 00:00:00 2001
From: Timo Tijhof 
Date: Mon, 8 May 2023 02:22:04 +0100
Subject: [PATCH 029/101] Fix non-canonical links to /jQuery.ajax/

Thanks to WordPress, each of these works, but they also end up
indexed in Typesense (and in Algolia) as duplicate entries with
slightly differently cased URLs.

Avoid the duplication by making the links consistent.
---
 entries/jQuery.get.xml  | 2 +-
 entries/jQuery.post.xml | 2 +-
 notes.xsl               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
index 16b764d4..575a6f83 100644
--- a/entries/jQuery.get.xml
+++ b/entries/jQuery.get.xml
@@ -24,7 +24,7 @@
   
     1.12-and-2.2
     
-      A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. The type option will automatically be set to GET.
+      A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. The type option will automatically be set to GET.
     
   
   Load data from the server using a HTTP GET request.
diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
index 4495cb7c..e5411bed 100644
--- a/entries/jQuery.post.xml
+++ b/entries/jQuery.post.xml
@@ -24,7 +24,7 @@
   
     1.12-and-2.2
     
-      A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. Type will automatically be set to POST.
+      A set of key/value pairs that configure the Ajax request. All properties except for url are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a complete list of all settings. Type will automatically be set to POST.
     
   
   Send data to the server using a HTTP POST request.
diff --git a/notes.xsl b/notes.xsl
index fb74e852..b6c5969f 100644
--- a/notes.xsl
+++ b/notes.xsl
@@ -53,7 +53,7 @@
 			If a request with  returns an error code, it will fail silently unless the script has also called the global ajaxError event. Alternatively, as of jQuery 1.5, the .error() method of the jqXHR object returned by  is also available for error handling.
 		
 		
-			If $.ajax() or $.ajaxSetup() is called with the global option set to false, the  event will not fire.
+			If $.ajax() or $.ajaxSetup() is called with the global option set to false, the  event will not fire.
 		
 		
 			If  is called on an unordered list (<ul>) and its <li> elements have position (relative, absolute, or fixed), the effect may not work properly in IE6 through at least IE9 unless the <ul> has "layout." To remedy the problem, add the position: relative; and zoom: 1; CSS declarations to the ul.

From 1d2d81142c879feaa782ef4f60c9c8d0ce7cafe9 Mon Sep 17 00:00:00 2001
From: Timo Tijhof 
Date: Mon, 8 May 2023 02:25:14 +0100
Subject: [PATCH 030/101] 3.2.2

---
 package-lock.json | 2 +-
 package.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 382479f8..3ada399b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "api.jquery.com",
-  "version": "3.2.1",
+  "version": "3.2.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/package.json b/package.json
index c628acd1..1022707a 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "name": "api.jquery.com",
   "title": "jQuery API Docs",
   "description": "API reference documentation for the jQuery JavaScript Library.",
-  "version": "3.2.1",
+  "version": "3.2.2",
   "homepage": "https://github.com/jquery/api.jquery.com",
   "author": {
     "name": "jQuery Foundation and other contributors"

From 0acd2c3ae34a847dbfa1ca15bcef274aa6010416 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
 
Date: Wed, 10 May 2023 10:50:39 +0200
Subject: [PATCH 031/101] All: Add missing jQuery versions to categories,
 update entries

jQuery 1.10/2.0 & 1.11/2.1 now have dedicated version categories; the
same applies to 3.6. A few other version descriptions have been tweaked.

The `.add( selection )` signature is now documented to have arrived in
1.1 instead of 1.3.2. Tests for this behavior got added in:
https://github.com/jquery/jquery/commit/a5f9108a2109b2ed5778af860b0928d8e6b0fdd2

A cetegory in one of `before` & `after` signatures was updated from
`1.10` to `1.10-and-2.0`, fixing a broken category link.

Closes gh-1225
---
 categories.xml             | 40 ++++++++++++++++++++++++++++----------
 entries/add.xml            |  2 +-
 entries/after.xml          |  2 +-
 entries/before.xml         |  2 +-
 entries/jQuery.ajax.xml    |  3 ++-
 entries/jQuery.support.xml |  7 ++++++-
 6 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/categories.xml b/categories.xml
index 22dbd59b..513b5459 100644
--- a/categories.xml
+++ b/categories.xml
@@ -439,11 +439,24 @@ var files = event.originalEvent.dataTransfer.files;
         
]]> + + + + + + @@ -451,42 +464,49 @@ var files = event.originalEvent.dataTransfer.files; + + + diff --git a/entries/add.xml b/entries/add.xml index 6f1d7870..bb95b0f0 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -20,7 +20,7 @@ - 1.3.2 + 1.1 An existing jQuery object to add to the set of matched elements. diff --git a/entries/after.xml b/entries/after.xml index 210ad7c8..2ea48a9c 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -34,7 +34,7 @@ - 1.10 + 1.10-and-2.0 A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. diff --git a/entries/before.xml b/entries/before.xml index 1a1fcdea..577f588b 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -35,7 +35,7 @@ - 1.10 + 1.10-and-2.0 diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index b8ee69a7..258ec227 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -114,7 +114,7 @@ $.ajax({ - A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." (in HTTP/2 it may instead be an empty string) As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." (in HTTP/2 it may instead be an empty string) As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain scripts and cross-domain JSONP requests. This is an Ajax Event. Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. @@ -463,4 +463,5 @@ $.ajax({ + diff --git a/entries/jQuery.support.xml b/entries/jQuery.support.xml index 636ec72e..3252fd6e 100644 --- a/entries/jQuery.support.xml +++ b/entries/jQuery.support.xml @@ -4,10 +4,15 @@ 1.3 - A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support. + A collection of properties that represent the presence of different browser features or bugs; intended for jQuery's internal use. + +

A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support.

+

As of jQuery 1.11 or 1.12, jQuery.support is no longer JSON-serializable; some properties point to functions that return the support test result when called. This was necessary to support lazy execution of support tests.

+
+ From 9b950789e3552616779131603b008e99063a246d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 10 May 2023 23:49:40 +0200 Subject: [PATCH 032/101] 3.2.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3ada399b..80ce541b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.2.2", + "version": "3.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1022707a..13abd64e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.2.2", + "version": "3.2.3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 507541789e44a4ca40c76c2e5e8fbb95079a02b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 11 May 2023 00:31:13 +0200 Subject: [PATCH 033/101] All: Fix a few MDN links Replace all MDN links with their canonical versions, fixing one 404 in the process as well. --- entries/contents.xml | 2 +- entries/delay.xml | 2 +- entries/event.which.xml | 2 +- pages/Types.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/contents.xml b/entries/contents.xml index 950411ba..6cfa73ba 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -34,7 +34,7 @@ $( ".container" ) .filter( "br" ) .remove();
-

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

+

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

Find all the text nodes inside a paragraph and wrap them with a bold tag. diff --git a/entries/delay.xml b/entries/delay.xml index f611ffff..b2066217 100644 --- a/entries/delay.xml +++ b/entries/delay.xml @@ -21,7 +21,7 @@ $( "#foo" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );

When this statement is executed, the element slides up for 300 milliseconds and then pauses for 800 milliseconds before fading in for 400 milliseconds.

- The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases. + The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases.

diff --git a/entries/event.which.xml b/entries/event.which.xml index 1d36d527..e8e6aa28 100644 --- a/entries/event.which.xml +++ b/entries/event.which.xml @@ -6,7 +6,7 @@ For key or mouse events, this property indicates the specific key or button that was pressed. -

The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN.

+

The event.which property normalizes event.keyCode and event.charCode. It is recommended to watch event.which for keyboard key input. For more detail, read about event.charCode on the MDN.

event.which also normalizes button presses (mousedown and mouseupevents), reporting 1 for left button, 2 for middle, and 3 for right. Use event.which instead of event.button.

diff --git a/pages/Types.html b/pages/Types.html index 969d154a..6c75695e 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -648,7 +648,7 @@

XMLHttpRequest

Although the XHR object is a standard, there are variations in its behavior on different browsers. Refer to the WHATWG site and Mozilla Developer Network for more information:

jqXHR

As of jQuery 1.5, the $.ajax() method returns the jqXHR object, which is a superset of the XMLHTTPRequest object. For more information, see the jqXHR section of the $.ajax entry From 66bda2e28f93e98f963486fd5b2eea4b13d6c466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 11 May 2023 00:31:41 +0200 Subject: [PATCH 034/101] 3.2.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80ce541b..9fad268c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.2.3", + "version": "3.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 13abd64e..48632141 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.2.3", + "version": "3.2.4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e52362a73a7f9be25d05b66ee254669f6ea1142b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Thu, 11 May 2023 21:52:53 +0200 Subject: [PATCH 035/101] prevAll:uniqueAll: Add uniqueAll, use it in reverse doc order examples Also, use it in `.prevAll()` examples instead of the older `jQuery.uniqueSort()`. In addition, update jQuery used in examples to `3.7.0` and add the category for jQuery `3.7`. Closes gh-1216 Ref gh-1215 Ref jquery/jquery#5149 --- categories.xml | 9 ++++ entries/prevAll.xml | 19 ++++--- entries/uniqueSort.xml | 112 +++++++++++++++++++++++++++++++++++++++++ entries2html.xsl | 2 +- 4 files changed, 135 insertions(+), 7 deletions(-) create mode 100644 entries/uniqueSort.xml diff --git a/categories.xml b/categories.xml index 513b5459..d5c9d917 100644 --- a/categories.xml +++ b/categories.xml @@ -510,6 +510,15 @@ var files = event.originalEvent.dataTransfer.files;


]]> + + + diff --git a/entries/prevAll.xml b/entries/prevAll.xml index 4b5f6062..d3eeca03 100644 --- a/entries/prevAll.xml +++ b/entries/prevAll.xml @@ -50,7 +50,14 @@ $( ".last-item" ) <div class="last-item">Last</div> </div>
-

because "Item 2" gets appended to the wrapper div first. To work around the issue, you may use $.uniqueSort() on the .prevAll() output first:

+

because "Item 2" gets appended to the wrapper div first. To work around the issue, you may use .uniqueSort() on the .prevAll() output first:

+

+$( ".last-item" )
+  .prevAll()
+  .uniqueSort()
+  .wrapAll( "<div class='wrapper'></div>" );
+    
+

Note that the .uniqueSort() method is only available in jQuery 3.7.0 or newer. In older versions, you will need to use $.uniqueSort() to achieve a similar effect:


 var prevSiblings = $( ".last-item" ).prevAll();
 $.uniqueSort( prevSiblings );
@@ -83,7 +90,7 @@ $( "div" ).last().prevAll().addClass( "before" );
 ]]>
   
   
-    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without $.uniqueSort().
+    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort().
     
     
+    
+    
+  
+  
+    Locate all the divs preceding the last item and wrap them with a div with class wrapper - with or without .uniqueSort().
+    
+    
+    
+  
+  
+  
+
diff --git a/entries2html.xsl b/entries2html.xsl
index 8b06fadf..37bfdb3c 100755
--- a/entries2html.xsl
+++ b/entries2html.xsl
@@ -12,7 +12,7 @@
 	<meta charset="utf-8">
 	<title> demo</title>
 	<style>	</style>
-	<script src="https://code.jquery.com/jquery-3.6.3.js"></script>
+	<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
 	<script>
 	
 	</script>

From 5c72da2c884c6930b7488f568fab59b0ae90079d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
 
Date: Thu, 11 May 2023 21:55:37 +0200
Subject: [PATCH 036/101] blur:focus: document IE-related changes in jQuery 3.7

---
 entries/blur.xml  | 2 ++
 entries/focus.xml | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/entries/blur.xml b/entries/blur.xml
index d99003e9..68636a0c 100644
--- a/entries/blur.xml
+++ b/entries/blur.xml
@@ -51,6 +51,7 @@ $( "#other" ).on( "click", function() {
     

After this code executes, clicks on Trigger the handler will also alert the message.

The blur event does not bubble. As of version 1.4.2, jQuery works around this limitation by mapping blur to the focusout event in its event delegation methods.

+

The native blur event is asynchronous in all versions of IE, contrary to other browsers. To avoid issues related to this discrepancy, as of jQuery 3.7.0, jQuery uses focusout as the native backing event for blur in IE.

To trigger the blur event on all paragraphs: @@ -62,6 +63,7 @@ $( "p" ).trigger( "blur" ); + diff --git a/entries/focus.xml b/entries/focus.xml index 21d6b2c2..c9736a29 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -57,6 +57,7 @@ $( "#other" ).on( "click", function() {

After this code executes, clicks on Trigger the handler will also alert the message.

The focus event does not bubble. As of version 1.4.2, jQuery works around this limitation by mapping focus to the focusin event in its event delegation methods.

+

The native focus event is asynchronous in all versions of IE, contrary to other browsers. To avoid issues related to this discrepancy, as of jQuery 3.7.0, jQuery uses focusin as the native backing event for focus in IE.

Fire focus. @@ -95,6 +96,7 @@ $( function() { +
From 226f67d0d9325143ed8155e27c609ee12768835a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 11 May 2023 21:56:37 +0200 Subject: [PATCH 037/101] All: Make deprecation warnings more prominent --- entries/deferred.pipe.xml | 4 +++- entries/jQuery.fx.interval.xml | 4 +++- entries/jQuery.parseJSON.xml | 4 +++- entries/jQuery.unique.xml | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/entries/deferred.pipe.xml b/entries/deferred.pipe.xml index 66eda149..a74f9dac 100644 --- a/entries/deferred.pipe.xml +++ b/entries/deferred.pipe.xml @@ -34,7 +34,9 @@ Utility method to filter and/or chain Deferreds. -

Deprecation Notice:As of jQuery 1.8, the deferred.pipe() method is deprecated. The deferred.then() method, which replaces it, should be used instead.

+
+

Deprecation Notice:As of jQuery 1.8, the deferred.pipe() method is deprecated. The deferred.then() method, which replaces it, should be used instead.

+

The deferred.pipe() method returns a new promise that filters the status and values of a deferred through a function. The doneFilter and failFilter functions filter the original deferred's resolved / rejected status and values. As of jQuery 1.7, the method also accepts a progressFilter function to filter any calls to the original deferred's notify or notifyWith methods. These filter functions can return a new value to be passed along to the piped promise's done() or fail() callbacks, or they can return another observable object (Deferred, Promise, etc) which will pass its resolved / rejected status and values to the piped promise's callbacks. If the filter function used is null, or not specified, the piped promise will be resolved or rejected with the same values as the original.

diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index dcf5653a..ddcf4296 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -6,7 +6,9 @@ 1.4.3 -

This property is deprecated as of version 3.0, and has no effect in browsers that support the requestAnimationFrame method.

+
+

This property is deprecated as of version 3.0, and has no effect in browsers that support the requestAnimationFrame method.

+

On browsers that do not support requestAnimationFrame, this property can be changed to adjust the interval at which animations will run. The default is 13 milliseconds.

Since jQuery uses one global interval, no animation should be running or all animations should stop for the change of this property to take effect.

diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index c09f3c40..a3249174 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -14,7 +14,9 @@ Takes a well-formed JSON string and returns the resulting JavaScript value. -

As of jQuery 3.0, $.parseJSON is deprecated. To parse JSON strings use the native JSON.parse method instead.

+
+

As of jQuery 3.0, $.parseJSON is deprecated. To parse JSON strings use the native JSON.parse method instead.

+

Passing in a malformed JSON string results in a JavaScript exception being thrown. For example, the following are all invalid JSON strings:

  • "{test: 1}" (test does not have double quotes around it).
  • diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index 01b0c980..bac61334 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -9,7 +9,9 @@ Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. -

    As of jQuery 3.0, this method is deprecated and just an alias of jQuery.uniqueSort(). Please use that method instead.

    +
    +

    As of jQuery 3.0, this method is deprecated and just an alias of jQuery.uniqueSort(). Please use that method instead.

    +

    The $.unique() function searches through an array of objects, sorting the array, and removing any duplicate nodes. A node is considered a duplicate if it is the exact same node as one already in the array; two different nodes with identical attributes are not considered to be duplicates. This function only works on plain JavaScript arrays of DOM elements, and is chiefly used internally by jQuery. You probably will never need to use it.

    As of jQuery 1.4 the results will always be returned in document order.

    From 0cb274564b71e3503f620dfae3d0a1e646f28fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 11 May 2023 21:59:10 +0200 Subject: [PATCH 038/101] 3.3.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9fad268c..580ff193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.2.4", + "version": "3.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 48632141..b329b4c9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.2.4", + "version": "3.3.0", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 29cf863ab724734849effbfd6b777d4cdfd0a6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Sun, 14 May 2023 23:35:55 +0200 Subject: [PATCH 039/101] Build: Skip checking Twitter links in the hydra crawler (#1231) Twitter pages now do 302-redirects to themselves for users without a specific cookie set which trips the crawler; avoid checking Twitter links by abusing the `exclude_scheme_prefixes` option of the crawler. Since the project only accepts options in a form of a configuration file, we also need to clone the API repo to provide such a file. --- .github/configs/hydra-config.json | 5 +++++ .github/workflows/spider-check.yaml | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .github/configs/hydra-config.json diff --git a/.github/configs/hydra-config.json b/.github/configs/hydra-config.json new file mode 100644 index 00000000..3d367e7b --- /dev/null +++ b/.github/configs/hydra-config.json @@ -0,0 +1,5 @@ +{ + "exclude_scheme_prefixes": [ + "https://twitter.com/" + ] +} diff --git a/.github/workflows/spider-check.yaml b/.github/workflows/spider-check.yaml index daa13e89..eae939e0 100644 --- a/.github/workflows/spider-check.yaml +++ b/.github/workflows/spider-check.yaml @@ -20,9 +20,18 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository_owner == 'jquery' }} # skip on forks steps: - - uses: actions/checkout@v2 + - name: Checkout hydra-link-checker + uses: actions/checkout@v3 with: repository: jquery/hydra-link-checker ref: v2.0.0 + path: hydra + + # Checkout the API repo as well to provide the config for hydra-link-checker + - name: Checkout API repo + uses: actions/checkout@v3 + with: + path: api + - name: Run hydra-link-checker - run: python3 hydra.py "$MY_SITE" + run: python3 hydra/hydra.py "$MY_SITE" --config api/.github/configs/hydra-config.json From 753b2ee418fc924a70b1a4adbd1171794826e7fd Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 14 May 2023 22:38:02 +0100 Subject: [PATCH 040/101] deferred.isRejected: Fix broken link Found by hydra-link-checker: - code: 404 url: https://api.jquery.com/deferred.isRejected/h/deferred.reject/ parent: https://api.jquery.com/deferred.isRejected/ error: Not Found --- entries/deferred.isRejected.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/deferred.isRejected.xml b/entries/deferred.isRejected.xml index 60ddb77b..a391f779 100644 --- a/entries/deferred.isRejected.xml +++ b/entries/deferred.isRejected.xml @@ -9,7 +9,7 @@

    Note: This API has been removed in jQuery 1.8; please use deferred.state() instead.

    -

    Returns true if the Deferred object is in the rejected state, meaning that either deferred.reject() or deferred.rejectWith() has been called for the object and the failCallbacks have been called (or are in the process of being called).

    +

    Returns true if the Deferred object is in the rejected state, meaning that either deferred.reject() or deferred.rejectWith() has been called for the object and the failCallbacks have been called (or are in the process of being called).

    Note that a Deferred object can be in one of three states: pending, resolved, or rejected; use deferred.isResolved() to determine whether the Deferred object is in the resolved state. These methods are primarily useful for debugging, for example to determine whether a Deferred has already been resolved even though you are inside code that intended to reject it.

    From 8f8f62c1f1231e381344d1d90991dece4b37051f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 17 May 2023 13:56:09 +0200 Subject: [PATCH 041/101] All: Fix links reported by hydra-link-checker Closes gh-1232 --- categories.xml | 6 +++--- entries/context.xml | 4 ++-- entries/innerHeight.xml | 4 ++-- entries/innerWidth.xml | 4 ++-- entries/jQuery.ajax.xml | 4 ++-- entries/jQuery.cssHooks.xml | 2 +- entries/jQuery.globalEval.xml | 4 ++-- entries/outerHeight.xml | 4 ++-- entries/outerWidth.xml | 4 ++-- notes.xsl | 2 +- pages/Types.html | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/categories.xml b/categories.xml index d5c9d917..06418fb2 100644 --- a/categories.xml +++ b/categories.xml @@ -61,7 +61,7 @@

    For more information, see the Release Notes/Changelog at https://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/

    ]]>
    - + @@ -401,8 +401,8 @@ var files = event.originalEvent.dataTransfer.files; diff --git a/entries/context.xml b/entries/context.xml index 496c833a..cd9c3cc4 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -1,5 +1,5 @@ - + .context 1.3 @@ -24,6 +24,6 @@ $( "ul" ) - + diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index bf5eab75..72e8327d 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -44,7 +44,7 @@ $( "p" ).last().text( "innerHeight:" + p.innerHeight() ); - 1.8.0 + 1.8 @@ -52,7 +52,7 @@ $( "p" ).last().text( "innerHeight:" + p.innerHeight() ); - 1.8.0 + 1.8 diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index 2990b7b2..7eb25c9d 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -43,7 +43,7 @@ $( "p" ).last().text( "innerWidth:" + p.innerWidth() ); - 1.8.0 + 1.8 @@ -51,7 +51,7 @@ $( "p" ).last().text( "innerWidth:" + p.innerWidth() ); - 1.8.0 + 1.8 diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 258ec227..9074388b 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -138,7 +138,7 @@ $.ajax({ Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. - + The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). @@ -150,7 +150,7 @@ $.ajax({ By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. - + Defines an object with additional attributes to be used in a "script" or "jsonp" request. The key represents the name of the attribute and the value is the attribute's value. If this object is provided it will force the use of a script-tag transport. For example, this can be used to set nonce, integrity, or crossorigin attributes to satisfy Content Security Policy requirements. diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml index 19bb9054..ec36ccfe 100644 --- a/entries/jQuery.cssHooks.xml +++ b/entries/jQuery.cssHooks.xml @@ -163,7 +163,7 @@ if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" ) })( jQuery );

    Special units

    -

    By default, jQuery adds a "px" unit to the values passed to the .css() method. This behavior can be prevented by adding the property to the jQuery.cssNumber object

    +

    By default, jQuery adds a "px" unit to the values passed to the .css() method. This behavior can be prevented by adding the property to the jQuery.cssNumber object

    
     $.cssNumber.someCSSProp = true;
         
    diff --git a/entries/jQuery.globalEval.xml b/entries/jQuery.globalEval.xml index 19b9f9c9..f6234efe 100644 --- a/entries/jQuery.globalEval.xml +++ b/entries/jQuery.globalEval.xml @@ -8,7 +8,7 @@
    - 3.4.0 + 3.4 The JavaScript code to execute. @@ -19,7 +19,7 @@
    - 3.5.0 + 3.5 The JavaScript code to execute. diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml index 991a36da..5432ff08 100644 --- a/entries/outerHeight.xml +++ b/entries/outerHeight.xml @@ -47,7 +47,7 @@ $( "p" ).last().text( - 1.8.0 + 1.8 @@ -58,7 +58,7 @@ $( "p" ).last().text( - 1.8.0 + 1.8 diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index c8e6f87e..93faab40 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -47,7 +47,7 @@ $( "p" ).last().text( - 1.8.0 + 1.8 @@ -58,7 +58,7 @@ $( "p" ).last().text( - 1.8.0 + 1.8 diff --git a/notes.xsl b/notes.xsl index b6c5969f..6963dad2 100644 --- a/notes.xsl +++ b/notes.xsl @@ -17,7 +17,7 @@ Selected elements are in the order of their appearance in the document. - Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint. + Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint. The value reported by is not guaranteed to be accurate when the element or its parent is hidden. To get an accurate value, ensure the element is visible before using . jQuery will attempt to temporarily show and then re-hide an element in order to measure its dimensions, but this is unreliable and (even when accurate) can significantly impact page performance. This show-and-rehide measurement feature may be removed in a future version of jQuery. diff --git a/pages/Types.html b/pages/Types.html index 6c75695e..5364dd5f 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -300,7 +300,7 @@

    Iteration

    alert( "key is " + [ key ] + ", value is " + obj[ key ] ); } -

    Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries. +

    Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries.

    jQuery provides a generic each function to iterate over properties of objects, as well as elements of arrays:

    From 72e6a9159fde4e40683426ddb9e410d4c3c2742b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 17 May 2023 15:36:13 +0200 Subject: [PATCH 042/101] 3.3.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 580ff193..f90e7656 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.3.0", + "version": "3.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b329b4c9..040e83a1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.3.0", + "version": "3.3.1", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 88b9286e689f39ecd3e3e582fe6a8c8ca887ebb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 12 Jun 2023 22:00:56 +0200 Subject: [PATCH 043/101] jQuery.error: Don't advertise assigning jQuery.error to console.error The original implementation of `jQuery.error` throws an error. When overwritten, it should still finish by throwing an error to avoid observable differences in behavior. Closes gh-1233 --- entries/jQuery.error.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.error.xml b/entries/jQuery.error.xml index 3ae5110a..54b64d5d 100644 --- a/entries/jQuery.error.xml +++ b/entries/jQuery.error.xml @@ -10,11 +10,15 @@ Takes a string and throws an exception containing it.

    This method exists primarily for plugin developers who wish to override it and provide a better display (or more information) for the error messages.

    +

    If you do override the method, remember to still throw an error at the end to preserve semantics.

    - Override jQuery.error for display in Firebug. + Override jQuery.error to send it to a logging service, assuming the sendErrorLog method is provided by this service. From 6c2c0e6839aeabbc8f1613666b25a292c74c44d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 12 Jun 2023 22:01:44 +0200 Subject: [PATCH 044/101] 3.3.2 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f90e7656..4e749025 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.3.1", + "version": "3.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 040e83a1..7682059f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "api.jquery.com", "title": "jQuery API Docs", "description": "API reference documentation for the jQuery JavaScript Library.", - "version": "3.3.1", + "version": "3.3.2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2efc58620b8e451b57780b83ca3fe7b645e00758 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 8 Jul 2023 20:04:37 +0100 Subject: [PATCH 045/101] Build: Remove redundant grunt-cli dependency This is already providewd by grunt, which actually installs one patch version newer, and so was even installed twice. --- package-lock.json | 28 ---------------------------- package.json | 1 - 2 files changed, 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e749025..29f9ff8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -422,29 +422,6 @@ "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.1.0.tgz", "integrity": "sha1-fBZB28ZlSGdqbVl5Ga35C3s11kQ=" }, - "grunt-cli": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.2.tgz", - "integrity": "sha512-wsu6BZh7KCnfeaSkDrKIAvOlqGKxNRTZjc8xfZlvxCByQIqUfZ31kh5uHpPnhQ4NdVgvaWaVxa1LUbVU80nACw==", - "requires": { - "grunt-known-options": "~1.1.1", - "interpret": "~1.1.0", - "liftup": "~3.0.1", - "nopt": "~4.0.1", - "v8flags": "~3.2.0" - }, - "dependencies": { - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - } - } - }, "grunt-jquery-content": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.1.0.tgz", @@ -473,11 +450,6 @@ } } }, - "grunt-known-options": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", - "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==" - }, "grunt-legacy-log": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", diff --git a/package.json b/package.json index 7682059f..d4e153da 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ }, "dependencies": { "grunt": "1.5.3", - "grunt-cli": "1.4.2", "grunt-jquery-content": "3.1.0" } } From 97813056dd1b4a4d98904b1d66ff8baf2bc8d411 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Mon, 24 Jul 2023 11:04:49 -0400 Subject: [PATCH 046/101] Build: add node.js workflow to run lint --- .github/workflows/node.js.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..c5ba2621 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,29 @@ +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + # Old infra requires Node 10 + node-version: [10.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test From bd7a1a0c5cef3c3fc02d9515147aa43c6263c961 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Mon, 24 Jul 2023 11:19:42 -0400 Subject: [PATCH 047/101] Build: install libxml2 for lint task (#1237) --- .github/workflows/node.js.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index c5ba2621..5309c6fa 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,6 +19,8 @@ jobs: node-version: [10.x, 18.x] steps: + - name: Install xmllint + run: sudo apt-get install -y libxml2-utils - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 From e0244b03fc2c7fd4475b37c11fb77b919bb9263a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 23 Jan 2016 17:13:04 +0000 Subject: [PATCH 048/101] Build: Add `.editorconfig` file (#877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vast majority of XML files in the repo use two spaces today, and even the files that contain tabs, do so only among many more lines in the same file that are indented with spaces instead. As such, for now, normalize toward two spaces so that only a few files need to edited. The exception is the JS and XSL files, of which the are only two of each. In accordance with jQuery Style Guide, keep those as tabs. ``` $ git grep $'\t' | cut -d':' -f1 | sort | uniq Gruntfile.js entries2html.xsl notes.xsl resources/events.js git grep $' ' | cut -d':' -f1 | sort | uniq … ``` Closes https://github.com/jquery/api.jquery.com/pull/877. Co-authored-by: Aurelio De Rosa --- .editorconfig | 13 +++ categories.xml | 72 ++++++++-------- config-sample.json | 6 +- entries/appendTo.xml | 2 +- entries/innerHeight.xml | 2 +- entries/innerWidth.xml | 8 +- entries/jQuery.parseHTML.xml | 4 +- entries/offset.xml | 6 +- entries/outerHeight.xml | 2 +- entries/outerWidth.xml | 2 +- entries/position.xml | 2 +- entries/width.xml | 2 +- includes/complete-argument.xml | 2 +- includes/duration-argument.xml | 6 +- includes/easing-argument.xml | 2 +- includes/options-argument.xml | 150 ++++++++++++++++----------------- pages/Types.html | 2 +- redirects.json | 2 +- resources/events.js | 52 ++++++------ resources/load.html | 16 ++-- 20 files changed, 183 insertions(+), 170 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..8b808995 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.js, *.xsl] +indent_style = tab diff --git a/categories.xml b/categories.xml index 06418fb2..2f408651 100644 --- a/categories.xml +++ b/categories.xml @@ -190,15 +190,15 @@ var files = event.originalEvent.dataTransfer.files;
    - + + A few of these methods—such as .attr(), .html(), and .val()—also act as "getters," retrieving information from DOM elements for later use. + ]]> @@ -327,73 +327,73 @@ var files = event.originalEvent.dataTransfer.files; + jQuery 1.0 Release Notes. + ]]> + Release Notes: 1.0.1, 1.0.2, 1.0.3, 1.0.4. + ]]> + jQuery 1.1 Release Notes. + ]]> + jQuery 1.1.2 Release Notes. + ]]> + jQuery 1.1.3 Release Notes + ]]> + jQuery 1.1.4 Release Notes. + ]]> + jQuery 1.2 Release Notes + ]]> + Release Notes: 1.2.1, 1.2.2, 1.2.3. + ]]> + jQuery 1.2.6 Release Notes. + ]]> + Release Notes: 1.3, 1.3.1, 1.3.2 + ]]> + jQuery 1.4 Release Notes. + ]]> + jQuery 1.4.1 Release Notes. + ]]> + jQuery 1.4.2 Release Notes. + ]]> + jQuery 1.4.3 Release Notes. + ]]> @@ -414,11 +414,11 @@ var files = event.originalEvent.dataTransfer.files; diff --git a/config-sample.json b/config-sample.json index b26cf9fc..a62b85f2 100644 --- a/config-sample.json +++ b/config-sample.json @@ -1,5 +1,5 @@ { - "url": "vagrant.api.jquery.com", - "username": "admin", - "password": "secret" + "url": "vagrant.api.jquery.com", + "username": "admin", + "password": "secret" } diff --git a/entries/appendTo.xml b/entries/appendTo.xml index 931e70bb..7221b2e0 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -54,7 +54,7 @@ $( "h2" ).appendTo( $( ".container" ) ); </div>

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last, and that new set (the original element plus clones) is returned.

    -

    Before jQuery 1.9, the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the .end() method reliably when being used with an unknown number of elements.

    +

    Before jQuery 1.9, the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the .end() method reliably when being used with an unknown number of elements.

    diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index 72e8327d..2f71ae9f 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -16,7 +16,7 @@
    Figure 1 - Illustration of the measured height
    - + Get the innerHeight of a paragraph. diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index 7eb25c9d..54b6b358 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -15,7 +15,7 @@
    Figure 1 - Illustration of the measured width
    - + Get the innerWidth of a paragraph. @@ -45,9 +45,9 @@ $( "p" ).last().text( "innerWidth:" + p.innerWidth() ); 1.8 - - - A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + + A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index 5354627a..5ff74ce7 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -18,8 +18,8 @@

    jQuery.parseHTML uses native methods to convert the string to a set of DOM nodes, which can then be inserted into the document. These methods do render all trailing or leading text (even if that's just whitespace). To prevent trailing/leading whitespace from being converted to text nodes you can pass the HTML string through jQuery.trim.

    By default, the context is the current document if not specified or given as null or undefined. If the HTML was to be used in another document such as an iframe, that frame's document could be used.

    As of 3.0 the default behavior is changed. If the context is not specified or given as null or undefined, a new document is used. This can potentially improve security because inline events will not execute when the HTML is parsed. Once the parsed HTML is injected into a document it does execute, but this gives tools a chance to traverse the created DOM and remove anything deemed unsafe. This improvement does not apply to internal uses of jQuery.parseHTML as they usually pass in the current document. Therefore, a statement like $( "#log" ).append( $( htmlString ) ) is still subject to the injection of malicious code.

    -

    Security Considerations

    -

    Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run scripts in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute scripts indirectly, for example via the <img onerror> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run any script content when keepScripts is unspecified or false.

    +

    Security Considerations

    +

    Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run scripts in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute scripts indirectly, for example via the <img onerror> attribute. The caller should be aware of this and guard against it by cleaning or escaping any untrusted inputs from sources such as the URL or cookies. For future compatibility, callers should not depend on the ability to run any script content when keepScripts is unspecified or false.

    Create an array of DOM nodes using an HTML string and insert it into a div. diff --git a/entries/offset.xml b/entries/offset.xml index 5a2f3535..81923287 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -11,11 +11,11 @@

    The .offset() method allows us to retrieve the current position of an element (specifically its border box, which excludes margins) relative to the document. Contrast this with .position(), which retrieves the current position relative to the offset parent. When positioning a new element on top of an existing one for global manipulation (in particular, for implementing drag-and-drop), .offset() is more useful.

    .offset() returns an object containing the properties top and left.

    -

    Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <html> document element.

    +

    Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <html> document element.

    While it is possible to get the coordinates of elements with visibility:hidden set, display:none is excluded from the rendering tree and thus has a position that is undefined.

    - + Access the offset of the second paragraph: '); - string += '
    }'; - message = string; - } + if (typeof(message) == 'object') { + var string = '{
    ', + values = [], + counter = 0; + $.each(message, function(key, value) { + if (value && value.nodeName) { + var domnode = '<' + value.nodeName.toLowerCase(); + domnode += value.className ? ' class="' + value.className + '"' : ''; + domnode += value.id ? ' id="' + value.id + '"' : ''; + domnode += '>'; + value = domnode; + } + values[counter++] = key + ': ' + value; + }); + string += values.join(',
    '); + string += '
    }'; + message = string; + } - var $output = $('#print-output'); + var $output = $('#print-output'); - if ($output.length === 0) { - $output = $('