From b3a98ac0ccfa7a91b58adbf688f70930bb702ad5 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 18 Oct 2012 22:15:12 -0400 Subject: [PATCH 001/998] Specify that moving, not cloning, on insertion applies only to single elem inserted in single location Fixes #140 --- entries/after.xml | 4 ++-- entries/append.xml | 4 ++-- entries/appendTo.xml | 4 ++-- entries/before.xml | 4 ++-- entries/insertAfter.xml | 4 ++-- entries/insertBefore.xml | 4 ++-- entries/prepend.xml | 4 ++-- entries/prependTo.xml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index 3ea55a69..e95897a0 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -37,7 +37,7 @@ </div>

An element in the DOM can also be selected and inserted after another element:

$('.container').after($('h2'));
-

If an element selected this way is inserted elsewhere, it will be moved rather than cloned:

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved rather than cloned:

<div class="container">
   <div class="inner">Hello</div>
   <div class="inner">Goodbye</div>
@@ -95,4 +95,4 @@ $('p').first().after($newdiv1, [newdiv2, existingdiv1]);
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/append.xml b/entries/append.xml
index 168fe9bb..3e92f1d4 100644
--- a/entries/append.xml
+++ b/entries/append.xml
@@ -47,7 +47,7 @@
     

You can also select an element on the page and insert it into another:

$('.container').append($('h2'));
 
-

If an element selected this way is inserted elsewhere, it will be moved into the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

<div class="container">
   <div class="inner">Hello</div>
   <div class="inner">Goodbye</div>
@@ -100,4 +100,4 @@ $('body').append($newdiv1, [newdiv2, existingdiv1]);
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/appendTo.xml b/entries/appendTo.xml
index b7a40bb3..97f1a041 100644
--- a/entries/appendTo.xml
+++ b/entries/appendTo.xml
@@ -36,7 +36,7 @@
     

We can also select an element on the page and insert it into another:

$('h2').appendTo($('.container'));
 
-

If an element selected this way is inserted elsewhere, it will be moved into the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

<div class="container">
   <div class="inner">Hello</div>
   <div class="inner">Goodbye</div>
@@ -55,4 +55,4 @@
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/before.xml b/entries/before.xml
index f1b36a3d..6484b3b5 100644
--- a/entries/before.xml
+++ b/entries/before.xml
@@ -38,7 +38,7 @@
 </div>

You can also select an element on the page and insert it before another:

$('.container').before($('h2'));
-

If an element selected this way is inserted elsewhere, it will be moved before the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned):

<h2>Greetings</h2>
 <div class="container">
   <div class="inner">Hello</div>
@@ -80,4 +80,4 @@ $('p').first().before($newdiv1, [newdiv2, existingdiv1]);
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml
index bb38bfd2..db3c3830 100644
--- a/entries/insertAfter.xml
+++ b/entries/insertAfter.xml
@@ -28,7 +28,7 @@
 </div>

We can also select an element on the page and insert it after another:

$('h2').insertAfter($('.container'));
-

If an element selected this way is inserted elsewhere, it will be moved after the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved after the target (not cloned):

<div class="container">
   <div class="inner">Hello</div>
   <div class="inner">Goodbye</div>
@@ -44,4 +44,4 @@
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml
index 2158f8c6..a4318626 100644
--- a/entries/insertBefore.xml
+++ b/entries/insertBefore.xml
@@ -28,7 +28,7 @@
 </div>

We can also select an element on the page and insert it before another:

$('h2').insertBefore($('.container'));
-

If an element selected this way is inserted elsewhere, it will be moved before the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned):

<h2>Greetings</h2>
 <div class="container">
   <div class="inner">Hello</div>
@@ -44,4 +44,4 @@
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/prepend.xml b/entries/prepend.xml
index 3e200da3..93dbe108 100644
--- a/entries/prepend.xml
+++ b/entries/prepend.xml
@@ -42,7 +42,7 @@
 </div>

You can also select an element on the page and insert it into another:

$('.container').prepend($('h2'));
-

If a single element selected this way is inserted elsewhere, it will be moved into the target (not cloned):

+

If a single element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

<div class="container">
     <h2>Greetings</h2>
     <div class="inner">Hello</div>
@@ -84,4 +84,4 @@ $('body').prepend($newdiv1, [newdiv2, existingdiv1]);
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/prependTo.xml b/entries/prependTo.xml
index 135e10ad..b7ff0cd2 100644
--- a/entries/prependTo.xml
+++ b/entries/prependTo.xml
@@ -32,7 +32,7 @@
 </div>

We can also select an element on the page and insert it into another:

$('h2').prependTo($('.container'));
-

If an element selected this way is inserted elsewhere, it will be moved into the target (not cloned):

+

If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

<div class="container">
   <h2>Greetings</h2>
   <div class="inner">Hello</div>
@@ -50,4 +50,4 @@
   
   
   
-
\ No newline at end of file
+

From cf64c639a9a15704404ec34f351e77a2dc3ed0e0 Mon Sep 17 00:00:00 2001
From: Dave Mayo 
Date: Fri, 19 Oct 2012 09:07:41 -0400
Subject: [PATCH 002/998] fixes 139 - With/Without example

---
 entries/andSelf.xml | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/entries/andSelf.xml b/entries/andSelf.xml
index c44f26b3..67e2f1c3 100644
--- a/entries/andSelf.xml
+++ b/entries/andSelf.xml
@@ -26,19 +26,33 @@
   
     Find all divs, and all the paragraphs inside of them, and give them both class names.  Notice the div doesn't have the yellow background color since it didn't use .andSelf().
     
     
-    
+    
+  
+
+
+

After andSelf()

+
+

First Paragraph

+

Second Paragraph

+
+
+]]>
From f46eeb6b8ffe8cfac55b31fe4382f473baba5fd2 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 21 Oct 2012 14:37:40 -0400 Subject: [PATCH 003/998] Add Version 1.8 to list of categories. --- categories.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/categories.xml b/categories.xml index fa18b86d..d23dfa1b 100644 --- a/categories.xml +++ b/categories.xml @@ -365,6 +365,14 @@
]]>
+ + + From 4cc36946029782c71925d8aa7d9ec9c300db2866 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 21 Oct 2012 14:38:06 -0400 Subject: [PATCH 004/998] Add -index signature to :eq() selector --- entries/eq-selector.xml | 43 +++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml index f312b6b0..06f56f4f 100644 --- a/entries/eq-selector.xml +++ b/entries/eq-selector.xml @@ -1,18 +1,25 @@ :eq() Selector - :eq(index) + :eq(index) 1.0 Zero-based index of the element to match. + + :eq(-index) + 1.8 + + Zero-based index of the element to match, counting backwards from the last element. + + Select the element at index n within the matched set.

The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:eq(1)') selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

-

Unlike the .eq(index) method, the :eq(index) selector does not accept a negative value for index. For example, while $('li').eq(-1) selects the last li element, $('li:eq(-1)') selects nothing.

+

Prior to jQuery 1.8, the :eq(index) selector did not accept a negative value for index (though the .eq(index) method did).

@@ -28,16 +35,16 @@ 160 Apply three different styles to list items to demonstrate that :eq() is designed to select a single element while :nth-child() or :eq() within a looping construct such as .each() can select multiple elements. + + + Add a class to List 2, item 2 by targeting the second to last <li> + + + +
From 2f66d1d763173b1c85f637aec7839e778161fdde Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 21 Oct 2012 17:44:20 -0400 Subject: [PATCH 005/998] Add note to global ajax event method about effect of `global:false` * Fixes #138 --- entries/ajaxComplete.xml | 1 + entries/ajaxError.xml | 1 + entries/ajaxSend.xml | 1 + entries/ajaxStart.xml | 1 + entries/ajaxStop.xml | 1 + entries/ajaxSuccess.xml | 1 + notes.xsl | 3 +++ 7 files changed, 9 insertions(+) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index f8a9b5d3..0a321e36 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -35,6 +35,7 @@ } });
+ Show a message when an Ajax request completes. 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.

-

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

+

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

<div class="trigger">Trigger</div>
 <div class="result"></div>
 <div class="log"></div>
 
-

We can attach our event handler to any element:

-
$('.log').ajaxComplete(function() {
-  $(this).text('Triggered ajaxComplete handler.');
+    

Attach the event handler to the document:

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

Now, we can make an Ajax request using any jQuery method:

-
$('.trigger').click(function() {
-  $('.result').load('ajax/test.html');
+    

Now, make an Ajax request using any jQuery method:

+
$( ".trigger" ).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.

-

Note: Because .ajaxComplete() is implemented as a method of jQuery object instances, we can use the this keyword as we do here to refer to the selected elements within the callback function.

-

All ajaxComplete handlers are invoked, regardless of what Ajax request was completed. If we must differentiate between the requests, we can 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, we can restrict our callback to only handling events dealing with a particular URL:

-

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

-
$('.log').ajaxComplete(function(e, xhr, settings) {
-  if (settings.url == 'ajax/test.html') {
-    $(this).text('Triggered ajaxComplete handler. The result is ' +
-                     xhr.responseHTML);
+    

Note: Because .ajaxComplete() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxComplete() method should only be attached to document.

+

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) {
+  if ( settings.url === "ajax/test.html" ) {
+    $( ".log" ).text( "Triggered ajaxComplete handler. The result is " +
+                     xhr.responseHTML );
   }
 });
+

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

Show a message when an Ajax request completes. - diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 945c2187..cd4c5b28 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -14,28 +14,28 @@
<button class="trigger">Trigger</button>
 <div class="result"></div>
 <div class="log"></div>
-

Attach the event handler to any element:

-
$("div.log").ajaxError(function() {
-  $(this).text( "Triggered ajaxError handler." );
+    

Attach the event handler to the document:

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

Now, make an Ajax request using any jQuery method:

-
$("button.trigger").click(function() {
-  $("div.result").load( "ajax/missing.html" );
+    
$( "button.trigger" ).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.

-

Note: Because .ajaxError() is implemented as a method of jQuery object instances, you can use the this keyword within the callback function to refer to the selected elements.

-

All ajaxError handlers are invoked, regardless of what Ajax request was completed. To differentiate between the requests, you can 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. If the request failed because JavaScript raised an exception, the exception object is passed to the handler as a fourth parameter. For example, to restrict the error callback to only handling events dealing with a particular URL:

-
$( "div.log" ).ajaxError(function(e, jqxhr, settings, exception) {
+    

Note: Because .ajaxError() is implemented as a method of jQuery object instances, you can use the this keyword within the callback function to refer to the selected elements. As of jQuery 1.8, however, the .ajaxError() method should only be attached to document.

+

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. If the request failed because JavaScript raised an exception, the exception object is passed to the handler as a fourth parameter. For example, to restrict the error callback to only handling events dealing with a particular URL:

+
$( document ).ajaxError(function(event, jqxhr, settings, exception) {
   if ( settings.url == "ajax/missing.html" ) {
-    $(this).text( "Triggered ajaxError handler." );
+    $( "div.log" ).text( "Triggered ajaxError handler." );
   }
 });
Show a message when an Ajax request fails. - diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index 27ad861a..b59bdfcc 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -10,32 +10,32 @@ 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.

-

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

+

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

<div class="trigger">Trigger</div>
 <div class="result"></div>
 <div class="log"></div>
-

We can attach our event handler to any element:

-
$('.log').ajaxSend(function() {
-  $(this).text('Triggered ajaxSend handler.');
+    

Attach the event handler to the document:

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

Now, we can make an Ajax request using any jQuery method:

-
$('.trigger').click(function() {
-  $('.result').load('ajax/test.html');
+    

Now, make an Ajax request using any jQuery method:

+
$( ".trigger" ).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.

-

Note: Because .ajaxSend() is implemented as a method of jQuery instances, we can use the this keyword as we do here to refer to the selected elements within the callback function.

-

All ajaxSend handlers are invoked, regardless of what Ajax request is to be sent. If we must differentiate between the requests, we can 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, we can restrict our callback to only handling events dealing with a particular URL:

-
$('.log').ajaxSend(function(e, jqxhr, settings) {
-  if (settings.url == 'ajax/test.html') {
-    $(this).text('Triggered ajaxSend handler.');
+    

Note: Because .ajaxSend() is implemented as a method of jQuery instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxSend() method should only be attached to document.

+

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) {
+  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.xml b/entries/ajaxStart.xml index 075f86b8..afe3247f 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -7,29 +7,29 @@ The function to be invoked. - Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + 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.

-

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

+

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

<div class="trigger">Trigger</div>
 <div class="result"></div>
 <div class="log"></div>
-

We can attach our event handler to any element:

-
$('.log').ajaxStart(function() {
-  $(this).text('Triggered ajaxStart handler.');
+    

Attach the event handler to any element:

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

Now, we can make an Ajax request using any jQuery method:

-
$('.trigger').click(function() {
-  $('.result').load('ajax/test.html');
+    

Now, make an Ajax request using any jQuery method:

+
$( ".trigger" ).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.

-

Note: Because .ajaxStart() is implemented as a method of jQuery object instances, we can use the this keyword as we do here to refer to the selected elements within the callback function.

+

Note: Because .ajaxStart() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxStart() method should only be attached to document.

Show a loading message whenever an Ajax request starts (and none is already active). - diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 51d2b7e2..502c6e82 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -1,7 +1,7 @@ .ajaxStop() - Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 1.0 @@ -10,26 +10,26 @@

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.

-

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

+

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

<div class="trigger">Trigger</div>
 <div class="result"></div>
 <div class="log"></div>
-

We can attach our event handler to any element:

-
$('.log').ajaxStop(function() {
-  $(this).text('Triggered ajaxStop handler.');
+    

Attach the event handler to the document:

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

Now, we can make an Ajax request using any jQuery method:

-
$('.trigger').click(function() {
-  $('.result').load('ajax/test.html');
+    

Now, make an Ajax request using any jQuery method:

+
$( ".trigger" ).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.

-

Because .ajaxStop() is implemented as a method of jQuery object instances, we can use the this keyword as we do here to refer to the selected elements within the callback function.

+

Because .ajaxStop() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxStop() method should only be attached to document.

Hide a loading message after all the Ajax requests have stopped. - diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 0fff81f3..7e60e9a5 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -7,37 +7,37 @@ The function to be invoked. - Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + 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.

-

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

+

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

<div class="trigger">Trigger</div>
 <div class="result"></div>
 <div class="log"></div>
-

We can attach our event handler to any element:

-
$('.log').ajaxSuccess(function() {
-  $(this).text('Triggered ajaxSuccess handler.');
+    

Attach the event handler to any element:

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

Now, we can make an Ajax request using any jQuery method:

-
$('.trigger').click(function() {
-  $('.result').load('ajax/test.html');
+    

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.

-

Note: Because .ajaxSuccess() is implemented as a method of jQuery object instances, we can use the this keyword as we do here to refer to the selected elements within the callback function.

-

All ajaxSuccess handlers are invoked, regardless of what Ajax request was completed. If we must differentiate between the requests, we 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, we can restrict our callback to only handling events dealing with a particular URL:

-

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

-
$('.log').ajaxSuccess(function(e, xhr, settings) {
-  if (settings.url == 'ajax/test.html') {
-    $(this).text('Triggered ajaxSuccess handler. The ajax response was:'
-                     + xhr.responseText );
+    

Note: Because .ajaxSuccess() is implemented as a method of jQuery object instances, use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxSuccess() method should only be attached to document.

+

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) {
+  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. - From 8d3bf8569f6af705301dcdd61a6af7f9114ba39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 21 Oct 2012 20:23:53 -0400 Subject: [PATCH 007/998] Fix grunt lint, move use-strict into function where it needs to be --- grunt.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grunt.js b/grunt.js index 17b522c7..41456718 100644 --- a/grunt.js +++ b/grunt.js @@ -1,7 +1,6 @@ /*jshint node:true */ -"use strict"; - module.exports = function( grunt ) { +"use strict"; var entryFiles = grunt.file.expandFiles( "entries/*.xml" ); From aca4122984fdd5631509f44faf44635c52b6e54b Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 21 Oct 2012 20:50:16 -0400 Subject: [PATCH 008/998] Emphasize that $.extend() cannot take false as first arg. Fixes #121 --- entries/jQuery.extend.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index fe88f2a6..2007fa65 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -30,11 +30,12 @@ Merge the contents of two or more objects together into the first object. -

When we supply two or more objects to $.extend(), properties from all of the objects are added to the target object.

-

If only one argument is supplied to $.extend(), this means the target argument was omitted. In this case, the jQuery object itself is assumed to be the target. By doing this, we can add new functions to the jQuery namespace. This can be useful for plugin authors wishing to add new methods to JQuery.

-

Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, we want to preserve both of the original objects, we can do so by passing an empty object as the target:

+

When two or more objects are supplied to $.extend(), properties from all of the objects are added to the target object.

+

If only one argument is supplied to $.extend(), this means the target argument was omitted. In this case, the jQuery object itself is assumed to be the target. By doing this, you can add new functions to the jQuery namespace. This can be useful for plugin authors wishing to add new methods to JQuery.

+

Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, you want to preserve both of the original objects, you can do so by passing an empty object as the target:

var object = $.extend({}, object1, object2);
-

The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged. (Passing false for the first argument is not supported.)

+

The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

+

Warning: Passing false for the first argument is not supported.

Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.

For needs that fall outside of this behavior, write a custom extend method instead.

@@ -134,4 +135,4 @@ $("#log").append( "
settings -- " + printObj(settings) + "
" ); - \ No newline at end of file + From 8d7bfb4817c849d26fd35f3f30e5e02083cb6fb9 Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Sun, 21 Oct 2012 21:09:18 -0400 Subject: [PATCH 009/998] jQuery.when(): Add "or Promise". Fixes #145 --- entries/jQuery.when.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index deb6e852..30dde8ff 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -13,7 +13,7 @@
$.when( $.ajax("test.aspx") ).then(function(data, textStatus, jqXHR){
      alert( jqXHR.status ); // alerts 200
 });
-

If a single argument is passed to jQuery.when and it is not a Deferred, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. The doneCallbacks are passed the original argument. In this case any failCallbacks you might set are never called since the Deferred is never rejected. For example:

+

If a single argument is passed to jQuery.when and it is not a Deferred or a Promise, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. The doneCallbacks are passed the original argument. In this case any failCallbacks you might set are never called since the Deferred is never rejected. For example:

$.when( { testing: 123 } ).done(
     function(x) { alert(x.testing); } /* alerts "123" */
     );
From 375c308e690ed24805f829db46985db7b69fe362 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Fri, 26 Oct 2012 12:00:36 -0300 Subject: [PATCH 010/998] Clarify return value when a selector is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See http://bugs.jquery.com/ticket/12792 . --- entries/index.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/index.xml b/entries/index.xml index cc7b2cd9..416253c8 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -21,7 +21,7 @@

Return Values

If no argument is passed to the .index() method, the return value is an integer indicating the position of the first element within the jQuery object relative to its sibling elements.

If .index() is called on a collection of elements and a DOM element or jQuery object is passed in, .index() returns an integer indicating the position of the passed element relative to the original collection.

-

If a selector string is passed as an argument, .index() returns an integer indicating the position of the original element relative to the elements matched by the selector. If the element is not found, .index() will return -1.

+

If a selector string is passed as an argument, .index() returns an integer indicating the position of the first element within the jQuery object relative to the elements matched by the selector. If the element is not found, .index() will return -1.

Detail

The complementary operation to .get(), which accepts an index and returns a DOM node, .index() can take a DOM node and returns an index. Suppose we have a simple unordered list on the page:



From 69ed47a2ee6c58690480f0d1bd0a36d75215f2a1 Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Sat, 27 Oct 2012 12:06:16 -0400
Subject: [PATCH 011/998] Fix typo in live.xml

---
 entries/live.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/entries/live.xml b/entries/live.xml
index a3ae5d05..2ba3a9b1 100644
--- a/entries/live.xml
+++ b/entries/live.xml
@@ -1,5 +1,5 @@
 
-
+
   .live()
   Attach an event handler for all elements which match the current selector, now and in the future.
   
@@ -139,4 +139,4 @@ $("p").live({
   
   
   
-
\ No newline at end of file
+

From a10920825e369712b4fcc6cd156dfa89beda7528 Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Thu, 1 Nov 2012 14:40:40 -0400
Subject: [PATCH 012/998] Plain object or function makes hide/show/toggle an
 animation

Fixes #167
---
 entries/hide.xml   | 4 ++--
 entries/show.xml   | 4 ++--
 entries/toggle.xml | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/entries/hide.xml b/entries/hide.xml
index 831af958..99a08409 100644
--- a/entries/hide.xml
+++ b/entries/hide.xml
@@ -26,7 +26,7 @@
     
$('.target').hide();
     

The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

-

When a duration is provided, .hide() becomes an animation method. The .hide() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0, the display style property is set to none to ensure that the element no longer affects the layout of the page.

+

When a duration, a plain object, or a "complete" function is provided, .hide() becomes an animation method. The .hide() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0, the display style property is set to none to ensure that the element no longer affects the layout of the page.

Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

Note that .hide() is fired immediately and will override the animation queue if no duration or a duration of 0 is specified.

As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

@@ -125,4 +125,4 @@ $("div").click(function () { - \ No newline at end of file + diff --git a/entries/show.xml b/entries/show.xml index 101f6e37..6362d200 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -30,7 +30,7 @@

Note: If using !important in your styles, such as display: none !important, it is necessary to override the style using .css('display', 'block !important') should you wish for .show() to function correctly.

-

When a duration is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.

+

When a duration, a plain object, or a "complete" function is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.

Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

@@ -131,4 +131,4 @@ $("form").submit(function () { - \ No newline at end of file + diff --git a/entries/toggle.xml b/entries/toggle.xml index 63e91ae4..b20509bb 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -31,7 +31,7 @@

With no parameters, the .toggle() method simply toggles the visibility of elements:

$('.target').toggle();

The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS display property. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

-

When a duration is provided, .toggle() becomes an animation method. The .toggle() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.

+

When a duration, a plain object, or a single "complete" function is provided, .toggle() becomes an animation method. The .toggle() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.

Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

@@ -120,4 +120,4 @@ $("p").toggle( flip++ % 2 == 0 ); - \ No newline at end of file + From 28a23025f0df9f2b0265f79f6a11d430537118c8 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 1 Nov 2012 14:44:33 -0400 Subject: [PATCH 013/998] Add Ajax_Events page and change hrefs to point to it * They were pointing to http://docs.jquery.com/Ajax_Events * Fixes #165 --- entries/ajaxComplete.xml | 2 +- entries/ajaxError.xml | 2 +- entries/ajaxSend.xml | 2 +- entries/ajaxStart.xml | 2 +- entries/ajaxStop.xml | 2 +- entries/ajaxSuccess.xml | 2 +- entries/jQuery.ajax.xml | 10 ++++---- pages/Ajax_Events.html | 52 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 pages/Ajax_Events.html diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index de519d4f..8064a68c 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -7,7 +7,7 @@ The function to be invoked. - Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + 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.

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

diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index cd4c5b28..c0e3c5c7 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -7,7 +7,7 @@ The function to be invoked. - Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + 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.

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

diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index b59bdfcc..3639b44f 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -7,7 +7,7 @@ The function to be invoked. - Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + 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.

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

diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index afe3247f..5097dcec 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -7,7 +7,7 @@ The function to be invoked. - Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + 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.

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

diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 502c6e82..e8e947de 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -1,7 +1,7 @@ .ajaxStop() - Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 1.0 diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 7e60e9a5..9a9d7eed 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -7,7 +7,7 @@ The function to be invoked. - Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + 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.

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

diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 9db343ea..75370a48 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -24,7 +24,7 @@ - A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings maps are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings maps are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. @@ -32,7 +32,7 @@ - A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. A map of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. @@ -72,10 +72,10 @@ - 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." 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 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." 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 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. + 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. A map of additional header key/value pairs to send along with the request. This setting is set before the beforeSend function is called; therefore, any values in the headers setting can be overwritten from within the beforeSend function. @@ -121,7 +121,7 @@ - A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html new file mode 100644 index 00000000..04b8f0b8 --- /dev/null +++ b/pages/Ajax_Events.html @@ -0,0 +1,52 @@ + +

Ajax requests produce a number of different events that you can subscribe to. Here's a full list of the events and in what order they are broadcast.

+

There are two types of events:

+

Local Events

+

These are callbacks that you can subscribe to within the Ajax request object, like so:

+
 $.ajax({
+   beforeSend: function(){
+     // Handle the beforeSend event
+   },
+   complete: function(){
+     // Handle the complete event
+   }
+   // ......
+ });
+
+

Global Events

+

These events are broadcast to all elements in the DOM, triggering any handlers which may be listening. You can listen for these events like so:

+
 $("#loading").bind("ajaxSend", function(){
+   $(this).show();
+ }).bind("ajaxComplete", function(){
+   $(this).hide();
+ });
+
+

Global events can be disabled for a particular Ajax request by passing in the global option, like so:

+
 $.ajax({
+   url: "test.html",
+   global: false,
+   // ...
+ });
+
+

Events

+

This is the full list of Ajax events that are broadcast, and in the order in which they are broadcast. The indented events are broadcast for each and every Ajax request (unless a global option has been set). The ajaxStart and ajaxStop events are events that relate to all Ajax requests together. +

+
    +
  • ajaxStart (Global Event)
    This event is broadcast if an Ajax request is started and no other Ajax requests are currently running. +
      +
    • beforeSend (Local Event)
      This event, which is triggered before an Ajax request is started, allows you to modify the XMLHttpRequest object (setting additional headers, if need be.)
    • +
    • ajaxSend (Global Event)
      This global event is also triggered before the request is run.
    • +
    • success (Local Event)
      This event is only called if the request was successful (no errors from the server, no errors with the data).
    • +
    • ajaxSuccess (Global Event)
      This event is also only called if the request was successful.
    • +
    • error (Local Event)
      This event is only called if an error occurred with the request (you can never have both an error and a success callback with a request).
    • +
    • ajaxError (Global Event)
      This global event behaves the same as the local error event.
    • +
    • complete (Local Event)
      This event is called regardless of if the request was successful, or not. You will always receive a complete callback, even for synchronous requests.
    • +
    • ajaxComplete (Global Event)
      This event behaves the same as the complete event and will be triggered every time an Ajax request finishes.
    • +
    +
  • +
  • ajaxStop (Global Event)
    This global event is triggered if there are no more Ajax requests being processed.
  • +
From 2c02411b808260ab4a6e00ca4115a9a39df9ab8e Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 4 Nov 2012 16:05:28 -0500 Subject: [PATCH 014/998] Update $.proxy to show signatures w/ additional args * Refers to #80. Not closing until reviewed. * Note: Use of "slash-star" comments is necessary because of the way we convert code in html to demos. --- entries/jQuery.proxy.xml | 119 ++++++++++++++++++++++++++++++++------- 1 file changed, 100 insertions(+), 19 deletions(-) diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index eaf60c9a..1eae430f 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -19,11 +19,37 @@ The name of the function whose context will be changed (should be a property of the context object). + + 1.6 + + The function whose context will be changed. + + + The object to which the context (this) of the function should be set. + + + Any number of arguments to be passed to the function referenced in the function argument. + + + + 1.6 + + The object to which the context of the function should be set. + + + The name of the function whose context will be changed (should be a property of the context object). + + + Any number of arguments to be passed to the function named in the name argument. + + + Takes a function and returns a new one that will always have a particular context.

This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

+

As of jQuery 1.6, any number of additional arguments may supplied to $.proxy(), and they will be passed to the function whose context will be changed.

Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. @@ -35,13 +61,13 @@ var me = { type: "zombie", test: function(event) { - // Without proxy, `this` would refer to the event target - // use event.target to reference that element. + /* Without proxy, `this` would refer to the event target */ + /* use event.target to reference that element. */ var element = event.target; $(element).css("background-color", "red"); - // With proxy, `this` refers to the me object encapsulating - // this function. + /* With proxy, `this` refers to the me object encapsulating */ + /* this function. */ $("#log").append( "Hello " + this.type + "
" ); $("#test").unbind("click", this.test); } @@ -54,22 +80,26 @@ var you = { } }; -// execute you.test() in the context of the `you` object -// no matter where it is called -// i.e. the `this` keyword will refer to `you` +/* execute you.test() in the context of the `you` object */ +/* no matter where it is called */ +/* i.e. the `this` keyword will refer to `you` */ var youClick = $.proxy( you.test, you ); -// attach click handlers to #test +/* attach click handlers to #test */ $("#test") - // this === "zombie"; handler unbound after first click - .click( $.proxy( me.test, me ) ) - // this === "person" - .click( youClick ) - // this === "zombie" - .click( $.proxy( you.test, me ) ) - // this === "

In this case, "x defaulted to false" is printed.

-

To keep the examples short, the invert-operator is used to show a boolean context: +

To keep the examples short, the invert ("not") operator and double-negation are used to show a boolean context:

-
!x // true
+

+var x = "";
+!x // true
+!!x // false (Double negation: Since "not (empty string)" is true, negating that makes it false)
 

On to the actual types.

@@ -125,6 +128,7 @@

Boolean Default

An empty string defaults to false:

!"" // true
+!!"" // false
 !"hello" // false
 !"true" // false
 !new Boolean( false ) // false
@@ -144,7 +148,7 @@ 

Boolean Default

If a number is zero, it defaults to false:

!0 // true
-!!0 // false (Double negation: Since "not 0" is true, negating that makes it false)
+!!0 // false
 !1 // false
 !-1 // false
 
@@ -217,8 +221,8 @@

Float

Boolean

A boolean in JavaScript can be either true or false:

-
if ( true ) console.log( "always!" )
-if ( false ) console.log( "never!" )
+
if ( true ) console.log( "always!" );
+if ( false ) console.log( "never!" );
 

Object

Everything in JavaScript is an object, though some are more objective (haha). The easiest way to create an object is the object literal: @@ -281,6 +285,7 @@

Boolean default

An object, no matter if it has properties or not, never defaults to false:

!{} // false
+!!{} // true
 

Prototype

All objects have a prototype property. Whenever the interpreter looks for a property, it also checks the prototype. jQuery uses that extensively to add methods to jQuery instances. @@ -369,6 +374,7 @@

Boolean Default

An array, no matter if it has elements or not, never defaults to false:

![] // false
+!![] // true
 

Array<Type> Notation

In the jQuery API you'll often find the notation of Array<Type>: From 0f0498233071b3ad4b210639a1937640ce24bbf4 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Fri, 9 Nov 2012 19:05:53 -0500 Subject: [PATCH 018/998] Remove bad advice --- entries/jQuery.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index e316b922..fb7319ef 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -187,20 +187,6 @@ $( "

", { }).appendTo( "body" );

The name "class" must be quoted in the map since it is a JavaScript reserved word, and "className" cannot be used since it is not the correct attribute name.

-

Note: Internet Explorer will not allow you to create an input or button element and change its type; you must specify the type using "<input type="checkbox" />", for example. A demonstration of this can be seen below:

-

Unsupported in IE:

-

-$( "<input />", {
-  type: "text",
-  name: "test"
-}).appendTo( "body" );
-
-

Supported workaround:

-

-$( "<input type="text" />" ).attr({
-    name: "test"
-}).appendTo( "body" );
-
Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup. From a360c373bf88dc75991adac9c7e9bd0a24967466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 14 Nov 2012 10:36:13 -0500 Subject: [PATCH 019/998] Upgrade grunt-jquery-content to 0.5.12. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1fe35340..77a6ff93 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.x", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.3", - "grunt-jquery-content": "0.5.x", + "grunt-jquery-content": "0.5.12", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 53039c86606fd5f2cb41459c6168cd492d19ec79 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 19 Nov 2012 14:03:19 -0500 Subject: [PATCH 020/998] Fix attribute selectors category. Closes #177 --- categories.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/categories.xml b/categories.xml index d23dfa1b..bf85a73c 100644 --- a/categories.xml +++ b/categories.xml @@ -211,9 +211,9 @@ ]]> , will select Some text but not Some text.

-

Attribute values in selector expressions must follow the rules for W3C CSS selectors, in general that means anything other than a simple identifier should be surrounded by quotation marks.

+

The CSS specification allows elements to be identified by their attributes. While not supported by some older browsers for the purpose of styling documents, jQuery allows you to employ them regardless of the browser being used.

+

When using any of the following attribute selectors, you should account for attributes that have multiple, space-separated values. Since these selectors see attribute values as a single string, this selector, for example, $("a[rel='nofollow']"), will select <a href="example.html" rel="nofollow">Some text</a> but not <a href="example.html" rel="nofollow foe">Some text</a>.

+

Attribute values in selector expressions must follow the rules for W3C CSS selectors; in general, that means anything other than a valid identifier should be surrounded by quotation marks.

  • double quotes inside single quotes: $('a[rel="nofollow self"]')
  • single quotes inside double quotes: $("a[rel='nofollow self']")
  • @@ -221,8 +221,10 @@
  • escaped double quotes inside double quotes: $("a[rel=\"nofollow self\"]")

The variation you choose is generally a matter of style or convenience.

+

Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the "@" symbol from your selectors in order to make them work again.

- ]]>
+ ]]> +
From 08f32cfc488772094d4b02e0c87fc1f250291958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 30 Nov 2012 06:21:16 -0500 Subject: [PATCH 021/998] Upgrade to grunt-jquery-content 0.7.0 and grunt-wordpress 1.0.5. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 77a6ff93..dbd7a90b 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "dependencies": { "grunt": "0.3.x", "grunt-clean": "0.3.0", - "grunt-wordpress": "1.0.3", - "grunt-jquery-content": "0.5.12", + "grunt-wordpress": "1.0.5", + "grunt-jquery-content": "0.7.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 148020ba15e3338298b6fd458e47cf04e8e3b369 Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Sun, 2 Dec 2012 13:40:20 -0500 Subject: [PATCH 022/998] Provisionally fixes #173 - fixes desc and typo, but andSelf/addBack issue needs addressing --- entries/andSelf.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/entries/andSelf.xml b/entries/andSelf.xml index 67e2f1c3..dc47098f 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -6,7 +6,7 @@ Add the previous set of elements on the stack to the current set. -

As described in the discussion for .end(), jQuery objects maintain aninternal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

+

As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

Consider a page with a simple list on it:


 <ul>
@@ -24,10 +24,14 @@
     

First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

- Find all divs, and all the paragraphs inside of them, and give them both class names. Notice the div doesn't have the yellow background color since it didn't use .andSelf(). + The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $("div.after-andself") — to the current set, selecting both the div and its enclosed paragraphs. + + .addBack() + + 1.6 + + A string containing a selector expression to match the current set of elements against. + + + Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + +

As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .addBack() can help.

+

Consider a page with a simple list on it:

+

+<ul>
+   <li>list item 1</li>
+   <li>list item 2</li>
+   <li class="third-item">list item 3</li>
+   <li>list item 4</li>
+   <li>list item 5</li>
+</ul>
+
+

The result of the following code is a red background behind items 3, 4 and 5:

+
$('li.third-item').nextAll().addBack()
+  .css('background-color', 'red');
+
+

First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .addBack() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

+
+ + The .addBack() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .addBack() adds the previous set of elements on the stack — in this case $("div.after-addback") — to the current set, selecting both the div and its enclosed paragraphs. + + + + + + +
diff --git a/entries/andSelf.xml b/entries/andSelf.xml index dc47098f..d85b2e88 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -1,11 +1,12 @@ - + .andSelf() 1.2 Add the previous set of elements on the stack to the current set. +

Note: This function has been deprecated and is now an alias for .addBack(), which should be used with jQuery 1.8 and later.

As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

Consider a page with a simple list on it:



From 8237b684d1a0e2370296edb6511751bfcffa92fb Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Sat, 15 Dec 2012 14:30:56 -0500
Subject: [PATCH 024/998] Change "map" to "object" or "plain object" as
 appropriate. Closes #181

---
 entries/animate.xml              | 12 ++++++------
 entries/attr.xml                 |  4 ++--
 entries/bind.xml                 | 10 +++++-----
 entries/blur.xml                 |  4 ++--
 entries/change.xml               |  4 ++--
 entries/click.xml                |  4 ++--
 entries/css.xml                  |  4 ++--
 entries/dblclick.xml             |  4 ++--
 entries/delegate.xml             |  6 +++---
 entries/die.xml                  |  2 +-
 entries/error.xml                |  4 ++--
 entries/event.data.xml           |  2 +-
 entries/focus.xml                |  4 ++--
 entries/focusin.xml              |  4 ++--
 entries/focusout.xml             |  4 ++--
 entries/jQuery.ajax.xml          | 20 ++++++++++----------
 entries/jQuery.ajaxTransport.xml |  6 +++---
 entries/jQuery.browser.xml       |  2 +-
 entries/jQuery.each.xml          | 16 ++++++++--------
 entries/jQuery.get.xml           |  6 +++---
 entries/jQuery.getJSON.xml       |  6 +++---
 entries/jQuery.map.xml           |  2 +-
 entries/jQuery.noConflict.xml    |  2 +-
 entries/jQuery.post.xml          |  6 +++---
 entries/jQuery.xml               |  6 +++---
 entries/keydown.xml              |  4 ++--
 entries/keypress.xml             |  4 ++--
 entries/keyup.xml                |  4 ++--
 entries/live.xml                 |  8 ++++----
 entries/load-event.xml           |  4 ++--
 entries/load.xml                 |  6 +++---
 entries/mousedown.xml            |  4 ++--
 entries/mouseenter.xml           |  4 ++--
 entries/mouseleave.xml           |  4 ++--
 entries/mousemove.xml            |  4 ++--
 entries/mouseout.xml             |  4 ++--
 entries/mouseover.xml            |  4 ++--
 entries/mouseup.xml              |  4 ++--
 entries/off.xml                  |  4 ++--
 entries/on.xml                   | 10 +++++-----
 entries/one.xml                  |  6 +++---
 entries/prop.xml                 |  2 +-
 entries/resize.xml               |  4 ++--
 entries/scroll.xml               |  4 ++--
 entries/select.xml               |  4 ++--
 entries/submit.xml               |  4 ++--
 entries/undelegate.xml           |  4 ++--
 entries/unload.xml               |  4 ++--
 48 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/entries/animate.xml b/entries/animate.xml
index 9c161392..e67347ff 100644
--- a/entries/animate.xml
+++ b/entries/animate.xml
@@ -5,7 +5,7 @@
   
     1.0
     
-      A map of CSS properties that the animation will move toward.
+      An object of CSS properties and values that the animation will move toward.
     
     
     
@@ -14,13 +14,13 @@
   
     1.0
     
-      A map of CSS properties that the animation will move toward.
+      An object of CSS properties and values that the animation will move toward.
     
     
   
 
   
-    

The .animate() method allows us to create animation effects on any numeric CSS property. The only required parameter is a map of CSS properties. This map is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive.

+

The .animate() method allows us to create animation effects on any numeric CSS property. The only required parameter is a plain object of CSS properties. This object is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive.

Animation Properties and Values

All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used). Property values are treated as a number of pixels unless otherwise specified. The units em and % can be specified where applicable.

In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated.

@@ -100,7 +100,7 @@ $(this).after('<div>Animation complete.</div>'); }); });
-

In the second version of .animate(), the options map can include the specialEasing property, which is itself a map 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:

+

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() {
   $('#book').animate({
     width: 'toggle',
@@ -290,7 +290,7 @@ div {
 }, { duration: "slow", easing: "easein" });]]>
   
   
-    Animate all paragraphs and execute a callback function when the animation is complete.  The first argument is a map of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. 
+    Animate all paragraphs and execute a callback function when the animation is complete.  The first argument is an object of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. 
     
       1: 97
     

-

If a map is used as the collection, the callback is passed a key-value pair each time:

-
var map = {
-  'flammable': 'inflammable',
-  'duh': 'no duh'
+    

If an object is used as the collection, the callback is passed a key-value pair each time:

+
var obj = {
+  "flammable": "inflammable",
+  "duh": "no duh"
 };
-$.each(map, function(key, value) {
-  alert(key + ': ' + value);
+$.each( obj, function( key, value ) {
+  alert( key + ": " + value );
 });

Once again, this produces two messages:

@@ -79,4 +79,4 @@ $.each(map, function(key, value) { - \ No newline at end of file + diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index ea5c4edd..fdae7303 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -6,8 +6,8 @@ A string containing the URL to which the request is sent. - - A map or string that is sent to the server with the request. + + A plain object or string that is sent to the server with the request. A callback function that is executed if the request succeeds. @@ -91,4 +91,4 @@ alert("Data Loaded: " + data); - \ No newline at end of file + diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index f7ad70c0..9c7858d8 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -7,7 +7,7 @@ A string containing the URL to which the request is sent. - A map or string that is sent to the server with the request. + A plain object or string that is sent to the server with the request. A callback function that is executed if the request succeeds. @@ -23,7 +23,7 @@ success: callback });

-

Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is an object (map), it is converted to a string and url-encoded before it is appended to the URL.

+

Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is a plain object, it is converted to a string and url-encoded before it is appended to the URL.

Most implementations will specify a success handler:

$.getJSON('ajax/test.json', function(data) {
   var items = [];
@@ -107,4 +107,4 @@ $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml
index cd8d35b9..9f83e9ee 100644
--- a/entries/jQuery.map.xml
+++ b/entries/jQuery.map.xml
@@ -113,7 +113,7 @@ var dimensions = { width: 10, height: 15, length: 20 },
     
   
   
-    Maps the original array to a new one; each element is squared.
+    Map the original array to a new one; each element is squared.
     If necessary, you can free up the jQuery name as well by passing true as an argument to the method. This is rarely necessary, and if you must do this (for example, if you need to use multiple versions of the jQuery library on the same page), you need to consider that most plug-ins rely on the presence of the jQuery variable and may not operate correctly in this situation.

- Maps the original object that was referenced by $ back to $. + Map the original object that was referenced by $ back to $. - Use a map to bind multiple live event handlers. Note that .live() calls the click, mouseover, and mouseout event handlers for all paragraphs--even new ones. + Use an object to bind multiple live event handlers. Note that .live() calls the click, mouseover, and mouseout event handlers for all paragraphs--even new ones. - \ No newline at end of file + diff --git a/entries/on.xml b/entries/on.xml index a8be1a32..6ddaa0ce 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -20,7 +20,7 @@ 1.7 - A map in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. @@ -34,7 +34,7 @@

Event names and namespaces

Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers.

An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces beginning with an underscore are reserved for jQuery's use.

-

In the second form of .on(), the events argument is a JavaScript Object, or "map". The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

+

In the second form of .on(), the events argument is a plain object. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

Direct and delegated events

The majority of browser events bubble, or propagate, from the deepest, innermost element (the event target) in the document where they occur all the way up to the body and the document element. In Internet Explorer 8 and lower, a few events such as change and submit do not natively bubble but jQuery patches these to bubble and create consistent cross-browser behavior.

If selector is omitted or is null, the event handler is referred to as direct or directly-bound. The handler is called every time an event occurs on the selected elements, whether it occurs directly on the element or bubbles from a descendant (inner) element.

@@ -65,7 +65,7 @@ $("button").on("click", notify);

Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $("a.disabled").on("click", false); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $(this).

Passing data to the handler

-

If a data argument is provided to .on() and is not null or undefined, it is passed to the handler in the event.data property each time an event is triggered. The data argument can be any type, but if a string is used the selector must either be provided or explicitly passed as null so that the data is not mistaken for a selector. Best practice is to use an object (map) so that multiple values can be passed as properties.

+

If a data argument is provided to .on() and is not null or undefined, it is passed to the handler in the event.data property each time an event is triggered. The data argument can be any type, but if a string is used the selector must either be provided or explicitly passed as null so that the data is not mistaken for a selector. Best practice is to use a plain object so that multiple values can be passed as properties.

As of jQuery 1.4, the same event handler can be bound to an element multiple times. This is especially useful when the event.data feature is being used, or when other unique data resides in a closure around the event handler function. For example:


 function greet(event) { alert("Hello "+event.data.name); }
@@ -137,7 +137,7 @@ span { color:blue; }
 ]]>
   
   
-    Attach multiple event handlers simultaneously using a map.
+    Attach multiple event handlers simultaneously using a plain object.
     
     
   
   
   
-
\ No newline at end of file
+
diff --git a/entries/unload.xml b/entries/unload.xml
index 77117b49..615e8ac3 100644
--- a/entries/unload.xml
+++ b/entries/unload.xml
@@ -10,7 +10,7 @@
   
     1.4.3
     
-      A map of data that will be passed to the event handler.
+      A plain object of data that will be passed to the event handler.
     
     
       A function to execute each time the event is triggered.
@@ -39,4 +39,4 @@ It is not possible to cancel the unload event with .preventDe
   
   
   
-
\ No newline at end of file
+

From c9eb114e51f7d9e1ddaea797704817a78c224f0f Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Sat, 15 Dec 2012 14:53:10 -0500
Subject: [PATCH 025/998] Add optional="true" to fx argument includes. Fixes
 #191

---
 includes/complete-argument.xml | 2 +-
 includes/duration-argument.xml | 2 +-
 includes/easing-argument.xml   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/includes/complete-argument.xml b/includes/complete-argument.xml
index 25e6e6d0..042fdf45 100644
--- a/includes/complete-argument.xml
+++ b/includes/complete-argument.xml
@@ -1,4 +1,4 @@
 
-
+
 	A function to call once the animation is complete.
 
diff --git a/includes/duration-argument.xml b/includes/duration-argument.xml
index b1a7da1c..1a1c5c5e 100644
--- a/includes/duration-argument.xml
+++ b/includes/duration-argument.xml
@@ -1,5 +1,5 @@
 
-
+
 	A string or number determining how long the animation will run.
 	
 	
diff --git a/includes/easing-argument.xml b/includes/easing-argument.xml
index 6e1f788f..b6483551 100644
--- a/includes/easing-argument.xml
+++ b/includes/easing-argument.xml
@@ -1,4 +1,4 @@
 
-
+
 	A string indicating which easing function to use for the transition.
 

From b564a8329aa84a9a29757768da0e11a88cff0428 Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Sat, 15 Dec 2012 15:04:20 -0500
Subject: [PATCH 026/998] Change faq link. Fixes #168

---
 entries/id-selector.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/entries/id-selector.xml b/entries/id-selector.xml
index bff69e48..988c356c 100644
--- a/entries/id-selector.xml
+++ b/entries/id-selector.xml
@@ -15,7 +15,7 @@
       

As always, remember that as a developer, your time is typically the most valuable resource. Do not focus on optimization of selector speed unless it is clear that performance needs to be improved.

Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.

-

If the id contains characters like periods or colons you have to escape those characters with backslashes.

+

If the id contains characters like periods or colons you have to escape those characters with backslashes.

Finds the element with the id "myDiv". @@ -53,4 +53,4 @@ - \ No newline at end of file + From 5cdcee36c33bc466bd518e3a13db0262f31f9fee Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 15 Dec 2012 15:46:33 -0500 Subject: [PATCH 027/998] Warn about $(html, attrs) and note that html arg must represent single element with no attrs. Closes #104 --- entries/jQuery.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index eb7de41c..44cd3e30 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -174,7 +174,8 @@ var el = $( "1<br/>2<br/>3" ); // returns [<br>, "2", <br&g el = $( "1<br/>2<br/>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]

This behavior is expected.

-

As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method. Furthermore, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

+

As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

+

Important: If the second argument is passed, the HTML string in the first argument must represent a a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

As of jQuery 1.8, any jQuery instance method (a method of jQuery.fn) can be used as a property of the object passed to the second parameter:


 $( "
", { @@ -187,6 +188,16 @@ $( "
", { }).appendTo( "body" );

The name "class" must be quoted in the object since it is a JavaScript reserved word, and "className" cannot be used since it refers to the DOM property, not the attribute.

+

While the second argument is convenient, its flexibility can lead to unintended consequences (e.g. $("<input>", {size: "4"}) calling the .size() method instead of setting the size attribute). The previous code block could thus be written instead as:

+

+$( "
" ) +.addClass( "my-div" ) +.on({ + touchstart: function( event ) { + // do something + } +}).appendTo( "body" ); +
Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup. From 6e3fd049673c4fe7098abe0f5be7f22dd1264430 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 15 Dec 2012 17:03:00 -0500 Subject: [PATCH 028/998] Fix PlainObject type in Types page. Closes #194 --- entries/jQuery.isPlainObject.xml | 4 ++-- pages/Types.html | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/entries/jQuery.isPlainObject.xml b/entries/jQuery.isPlainObject.xml index 22312742..cc3c1b0e 100644 --- a/entries/jQuery.isPlainObject.xml +++ b/entries/jQuery.isPlainObject.xml @@ -14,7 +14,7 @@

   console.log($.isPlainObject(document.location));
 
-

which throws an invalid pointer exception in IE8. With this in mind, it's important to be aware of any of the gotchas involved in using $.isPlainObject() against older browsers. Some basic example of use-cases that do function correctly cross-browser can be found below.

+

which throws an invalid pointer exception in IE8. With this in mind, it's important to be aware of any of the gotchas involved in using $.isPlainObject() against older browsers. A couple basic examples that do function correctly cross-browser can be found below.

Check an object to see if it's a plain object. @@ -23,4 +23,4 @@ jQuery.isPlainObject("test") // false]]>
- \ No newline at end of file + diff --git a/pages/Types.html b/pages/Types.html index 4a2ac57d..0fa8559d 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -384,21 +384,22 @@

Array<Type> Notation

This indicates that the method doesn't only expect an array as the argument, but also specifies the expected type. The notation is borrowed from Java 5's generics notation (or C++ templates).

PlainObject

-

The PlainObject type is used by the AJAX function to hold the data of a request. This type could be a string, an array<form elements>, a jQuery object with form elements or an object with key/value pairs. -In the last case, it is possible to assign multiple values to one key by assigning an array. +

The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below:

-
{ 'key[]': [ 'valuea', 'valueb' ] }
-
-

becomes on the server-side (in PHP): -

-
<?php
-$_REQUEST['key'][0]="valuea";
-$_REQUEST['key'][1]="valueb";
-
-

in Rails or Merb: -

-
params[:key] = ["valuea", "valueb"]
+

+  var a = [];
+  var d = document;
+  var o = {};
+
+  typeof a; // object
+  typeof d; // object
+  typeof o; // object
+
+  jQuery.isPlainObject( a ); // false
+  jQuery.isPlainObject( d ); // false
+  jQuery.isPlainObject( o ); // true
 
+

Function

A function in JavaScript can be either named or anonymous. Any function can be assigned to a variable or passed to a method, but passing member functions this way can cause them to be called in the context of another object (i.e. with a different "this" object).

From ab0e5231461f8f6246b69d14b5a89d03092dfad4 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 15 Dec 2012 17:20:16 -0500 Subject: [PATCH 029/998] .load(): Note that ajax request not sent if no element selected. Closes #180 --- entries/load.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/load.xml b/entries/load.xml index eca453fd..6e83173c 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -20,6 +20,7 @@

This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

$('#result').load('ajax/test.html');
+

If no element is matched by the selector — in this case, if the document does not contain an element with id="result" — the Ajax request will not be sent.

Callback Function

If a "complete" callback is provided, it is executed after post-processing and HTML insertion has been performed. The callback is fired once for each element in the jQuery collection, and this is set to each DOM element in turn.

$('#result').load('ajax/test.html', function() {

From 327fa42643afe2e7c338fb8a6688712a06efdb39 Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Sun, 16 Dec 2012 14:01:04 -0500
Subject: [PATCH 030/998] Additional note about slide effects in IE with ul/li.
 Closes #111

---
 entries/slideDown.xml   | 3 ++-
 entries/slideToggle.xml | 3 ++-
 entries/slideUp.xml     | 3 ++-
 notes.xsl               | 3 +++
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/entries/slideDown.xml b/entries/slideDown.xml
index 5618a777..0ffeadf9 100644
--- a/entries/slideDown.xml
+++ b/entries/slideDown.xml
@@ -45,6 +45,7 @@
     

As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

+ Animates all divs to slide down and show themselves over 600 milliseconds. Relinquish jQuery's control of the $ variable.

Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If you need to use another JavaScript library alongside jQuery, return control of $ back to the other library with a call to $.noConflict(). Old references of $ are saved during jQuery initialization; noConflict() simply restores them.

+

If for some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict(true) from the second version will return the globally scoped jQuery variables to those of the first version.


 <script type="text/javascript" src="other_lib.js"></script>
 <script type="text/javascript" src="jquery.js"></script>
@@ -70,6 +71,32 @@ $("content").style.display = 'none';
 // Do something with another version of jQuery
 jQuery("div > p").hide();]]>
   
+  
+    Load two versions of jQuery (not recommended). Then, restore jQuery's globally scoped variables to the first loaded jQuery.
+    
+    
+
+  
+
   
   
   

From a9c32f7a4f55a0bf87272da4130ccd7afd500172 Mon Sep 17 00:00:00 2001
From: Karl Swedberg 
Date: Wed, 26 Dec 2012 10:55:30 -0500
Subject: [PATCH 032/998] Add info about promise callback arguments

Closes #49.
---
 entries/jQuery.ajax.xml | 52 ++++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
index 3aac2153..acaa4a16 100644
--- a/entries/jQuery.ajax.xml
+++ b/entries/jQuery.ajax.xml
@@ -163,7 +163,7 @@
     

At its simplest, the $.ajax() function can be called with no arguments:

$.ajax();

Note: Default settings can be set globally by using the $.ajaxSetup() function.

-

This example, using no options, loads the contents of the current page, but does nothing with the result. To use the result, we can implement one of the callback functions.

+

This example, using no options, loads the contents of the current page, but does nothing with the result. To use the result, you can implement one of the callback functions.

The jqXHR Object

The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML properties, as well as a getResponseHeader() method. When the transport mechanism is something other than XMLHttpRequest (for example, a script tag for a JSONP request) the jqXHR object simulates native XHR functionality where possible.

As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header:

@@ -179,7 +179,28 @@ $.ajax({ } });
-

The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). These methods take a function argument that is called when the $.ajax() request terminates, and the function receives the same arguments as the correspondingly-named $.ajax() callback. This allows you to assign multiple callbacks on a single request, and even to assign callbacks after the request may have completed. (If the request is already complete, the callback is fired immediately.)

+

The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). These methods take one or more function arguments that are called when the $.ajax() request terminates. This allows you to assign multiple callbacks on a single request, and even to assign callbacks after the request may have completed. (If the request is already complete, the callback is fired immediately.) Available Promise methods of the jqXHR object include:

+
    +
  • + jqXHR.done(function(data, textStatus, jqXHR) {}); +

    An alternative construct to the success callback option, the .done() method replaces the deprecated jqXHR.success() method. Refer to deferred.done() for implementation details.

    +
  • +
  • + jqXHR.fail(function(jqXHR, textStatus, errorThrown) {}); +

    An alternative construct to the error callback option, the .fail() method replaces the deprecated .error() method. Refer to deferred.fail() for implementation details. +

    +
  • +
  • + jqXHR.always(function(data|jqXHR, textStatus, jqXHR|errorThrown) { }); +

    An alternative construct to the complete callback option, the .always() method replaces the deprecated .complete() method.

    +

    In response to a successful request, the function's arguments are the same as those of .done(): data, textStatus, and the jqXHR object. For failed requests the arguments are the same as those of .fail(): the jqXHR object, textStatus, and errorThrown. Refer to deferred.always() for implementation details.

    +
  • +
  • + jqXHR.then(function(data, textStatus, jqXHR) {}, function(jqXHR, textStatus, errorThrown) {}); +

    Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. +

    +
  • +

Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

@@ -194,6 +215,7 @@ var jqxhr = $.ajax( "example.php" ) // Set another completion function for the request above jqxhr.always(function() { alert("second complete"); });
+

The this reference within all callbacks is the object in the context option passed to $.ajax in the settings; if context is not specified, this is a reference to the Ajax settings themselves.

For backward compatibility with XMLHttpRequest, a jqXHR object will expose the following properties and methods:

  • @@ -220,25 +242,17 @@ jqxhr.always(function() { alert("second complete"); });

No onreadystatechange mechanism is provided, however, since success, error, complete and statusCode cover all conceivable requirements.

Callback Function Queues

The beforeSend, error, dataFilter, success and complete options all accept callback functions that are invoked at the appropriate times.

-

As of jQuery 1.5, the error (fail), success (done), and complete (always, as of jQuery 1.6) callback hooks are first-in, first-out managed queues. This means you can assign more than one callback for each hook. See Deferred object methods, which are implemented internally for these $.ajax() callback hooks.

-

The this reference within all callbacks is the object in the context option passed to $.ajax in the settings; if context is not specified, this is a reference to the Ajax settings themselves.

-

Some types of Ajax requests, such as JSONP and cross-domain GET requests, do not use XHR; in those cases the XMLHttpRequest and textStatus parameters passed to the callback are undefined.

-

Here are the callback hooks provided by $.ajax():

+

As of jQuery 1.5, the fail and done, and, as of jQuery 1.6, always callback hooks are first-in, first-out managed queues, allowing for more than one callback for each hook. See Deferred object methods, which are implemented internally for these $.ajax() callback hooks.

+

The callback hooks provided by $.ajax() are as follows:

    -
  1. beforeSend callback is invoked; it receives the jqXHR object and the settings object as parameters.
  2. -
  3. error callbacks are invoked, in the order they are registered, if the request fails. They receive the jqXHR, a string indicating the error type, and an exception object if applicable. Some built-in errors will provide a string as the exception object: "abort", "timeout", "No Transport".
  4. -
  5. dataFilter callback is invoked immediately upon successful receipt of response data. It receives the returned data and the value of dataType, and must return the (possibly altered) data to pass on to success.
  6. -
  7. success callbacks are then invoked, in the order they are registered, if the request succeeds. They receive the returned data, a string containing the success code, and the jqXHR object.
  8. -
  9. complete callbacks fire, in the order they are registered, when the request finishes, whether in failure or success. They receive the jqXHR object, as well as a string containing the success or error code.
  10. +
  11. beforeSend callback option is invoked; it receives the jqXHR object and the settings object as parameters.
  12. +
  13. error callback option is invoked, if the request fails. It receives the jqXHR, a string indicating the error type, and an exception object if applicable. Some built-in errors will provide a string as the exception object: "abort", "timeout", "No Transport".
  14. +
  15. dataFilter callback option is invoked immediately upon successful receipt of response data. It receives the returned data and the value of dataType, and must return the (possibly altered) data to pass on to success.
  16. +
  17. success callback option is invoked, if the request succeeds. It receives the returned data, a string containing the success code, and the jqXHR object.
  18. +
  19. Promise callbacks.done(), .fail(), .always(), and .then() — are invoked, in the order they are registered.
  20. +
  21. complete callback option fires, when the request finishes, whether in failure or success. It receives the jqXHR object, as well as a string containing the success or error code.
-

For example, to make use of the returned HTML, we can implement a success handler:

-
$.ajax({
-  url: 'ajax/test.html',
-  success: function(data) {
-    $('.result').html(data);
-    alert('Load was performed.');
-  }
-});
+

Data Types

The $.ajax() function relies on the server to provide information about the retrieved data. If the server reports the return data as XML, the result can be traversed using normal XML methods or jQuery's selectors. If another type is detected, such as HTML in the example above, the data is treated as text.

Different data handling can be achieved by using the dataType option. Besides plain xml, the dataType can be html, json, jsonp, script, or text.

From 352e17aa36dc62bd154a1eb1d5715dadb1c74903 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 26 Dec 2012 10:56:19 -0500 Subject: [PATCH 033/998] Deprecate deferred.pipe() and update deferred.then() Closes #159 --- entries/deferred.pipe.xml | 6 ++- entries/deferred.then.xml | 82 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/entries/deferred.pipe.xml b/entries/deferred.pipe.xml index a5151963..32857ec6 100644 --- a/entries/deferred.pipe.xml +++ b/entries/deferred.pipe.xml @@ -1,5 +1,5 @@ - + deferred.pipe() 1.6 @@ -34,6 +34,7 @@ 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.

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.

@@ -81,4 +82,5 @@ chained.done(function( data ) { -
\ No newline at end of file + +
diff --git a/entries/deferred.then.xml b/entries/deferred.then.xml index 1d3f8c9f..08a08d89 100644 --- a/entries/deferred.then.xml +++ b/entries/deferred.then.xml @@ -1,8 +1,27 @@ deferred.then() + + 1.8 + + + A function that is called when the Deferred is resolved. + + + + + An optional function that is called when the Deferred is rejected. + + + + + An optional function that is called when progress notifications are sent to the Deferred. + + + 1.5 + 1.8 A function, or array of functions, called when the Deferred is resolved. @@ -16,6 +35,7 @@ 1.7 + 1.8 A function, or array of functions, called when the Deferred is resolved. @@ -32,10 +52,14 @@ - Add handlers to be called when the Deferred object is resolved or rejected. + Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + -

All three arguments (including progressCallbacks, as of jQuery 1.7) can be either a single function or an array of functions. The arguments can also be null if no callback of that type is desired. Alternatively, use .done(), .fail() or .progress() to set only one type of callback.

-

When the Deferred is resolved, the doneCallbacks are called. If the Deferred is instead rejected, the failCallbacks are called. As of jQuery 1.7, the deferred.notify() or deferred.notifyWith() methods can be called to invoke the progressCallbacks as many times as desired before the Deferred is resolved or rejected.

+

Prior to jQuery 1.8, the arguments could be a function or an array of functions.

+

For all signatures, the arguments can be null if no callback of that type is desired. Alternatively, use .done(), .fail() or .progress() to set only one type of callback without filtering status or values.

+ +

As of jQuery 1.8, the deferred.then() method returns a new promise that can filter the status and values of a deferred through a function, replacing the now-deprecated deferred.pipe() method. The doneFilter and failFilter functions filter the original deferred's resolved / rejected status and values. The progressFilter function filters 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 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 promise's callbacks. If the filter function used is null, or not specified, the promise will be resolved or rejected with the same values as the original.

+

Callbacks are executed in the order they were added. Since deferred.then returns a Promise, other methods of the Promise object can be chained to this one, including additional @@ -49,6 +73,58 @@ $.get("test.php").then( function(){ alert("$.get succeeded"); }, function(){ alert("$.get failed!"); } ); +]]> + + + Filter the resolve value: + + + + + + Filter reject value: + + + + Chain tasks: + From 28c300cb427ab710008be3fd7861c5bf27e0408b Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Wed, 26 Dec 2012 11:14:05 -0500 Subject: [PATCH 034/998] addBack(): Fix incorrect versioning --- entries/addBack.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/addBack.xml b/entries/addBack.xml index 921d9498..05056ac6 100644 --- a/entries/addBack.xml +++ b/entries/addBack.xml @@ -2,7 +2,7 @@ .addBack() - 1.6 + 1.8 A string containing a selector expression to match the current set of elements against. @@ -62,5 +62,5 @@ p, div { margin:5px; padding:5px; } ]]> - + From 0f4801b4aef99b7eb6bfa3306741cc6d5afe63cc Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 26 Dec 2012 11:22:02 -0500 Subject: [PATCH 035/998] Update scriptCharset desc. Closes #182 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index acaa4a16..404938b6 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -102,7 +102,7 @@ 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. - Only for requests with "jsonp" or "script" dataType and "GET" type. Forces the request to be interpreted as a certain charset. Only needed for charset differences between the remote and local content. + Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. From 26e137acf753c3756d9aadeeaa81824ce3457ca9 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 5 Jan 2013 19:25:37 -0500 Subject: [PATCH 036/998] $.getScript(): Use github url for jQuery Color plugin Fixes #202 --- entries/jQuery.getScript.xml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index 6b3ebbc4..ccacc716 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -85,13 +85,19 @@ $.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. Prepends all spans to the element with the ID "foo" - + From 3ea0ddca2311a755b71be4fec41705b6481f6b21 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 6 Jan 2013 13:16:39 -0500 Subject: [PATCH 038/998] Fix link to http://api.jquery.com/map/ Closes #203 --- entries/jQuery.map.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 9f83e9ee..2b533b24 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -21,7 +21,7 @@ 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.

+

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.

@@ -47,7 +47,7 @@ $.map( realArray, function(val, i) {
     
   
   
-    A couple examples of using .map()
+    Use $.map() to change the values of an array.
     
   
   
-    Maps the original array to a new one and adds 1 to each value if it is bigger then zero, otherwise it's removed.
+    Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not.
      0 ? n + 1 : null;
 });]]>
@@ -101,15 +101,15 @@ var dimensions = { width: 10, height: 15, length: 20 };
 dimensions = $.map( dimensions, function( value, index ) {
   return value * 2;
 }); ]]>
-    
+    
   
   
     Map an object's keys to an array.
     
+var dimensions = { width: 10, height: 15, length: 20 };
+var keys = $.map( dimensions, function( value, key ) {
+  return key;
+}); ]]>
     
   
   
@@ -121,7 +121,7 @@ $.map( [0,1,2,3], function (a) {
     
   
   
-    Remove items by returning null from the function. This removes any numbers less than 50, and the rest are decreased by 45.
+    Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest.
      50 ? a - 45 : null);
@@ -129,7 +129,7 @@ $.map( [0, 1, 52, 97], function (a) {
     
   
   
-    Augmenting the resulting array by returning an array inside the function.
+    Augment the resulting array by returning an array inside the function.
     
Date: Sun, 6 Jan 2013 14:50:19 -0500
Subject: [PATCH 039/998] Remove  from examples because they were escaped.

---
 entries/jQuery.get.xml       |  8 ++++----
 entries/jQuery.getJSON.xml   |  8 ++++----
 entries/jQuery.getScript.xml |  4 ++--
 entries/jQuery.post.xml      | 10 +++++-----
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
index fdae7303..ac11e1fc 100644
--- a/entries/jQuery.get.xml
+++ b/entries/jQuery.get.xml
@@ -20,10 +20,10 @@
   
     

This is a shorthand Ajax function, which is equivalent to:

$.ajax({
-  url: url,
-  data: data,
-  success: success,
-  dataType: dataType
+  url: url,
+  data: data,
+  success: success,
+  dataType: dataType
 });
 

The success callback function is passed the returned data, which will be an XML root element, text string, JavaScript file, or JSON object, depending on the MIME type of the response. It is also passed the text status of the response.

diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 9c7858d8..30f11c4a 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -17,10 +17,10 @@

This is a shorthand Ajax function, which is equivalent to:

$.ajax({
-  url: url,
-  dataType: 'json',
-  data: data,
-  success: callback
+  dataType: "json",
+  url: url,
+  data: data,
+  success: success
 });
 

Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is a plain object, it is converted to a string and url-encoded before it is appended to the URL.

diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index ccacc716..0e306da2 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -14,9 +14,9 @@

This is a shorthand Ajax function, which is equivalent to:

$.ajax({
-  url: url,
+  url: url,
   dataType: "script",
-  success: success
+  success: success
 });
 

The script is executed in the global context, so it can refer to other variables and use jQuery functions. Included scripts can have some impact on the current page.

diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 3ceadfc3..39552374 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -20,11 +20,11 @@

This is a shorthand Ajax function, which is equivalent to:

$.ajax({
-  type: 'POST',
-  url: url,
-  data: data,
-  success: success,
-  dataType: dataType
+  type: "POST",
+  url: url,
+  data: data,
+  success: success,
+  dataType: dataType
 });
 

The success callback function is passed the returned data, which will be an XML root element or a text string depending on the MIME type of the response. It is also passed the text status of the response.

From d7240b81a1e648d18a301a770db6a474fb2dd870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 7 Jan 2013 17:13:05 -0500 Subject: [PATCH 040/998] Upgrade to grunt-jquery-content 0.8.1. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbd7a90b..13358fa8 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.x", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.5", - "grunt-jquery-content": "0.7.0", + "grunt-jquery-content": "0.8.1", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From a7f305fbaaae69fca654384426c0f331dfe0d0b0 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 8 Jan 2013 09:43:02 -0500 Subject: [PATCH 041/998] Add events.js to /resources/ and update script reference in key* entries Closes #208 --- entries/keydown.xml | 2 +- entries/keypress.xml | 4 ++-- entries/keyup.xml | 2 +- resources/events.js | 31 +++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 resources/events.js diff --git a/entries/keydown.xml b/entries/keydown.xml index d5323211..baf6e63e 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -87,7 +87,7 @@ input { display: block; margin-bottom: .25em; } -]]> +]]>
diff --git a/entries/keypress.xml b/entries/keypress.xml index 44c5810c..a57ff7ce 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -52,7 +52,7 @@

Note that keydown and keyup provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. An uppercase "A" is reported as 65 by all events. Because of this distinction, when catching special keystrokes such as arrow keys, .keydown() or .keyup() is a better choice.

- Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (http://api.jquery.com/scripts/events.js) for the event object's output. + Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (http://api.jquery.com/resources/events.js) for the event object's output. diff --git a/entries/keyup.xml b/entries/keyup.xml index a321d650..ff96d869 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -89,7 +89,7 @@ input { display: block; margin-bottom: .25em; } -]]> +]]> diff --git a/resources/events.js b/resources/events.js new file mode 100644 index 00000000..e00efb36 --- /dev/null +++ b/resources/events.js @@ -0,0 +1,31 @@ +jQuery.print = function(message, insertionType) { + 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'); + + if ($output.length === 0) { + $output = $('

The success callback function is passed the returned data, which will be an XML root element, text string, JavaScript file, or JSON object, depending on the MIME type of the response. It is also passed the text status of the response.

-

As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the (j)XHR and textStatus parameters passed to the success callback are undefined.

+

As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

Most implementations will specify a success handler:

$.get('ajax/test.html', function(data) {
   $('.result').html(data);
@@ -36,21 +36,24 @@
 

This example fetches the requested HTML snippet and inserts it on the page.

The jqXHR Object

-

As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). For convenience and consistency with the callback names used by $.ajax(), it provides .error(), .success(), and .complete() methods. These methods take a function argument that is called when the request terminates, and the function receives the same arguments as the correspondingly-named $.ajax() callback.

-

The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.get(), to chain multiple .success(), .complete(), and .error() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

+

As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

+

The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

// Assign handlers immediately after making the request,
-  // and remember the jqxhr object for this request
-  var jqxhr = $.get("example.php", function() {
-    alert("success");
-  })
-  .success(function() { alert("second success"); })
-  .error(function() { alert("error"); })
-  .complete(function() { alert("complete"); });
+// and remember the jqxhr object for this request
+var jqxhr = $.get("example.php", function() {
+  alert("success");
+})
+.done(function() { alert("second success"); })
+.fail(function() { alert("error"); })
+.always(function() { alert("finished"); });
 
-  // perform other work here ...
+// perform other work here ...
 
-  // Set another completion function for the request above
-  jqxhr.complete(function(){ alert("second complete"); });
+// Set another completion function for the request above +jqxhr.always(function(){ alert("second finished"); }); +
+

Deprecation Notice

+

The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

@@ -64,26 +67,26 @@ - pass arrays of data to the server (while still ignoring the return results). + Pass arrays of data to the server (while still ignoring the return results). - Alert out the results from requesting test.php (HTML or XML, depending on what was returned). - - Alert out the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). - + Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). + - Gets the test.php page contents, which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>), and adds it to the page. + Get the test.php page contents, which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>), and add it to the page. diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 39552374..785b762c 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -28,7 +28,7 @@ });

The success callback function is passed the returned data, which will be an XML root element or a text string depending on the MIME type of the response. It is also passed the text status of the response.

-

As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object).

+

As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object).

Most implementations will specify a success handler:

$.post('ajax/test.html', function(data) {
   $('.result').html(data);
@@ -37,22 +37,25 @@
     

This example fetches the requested HTML snippet and inserts it on the page.

Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

The jqXHR Object

-

As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.post() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). For convenience and consistency with the callback names used by $.ajax(), it provides .error(), .success(), and .complete() methods. These methods take a function argument that is called when the request terminates, and the function receives the same arguments as the correspondingly-named $.ajax() callback.

-

The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.post(), to chain multiple .success(), .complete(), and .error() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

+

As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

+

The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

// Assign handlers immediately after making the request,
-    // and remember the jqxhr object for this request
-    var jqxhr = $.post("example.php", function() {
-      alert("success");
-    })
-    .success(function() { alert("second success"); })
-    .error(function() { alert("error"); })
-    .complete(function() { alert("complete"); });
+// and remember the jqxhr object for this request
+var jqxhr = $.post("example.php", function() {
+  alert("success");
+})
+.done(function() { alert("second success"); })
+.fail(function() { alert("error"); })
+.always(function() { alert("finished"); });
 
-    // perform other work here ...
+// perform other work here ...
 
-    // Set another completion function for the request above
-    jqxhr.complete(function(){ alert("second complete"); });
-  
+// Set another completion function for the request above +jqxhr.always(function(){ alert("second finished"); }); +
+ +

Deprecation Notice

+

The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

@@ -65,37 +68,29 @@ - pass arrays of data to the server (while still ignoring the return results). + Pass arrays of data to the server (while still ignoring the return results). - send form data using ajax requests + Send form data using ajax requests - Alert out the results from requesting test.php (HTML or XML, depending on what was returned). + Alert the results from requesting test.php (HTML or XML, depending on what was returned). - Alert out the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). - - - - Gets the test.php page content, store it in a XMLHttpResponse object and applies the process() JavaScript function. - + Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). + - Posts to the test.php page and gets contents which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). + Post to the test.php page and get content which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). - - callbacks.locked() + + callbacks.disabled() 1.7 From 28eb9653ffb251c08cbe124dacd570c9348d9126 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 23 Jan 2013 19:40:02 -0500 Subject: [PATCH 068/998] replaceAll(): Remove comment to fix example. Closes #231 --- entries/replaceAll.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/replaceAll.xml b/entries/replaceAll.xml index c01365c7..ae1f1052 100644 --- a/entries/replaceAll.xml +++ b/entries/replaceAll.xml @@ -34,11 +34,11 @@ Replace all the paragraphs with bold words. - + - \ No newline at end of file + From 0faee1c3630b9e97aeb8a54cc059a596ac3f73ab Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Thu, 24 Jan 2013 09:24:03 -0600 Subject: [PATCH 069/998] 1.9.0-6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13358fa8..75950751 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": "1.7.2", + "version": "1.9.0-6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 6c679d5378aac3df339277e22e3320d2425f1c84 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 6 Feb 2013 10:44:51 -0600 Subject: [PATCH 070/998] unwrap: Remove deprecated use of .toggle( fn, fn ) - Fixes gh-248 --- entries/unwrap.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/entries/unwrap.xml b/entries/unwrap.xml index 0b3130d8..28e2ae94 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -11,10 +11,13 @@ Wrap/unwrap a div around each of the paragraphs. nodes) --- entries/after.xml | 11 +++++++++-- entries/append.xml | 11 +++++++++-- entries/appendTo.xml | 6 +++++- entries/attr.xml | 4 +++- entries/before.xml | 11 +++++++++-- entries/callbacks.add.xml | 4 +++- entries/callbacks.remove.xml | 4 +++- entries/css.xml | 4 +++- entries/fadeTo.xml | 8 ++++++-- entries/height.xml | 4 +++- entries/html.xml | 2 +- entries/index.xml | 6 ++++-- entries/insertAfter.xml | 6 +++++- entries/insertBefore.xml | 6 +++++- entries/jQuery.ajax.xml | 19 +++++++++++++------ entries/jQuery.get.xml | 4 +++- entries/jQuery.map.xml | 4 +++- entries/jQuery.param.xml | 28 ++++++++++++++++------------ entries/jQuery.post.xml | 4 +++- entries/jQuery.xml | 8 +++++--- entries/load.xml | 4 +++- entries/prepend.xml | 10 ++++++++-- entries/prependTo.xml | 6 +++++- entries/prop.xml | 5 ++++- entries/removeData.xml | 6 ++++-- entries/replaceWith.xml | 5 ++++- entries/trigger.xml | 4 +++- entries/val.xml | 4 +++- entries/width.xml | 4 +++- entries/wrap.xml | 8 ++++++-- entries/wrapAll.xml | 10 +++++++--- pages/Ajax_Events.html | 2 +- 32 files changed, 162 insertions(+), 60 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index e95897a0..b3fefeb0 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -3,11 +3,18 @@ .after() 1.0 - + HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements. + + + - + One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + + + + diff --git a/entries/append.xml b/entries/append.xml index 3e92f1d4..5f5aa08b 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -3,11 +3,18 @@ .append() 1.0 - + DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + + + - + One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + + + + diff --git a/entries/appendTo.xml b/entries/appendTo.xml index 97f1a041..9f79120c 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -3,8 +3,12 @@ .appendTo() 1.0 - + A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + + + + Insert every element in the set of matched elements to the end of the target. diff --git a/entries/attr.xml b/entries/attr.xml index 3d8c72a4..5d5f2286 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -52,7 +52,9 @@ var title = $("em").attr("title"); The name of the attribute to set. - + + + A value to set for the attribute. diff --git a/entries/before.xml b/entries/before.xml index 6484b3b5..2f1f8bdf 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -3,11 +3,18 @@ .before() 1.0 - + HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements. + + + - + One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + + + + diff --git a/entries/callbacks.add.xml b/entries/callbacks.add.xml index feb829f1..97188e81 100644 --- a/entries/callbacks.add.xml +++ b/entries/callbacks.add.xml @@ -3,8 +3,10 @@ callbacks.add() 1.7 - + A function, or array of functions, that are to be added to the callback list. + + Add a callback or a collection of callbacks to a callback list. diff --git a/entries/callbacks.remove.xml b/entries/callbacks.remove.xml index 9133c712..a6fbb876 100644 --- a/entries/callbacks.remove.xml +++ b/entries/callbacks.remove.xml @@ -3,8 +3,10 @@ callbacks.remove() 1.7 - + A function, or array of functions, that are to be removed from the callback list. + + Remove a callback or a collection of callbacks from a callback list. diff --git a/entries/css.xml b/entries/css.xml index e828aac1..6af3cdaf 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -86,8 +86,10 @@ div { height: 50px; margin: 5px; padding: 5px; float: left; } A CSS property name. - + A value to set for the property. + + diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml index e5594ff3..3f5c010e 100644 --- a/entries/fadeTo.xml +++ b/entries/fadeTo.xml @@ -4,8 +4,10 @@ Adjust the opacity of the matched elements. 1.0 - + A string or number determining how long the animation will run. + + A number between 0 and 1 denoting the target opacity. @@ -16,8 +18,10 @@ 1.4.3 - + A string or number determining how long the animation will run. + + A number between 0 and 1 denoting the target opacity. diff --git a/entries/height.xml b/entries/height.xml index a939626f..5f164d20 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -62,8 +62,10 @@ $(document).height(); // returns height of HTML document
1.0 - + An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + + diff --git a/entries/html.xml b/entries/html.xml index 82b54ad1..43b68a3e 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -51,7 +51,7 @@ $("p").click(function () { 1.0 - + A string of HTML to set as the content of each matched element. diff --git a/entries/index.xml b/entries/index.xml index 416253c8..acde75f6 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -12,8 +12,10 @@ 1.0 - + The DOM element or first element within the jQuery object to look for. + + Search for a given element from among the matched elements. @@ -155,4 +157,4 @@ $('div').html('Index: ' + foobar);]]> - \ No newline at end of file + diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml index db3c3830..43e9432a 100644 --- a/entries/insertAfter.xml +++ b/entries/insertAfter.xml @@ -3,8 +3,12 @@ .insertAfter() 1.0 - + A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + + + + Insert every element in the set of matched elements after the target. diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml index a4318626..da86ce08 100644 --- a/entries/insertBefore.xml +++ b/entries/insertBefore.xml @@ -3,8 +3,12 @@ .insertBefore() 1.0 - + A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + + + + Insert every element in the set of matched elements before the target. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 404938b6..e85bd5b0 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -40,7 +40,7 @@ When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it'll always be sent to the server (even if no data is sent). If no charset is specified, data will be transmitted to the server using the server's default charset; you must decode this appropriately on the server side. - + This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
$.ajax({
   url: "test.html",
   context: document.body
@@ -54,11 +54,13 @@
       
         If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain.
       
-      
+      
+        
+        
         Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
       
       
-        
+        
         
         
         A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
@@ -89,7 +91,9 @@
       
         Override the callback function name in a jsonp request.  This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url.  So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
       
-      
+      
+        
+        
         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. 
       
       
@@ -118,7 +122,7 @@
         
       
       
-        
+        
         
         
         A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
@@ -235,11 +239,14 @@ jqxhr.always(function() { alert("second complete"); });
  • getResponseHeader()
  • +
  • + statusCode() +
  • abort()
  • -

    No onreadystatechange mechanism is provided, however, since success, error, complete and statusCode cover all conceivable requirements.

    +

    No onreadystatechange mechanism is provided, however, since done, fail, always, and statusCode cover all conceivable requirements.

    Callback Function Queues

    The beforeSend, error, dataFilter, success and complete options all accept callback functions that are invoked at the appropriate times.

    As of jQuery 1.5, the fail and done, and, as of jQuery 1.6, always callback hooks are first-in, first-out managed queues, allowing for more than one callback for each hook. See Deferred object methods, which are implemented internally for these $.ajax() callback hooks.

    diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 7bd15331..368157e0 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -6,7 +6,9 @@ A string containing the URL to which the request is sent. - + + + A plain object or string that is sent to the server with the request. diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 2b533b24..7d374c38 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -12,7 +12,9 @@ 1.6 - + + + The Array or Object to translate. diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 26f0eac0..9914cbb5 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -3,13 +3,17 @@ jQuery.param() 1.2 - + + + An array or object to serialize. 1.4 - + + + An array or object to serialize. @@ -35,10 +39,10 @@

    We can display a query string representation of an object and a URI-decoded version of the same as follows:

    var myObject = {
       a: {
    -    one: 1, 
    -    two: 2, 
    +    one: 1,
    +    two: 2,
         three: 3
    -  }, 
    +  },
       b: [1,2,3]
     };
     var recursiveEncoded = $.param(myObject);
    @@ -56,10 +60,10 @@ alert(recursiveDecoded);
         

    To emulate the behavior of $.param() prior to jQuery 1.4, we can set the traditional argument to true:

    var myObject = {
       a: {
    -    one: 1, 
    -    two: 2, 
    +    one: 1,
    +    two: 2,
         three: 3
    -  }, 
    +  },
       b: [1,2,3]
     };
     var shallowEncoded = $.param(myObject, true);
    @@ -89,14 +93,14 @@ alert(shallowDecoded);
       
         Serialize a few complex objects
         =1.4:
     $.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4"
     
    -// <=1.3.2: 
    +// <=1.3.2:
     $.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a=[object+Object]&d=3&d=4&d=[object+Object]"
    -// >=1.4: 
    +// >=1.4:
     $.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
     
     ]]>
    @@ -107,4 +111,4 @@ $.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2]
       
       
       
    -
    \ No newline at end of file
    +
    diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
    index 785b762c..85268523 100644
    --- a/entries/jQuery.post.xml
    +++ b/entries/jQuery.post.xml
    @@ -6,7 +6,9 @@
         
           A string containing the URL to which the request is sent.
         
    -    
    +    
    +      
    +      
           A plain object or string that is sent to the server with the request.
         
         
    diff --git a/entries/jQuery.xml b/entries/jQuery.xml
    index 35f3649e..c9f0375e 100644
    --- a/entries/jQuery.xml
    +++ b/entries/jQuery.xml
    @@ -8,7 +8,9 @@
           
             A string containing a selector expression
           
    -      
    +      
    +        
    +        
             A DOM Element, Document, or jQuery to use as context
           
         
    @@ -138,7 +140,7 @@ $( "div > p").css("border", "1px solid gray");
       
         
           1.0
    -      
    +      
             A string of HTML to create on the fly. Note that this parses HTML, not XML.
           
           
    @@ -147,7 +149,7 @@ $( "div > p").css("border", "1px solid gray");
         
         
           1.4
    -      
    +      
             A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
           
           
    diff --git a/entries/load.xml b/entries/load.xml
    index 6e83173c..6a0d718d 100644
    --- a/entries/load.xml
    +++ b/entries/load.xml
    @@ -6,7 +6,9 @@
         
           A string containing the URL to which the request is sent.
         
    -    
    +    
    +      
    +      
           A plain object or string that is sent to the server with the request.
         
         
    diff --git a/entries/prepend.xml b/entries/prepend.xml
    index 93dbe108..e8fc0aa5 100644
    --- a/entries/prepend.xml
    +++ b/entries/prepend.xml
    @@ -3,10 +3,16 @@
       .prepend()
       
         1.0
    -    
    +    
           DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
    +      
    +      
    +      
         
    -    
    +    
    +      
    +      
    +      
           One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
         
       
    diff --git a/entries/prependTo.xml b/entries/prependTo.xml
    index 59664af7..cb24ffc1 100644
    --- a/entries/prependTo.xml
    +++ b/entries/prependTo.xml
    @@ -3,7 +3,11 @@
       .prependTo()
       
         1.0
    -    
    +    
    +      
    +      
    +      
    +      
           A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
         
       
    diff --git a/entries/prop.xml b/entries/prop.xml
    index 95a20e70..c93d8018 100644
    --- a/entries/prop.xml
    +++ b/entries/prop.xml
    @@ -102,7 +102,10 @@ $("input").change(function() {
           
             The name of the property to set.
           
    -      
    +      
    +        
    +        
    +        
             A value to set for the property.
           
         
    diff --git a/entries/removeData.xml b/entries/removeData.xml
    index b68fce81..2b9ca409 100644
    --- a/entries/removeData.xml
    +++ b/entries/removeData.xml
    @@ -9,8 +9,10 @@
       
       
         1.7
    -    
    +    
           An array or space-separated string naming the pieces of data to delete.
    +      
    +      
         
       
       Remove a previously-stored piece of data.
    @@ -47,4 +49,4 @@
       
       
       
    -
    \ No newline at end of file
    +
    diff --git a/entries/replaceWith.xml b/entries/replaceWith.xml
    index dca205d6..1d33ecd6 100644
    --- a/entries/replaceWith.xml
    +++ b/entries/replaceWith.xml
    @@ -3,8 +3,11 @@
       .replaceWith()
       
         1.2
    -    
    +    
           The content to insert. May be an HTML string, DOM element, or jQuery object.
    +      
    +      
    +      
         
       
       
    diff --git a/entries/trigger.xml b/entries/trigger.xml
    index 3697a413..11aedd2f 100644
    --- a/entries/trigger.xml
    +++ b/entries/trigger.xml
    @@ -7,7 +7,9 @@
         
           A string containing a JavaScript event type, such as click or submit.
         
    -    
    +    
    +      
    +      
           Additional parameters to pass along to the event handler.
         
       
    diff --git a/entries/val.xml b/entries/val.xml
    index 0e18907e..7e4f33ea 100644
    --- a/entries/val.xml
    +++ b/entries/val.xml
    @@ -83,7 +83,9 @@ $.valHooks.textarea = {
       
         
           1.0
    -      
    +      
    +        
    +        
             A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
           
         
    diff --git a/entries/width.xml b/entries/width.xml
    index 015abdf0..0f9d71c0 100644
    --- a/entries/width.xml
    +++ b/entries/width.xml
    @@ -59,7 +59,9 @@ $("#getw").click(function () {
       
         
           1.0
    -      
    +      
    +        
    +        
             An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
           
         
    diff --git a/entries/wrap.xml b/entries/wrap.xml
    index 88f8569a..4db0e15a 100644
    --- a/entries/wrap.xml
    +++ b/entries/wrap.xml
    @@ -3,8 +3,12 @@
       .wrap()
       
         1.0
    -    
    -      An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
    +    
    +      
    +      
    +      
    +      
    +      A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
         
       
       
    diff --git a/entries/wrapAll.xml b/entries/wrapAll.xml
    index cf5bd2b9..20b22446 100644
    --- a/entries/wrapAll.xml
    +++ b/entries/wrapAll.xml
    @@ -3,8 +3,12 @@
       .wrapAll()
       
         1.2
    -    
    -      An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
    +    
    +      
    +      
    +      
    +      
    +      A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
         
       
       Wrap an HTML structure around all elements in the set of matched elements.
    @@ -79,4 +83,4 @@
       
       
       
    -
    \ No newline at end of file
    +
    diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html
    index 04b8f0b8..272fdf42 100644
    --- a/pages/Ajax_Events.html
    +++ b/pages/Ajax_Events.html
    @@ -5,7 +5,7 @@
     
     

    Ajax requests produce a number of different events that you can subscribe to. Here's a full list of the events and in what order they are broadcast.

    There are two types of events:

    -

    Local Events

    +

    Local Events

    These are callbacks that you can subscribe to within the Ajax request object, like so:

     $.ajax({
        beforeSend: function(){
    
    From 4a65ca932e4babd86b9d3c0b3e0c7e87f527ceaa Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Sun, 10 Feb 2013 17:31:38 -0500
    Subject: [PATCH 072/998] Update Types page with htmlString and fixed hrefs
    
    ---
     pages/Types.html | 77 +++++++++++++++++++++++++++++-------------------
     1 file changed, 47 insertions(+), 30 deletions(-)
    
    diff --git a/pages/Types.html b/pages/Types.html
    index 0fa8559d..aaaec944 100644
    --- a/pages/Types.html
    +++ b/pages/Types.html
    @@ -43,6 +43,7 @@
           
  • Boolean Default
  • +
  • htmlString
  • Number
    • Boolean Default
    • @@ -93,24 +94,24 @@

      String

      +

      A string in JavaScript is an immutable object that contains none, one or many characters. +

      "I'm a String in JavaScript!"
       'So am I!'
       
      -

      A string in JavaScript is an immutable object that contains none, one or many characters. -

      The type of a string is "string".

      typeof "some string"; // "string"
       

      Quoting

      -

      A string can be defined using single or double quotes. You can nest single quotes inside of double quotes, and the other way round. To mix double quotes with double quotes, the nested ones have to be escaped with a backslash. +

      A string can be defined using single or double quotes. You can nest single quotes inside of double quotes, and the other way around. To mix double quotes with double quotes (or single with single), the nested ones have to be escaped with a backslash.

      "You make 'me' sad."
      -'Holy "cranking" moses!'
      +'That\'s "cranking" good fun!'
       "<a href=\"home\">Home</a>"
       

      Built-in Methods

      -

      A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array. +

      A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array.

      "hello".charAt( 0 ) // "h"
       "hello".toUpperCase() // "HELLO"
      @@ -133,12 +134,31 @@ 

      Boolean Default

      !"true" // false !new Boolean( false ) // false
      + +

      htmlString

      +

      A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed as such until the final > character.

      +

      For explicit parsing of a string to HTML, the $.parseHTML() method is available as of jQuery 1.8.

      +
      // Appends hello:
      +$( "hello" ).appendTo( "body" );
      +
      +// Appends hello:
      +$( "hellobye" ).appendTo( "body" );
      +
      +// Syntax error, unrecognized expression: byehello
      +$( "byehello" ).appendTo( "body" );
      +
      +// Appends byehello:
      +$( $.parseHTML( "byehello" ) ).appendTo( "body" );
      +
      +// Appends hellowaitbye:
      +$( "hellowaitbye" ).appendTo( "body" );
      +

      Number

      +

      Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable, just as strings. All operators common in c-based languages are available to work with numbers (+, -, *, /, %, =, +=, -=, *=, /=, ++, --). +

      12
       3.543
       
      -

      Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable, just as strings. All operators common in c-based languages are available to work with numbers (+, -, *, /, %, =, +=, -=, *=, /=, ++, --). -

      The type of a number is "number".

      typeof 12 // "number"
      @@ -259,8 +279,6 @@ 

      Array Notation

      Iteration

      Iterating over objects is easy with the for-in-loop:

      -


      -

      var obj = {
         name: "Pete",
         age: 15
      @@ -271,16 +289,15 @@ 

      Iteration

      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: +

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

      jQuery.each( obj, function( key, value ) {
         console.log( "key", key, "value", value );
       });
       
      -

      The drawback is that the callback is called in the context of each value, therefore you lose the context of your own object if applicable. More on this below at Functions. -

      -


      +

      The drawback is that the callback is called in the context of each value and you therefore lose the context of your own object if applicable. More on this below at Functions.

      +

      Boolean default

      An object, no matter if it has properties or not, never defaults to false:

      @@ -288,22 +305,24 @@

      Boolean default

      !!{} // true

      Prototype

      -

      All objects have a prototype property. Whenever the interpreter looks for a property, it also checks the prototype. jQuery uses that extensively to add methods to jQuery instances. +

      All objects have a prototype property. Whenever the interpreter looks for a property, it also checks in the object's prototype if the property is not found on the object itself. jQuery uses the prototype extensively to add methods to jQuery instances. Internally, jQuery makes jQuery.fn an alias of jQuery.prototype so you can use either one (though plugin developers have standardized on fn).

      var form = $("#myform");
      -form.clearForm; // undefined
      -form.fn.clearForm = function() {
      +console.log( form.clearForm ); // undefined
      +
      +// jQuery.fn == jQuery.prototype
      +jQuery.fn.clearForm = function() {
         return this.find( ":input" ).each(function() {
           this.value = "";
         }).end();
       };
      -form.clearForm() // works for all instances of jQuery objects, because the new method was added to the prototype
      +
      +// works for all instances of jQuery objects, because
      +// the new method was added to the prototype
      +console.log( form.clearForm ); // function
      +form.clearForm();
       
      -


      -(This example needs clarification: how does it modify the prototype when the word "prototype" doesn't appear anywhere? The implication is that form.fn is simply an alias for form.prototype, but if that's the case then it should be explained. :-?) -

      -

      In javascript:the definitive guide 5 edition,dont add attibute to Object.prototype -

      +

      Array

      Arrays in JavaScript are mutable lists with a few built-in methods. You can define arrays using the array literal:

      @@ -339,14 +358,14 @@

      Iteration

      // Do something with item }
  • -

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

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

    var x = [ 1, 2, 3 ];
     jQuery.each( x, function( index, value ) {
       console.log( "index", index, "value", value );
     });
     
    -

    The drawback is that the callback is called in the context of each value, therefore you lose the context of your own object if applicable. More on this below at Functions. +

    The drawback is that the callback is called in the context of each value and you therefore lose the context of your own object if applicable. More on this below at Functions.

    The length property can also be used to add elements to the end of an array. That is equivalent to using the push-method:

    @@ -521,11 +540,9 @@

    Callback


    Selector

    -

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be a XML document received via AJAX. -

    -

    The selectors are a composition of CSS and custom additions. XPath selectors are available as a plugin. +

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via AJAX.

    -

    All selectors available in jQuery are documented on the Selectors API page. +

    The selectors are a composition of CSS and custom additions. All selectors available in jQuery are documented on the Selectors API page.

    There are lot of plugins that leverage jQuery's selectors in other ways. The validation plugin accepts a selector to specify a dependency, whether an input is required or not:

    @@ -591,10 +608,10 @@

    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

    Deferred Object

    -

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function. +

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

    Promise Object

    -

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred. +

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred.

    Callbacks Object

    A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

    From 547334b04cc4314b6b57f3a8a5ccd254c503d46b Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 10 Feb 2013 17:34:38 -0500 Subject: [PATCH 073/998] 1.9.0-7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75950751..94abaf82 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": "1.9.0-6", + "version": "1.9.0-7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 0ff4f8019818fc26e795b37c865d22dadc60f3c6 Mon Sep 17 00:00:00 2001 From: Cyril Date: Sun, 10 Feb 2013 22:18:07 -0500 Subject: [PATCH 074/998] replace uses of .bind/.unbind with prefered .on/.off --- entries/blur.xml | 2 +- entries/change.xml | 2 +- entries/click.xml | 8 ++++---- entries/closest.xml | 4 ++-- entries/dblclick.xml | 2 +- entries/deferred.done.xml | 2 +- entries/die.xml | 4 ++-- entries/error.xml | 2 +- entries/event.namespace.xml | 2 +- entries/event.pageX.xml | 2 +- entries/event.pageY.xml | 2 +- entries/event.which.xml | 4 ++-- entries/focus.xml | 2 +- entries/focusin.xml | 2 +- entries/focusout.xml | 2 +- entries/hover.xml | 4 ++-- entries/jQuery.proxy.xml | 2 +- entries/jQuery.sub.xml | 2 +- entries/jQuery.xml | 4 ++-- entries/keydown.xml | 2 +- entries/keypress.xml | 2 +- entries/keyup.xml | 2 +- entries/live.xml | 2 +- entries/load-event.xml | 2 +- entries/mousedown.xml | 2 +- entries/mouseenter.xml | 2 +- entries/mouseleave.xml | 2 +- entries/mousemove.xml | 2 +- entries/mouseout.xml | 6 +++--- entries/mouseover.xml | 2 +- entries/mouseup.xml | 2 +- entries/one.xml | 6 +++--- entries/promise.xml | 4 ++-- entries/ready.xml | 2 +- entries/replaceWith.xml | 2 +- entries/resize.xml | 2 +- entries/scroll.xml | 2 +- entries/select.xml | 2 +- entries/submit.xml | 2 +- entries/toggleClass.xml | 4 ++-- entries/unload.xml | 2 +- entries/val.xml | 2 +- 42 files changed, 56 insertions(+), 56 deletions(-) diff --git a/entries/blur.xml b/entries/blur.xml index eb565a23..a5a8eb6d 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -21,7 +21,7 @@ 1.0 -

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

    +

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

    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:

    <form>
    diff --git a/entries/change.xml b/entries/change.xml
    index 9b53671f..37b9d361 100644
    --- a/entries/change.xml
    +++ b/entries/change.xml
    @@ -21,7 +21,7 @@
         1.0
       
       
    -    

    This method is a shortcut for .bind('change', handler) in the first two variations, and .trigger('change') in the third.

    +

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

    The change event is sent to an element when its value changes. This event is limited to <input> elements, <textarea> boxes and <select> elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.

    For example, consider the HTML:

    <form>
    diff --git a/entries/click.xml b/entries/click.xml
    index c37d5531..bc7ff79e 100644
    --- a/entries/click.xml
    +++ b/entries/click.xml
    @@ -21,10 +21,10 @@
         1.0
       
       
    -    

    In the first two variations, this method is a shortcut for .bind("click", handler), as well as for .on("click", handler) as of jQuery 1.7. In the third variation, when .click() is called without arguments, it is a shortcut for .trigger("click").

    -

    The click event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed and released. Any HTML element can receive this event.

    -
    For example, consider the HTML:
    -<div id="target">
    +    

    This method is a shortcut for .on('click', handler) in the first two variations, and .trigger('click') in the third. + The click event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed and released. Any HTML element can receive this event. + For example, consider the HTML:

    +
    <div id="target">
       Click here
     </div>
     <div id="other">
    diff --git a/entries/closest.xml b/entries/closest.xml
    index 6e7531c5..da43786b 100644
    --- a/entries/closest.xml
    +++ b/entries/closest.xml
    @@ -101,7 +101,7 @@ $('li.item-a').closest('#one', listItemII)
         
           Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked.
           
    @@ -118,7 +118,7 @@ $('li.item-a').closest('#one', listItemII)
           Pass a jQuery object to closest. The closest list element toggles a yellow background when it or its descendent is clicked.
           
    diff --git a/entries/dblclick.xml b/entries/dblclick.xml
    index 0f57c09b..c0c05a1a 100644
    --- a/entries/dblclick.xml
    +++ b/entries/dblclick.xml
    @@ -21,7 +21,7 @@
         1.0
       
       
    -    

    This method is a shortcut for .bind('dblclick', handler) in the first two variations, and .trigger('dblclick') in the third. +

    This method is a shortcut for .on('dblclick', handler) in the first two variations, and .trigger('dblclick') in the third. The dblclick event is sent to an element when the element is double-clicked. Any HTML element can receive this event. For example, consider the HTML:

    <div id="target">
    diff --git a/entries/deferred.done.xml b/entries/deferred.done.xml
    index e4db4417..9592c8ba 100644
    --- a/entries/deferred.done.xml
    +++ b/entries/deferred.done.xml
    @@ -53,7 +53,7 @@ dfd
     });
     
     /* resolve the Deferred object when the button is clicked */
    -$("button").bind("click", function() {
    +$("button").on("click", function() {
       dfd.resolve("and");
     });
     ]]>
    diff --git a/entries/die.xml b/entries/die.xml
    index ca0fbfa2..f0f6e6d5 100644
    --- a/entries/die.xml
    +++ b/entries/die.xml
    @@ -21,8 +21,8 @@
         
       
       
    -    

    Any handler that has been attached with .live() can be removed with .die(). This method is analogous to calling .unbind() with no arguments, which is used to remove all handlers attached with .bind(). - See the discussions of .live() and .unbind() for further details.

    +

    Any handler that has been attached with .live() can be removed with .die(). This method is analogous to calling .off() with no arguments, which is used to remove all handlers attached with .on(). + See the discussions of .live() and .off() for further details.

    If used without an argument, .die() removes all event handlers previously attached using .live() from the elements.

    As of jQuery 1.7, use of .die() (and its complementary method, .live()) is not recommended. Instead, use .off() to remove event handlers bound with .on()

    Note: In order for .die() to function correctly, the selector used with it must match exactly the selector initially used with .live().

    diff --git a/entries/error.xml b/entries/error.xml index 69ae2ab1..a1477172 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -18,7 +18,7 @@ -

    This method is a shortcut for .bind('error', handler).

    +

    This method is a shortcut for .on('error', handler).

    The error event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly.

    For example, consider a page with a simple image element:

    <img alt="Book" id="book" />
    diff --git a/entries/event.namespace.xml b/entries/event.namespace.xml index bfb7cafd..096fd57a 100644 --- a/entries/event.namespace.xml +++ b/entries/event.namespace.xml @@ -11,7 +11,7 @@ Determine the event namespace used. - diff --git a/entries/event.pageY.xml b/entries/event.pageY.xml index 134cd552..a1aaf7b2 100644 --- a/entries/event.pageY.xml +++ b/entries/event.pageY.xml @@ -13,7 +13,7 @@ diff --git a/entries/event.which.xml b/entries/event.which.xml index e2d97e57..3926be56 100644 --- a/entries/event.which.xml +++ b/entries/event.which.xml @@ -11,7 +11,7 @@
    Log which key was depressed. - diff --git a/entries/focus.xml b/entries/focus.xml index 0de41899..208cc4aa 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -22,7 +22,7 @@
      -
    • This method is a shortcut for .bind('focus', handler) in the first and second variations, and .trigger('focus') in the third.
    • +
    • This method is a shortcut for .on('focus', handler) in the first and second variations, and .trigger('focus') in the third.
    • The focus event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
    • Elements with focus are usually highlighted in some way by the browser, for example with a dotted line surrounding the element. The focus is used to determine which element is the first to receive keyboard-related events.
    diff --git a/entries/focusin.xml b/entries/focusin.xml index a6841bd3..9b7f1133 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -18,7 +18,7 @@ -

    This method is a shortcut for .bind('focusin', handler).

    +

    This method is a shortcut for .on('focusin', handler).

    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.

    diff --git a/entries/focusout.xml b/entries/focusout.xml index 340aabc3..ea156acb 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -18,7 +18,7 @@ -

    This method is a shortcut for .bind('focusout', handler).

    +

    This method is a shortcut for .on('focusout', handler).

    The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

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

    diff --git a/entries/hover.xml b/entries/hover.xml index 076056f6..13e81c7e 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -61,7 +61,7 @@ $("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);}); To unbind the above example use: - + @@ -77,7 +77,7 @@ $("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});

    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).bind("mouseenter mouseleave", handlerInOut);
    +
    $(selector).on("mouseenter mouseleave", handlerInOut);

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

    diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index 1eae430f..03760189 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -69,7 +69,7 @@ var me = { /* With proxy, `this` refers to the me object encapsulating */ /* this function. */ $("#log").append( "Hello " + this.type + "
    " ); - $("#test").unbind("click", this.test); + $("#test").off("click", this.test); } }; diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index f4faa52f..c247e478 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -50,7 +50,7 @@ typeof jQuery('body').myCustomMethod // undefined]]>
    }); // A new remove event is now triggered from this copy of jQuery - $(document).bind("remove", function(e) { + $(document).on("remove", function(e) { $(e.target).parent().hide(); }); }); diff --git a/entries/jQuery.xml b/entries/jQuery.xml index c9f0375e..1b09927e 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -79,7 +79,7 @@ $.post( "url.xml", function(data) {

    Returning an Empty Set

    As of jQuery 1.4, calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). In previous versions of jQuery, this would return a set containing the document node.

    Working With Plain Objects

    -

    At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.bind(), .unbind(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

    +

    At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.on(), .off(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

    
     // define a plain object
     var foo = {foo: "bar", hello: "world"};
    @@ -99,7 +99,7 @@ $foo.data( "keyName", "someValue");
     console.log( $foo ); // will now contain a jQuery{randomNumber} property
     
     // test binding an event name and triggering
    -$foo.bind( "eventName", function () {
    +$foo.on( "eventName", function () {
       console.log("eventName was called");
     });
     
    diff --git a/entries/keydown.xml b/entries/keydown.xml
    index baf6e63e..0988808d 100644
    --- a/entries/keydown.xml
    +++ b/entries/keydown.xml
    @@ -21,7 +21,7 @@
       
       Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
       
    -    

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

    +

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

    The keydown event is sent to an element when the user first presses a key on the keyboard. 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:

    <form>
    diff --git a/entries/keypress.xml b/entries/keypress.xml
    index a57ff7ce..3a1f8a09 100644
    --- a/entries/keypress.xml
    +++ b/entries/keypress.xml
    @@ -22,7 +22,7 @@
       
       
         

    Note: as the keypress event isn't covered by any official specification, the actual behavior encountered when using it may differ across browsers, browser versions, and platforms.

    -

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

    +

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

    The keypress event is sent to an element when the browser registers keyboard input. This is similar to the keydown event, except in the case of key repeats. If the user presses and holds a key, a keydown event is triggered once, but separate keypress events are triggered for each inserted character. In addition, modifier keys (such as Shift) trigger keydown events but not keypress events.

    A keypress event handler 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:

    diff --git a/entries/keyup.xml b/entries/keyup.xml index ff96d869..92874d13 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -21,7 +21,7 @@ 1.0 -

    This method is a shortcut for .bind('keyup', handler) in the first two variations, and .trigger('keyup') in the third.

    +

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

    The keyup event is sent to an element when the user releases a key on the keyboard. 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:

    <form>
    diff --git a/entries/live.xml b/entries/live.xml
    index 1ac811eb..322fc9c5 100644
    --- a/entries/live.xml
    +++ b/entries/live.xml
    @@ -53,7 +53,7 @@ $(document).on("click", "a.offsite", function(){ alert("Goodbye!"); });        /
     
    1. Use natively clickable elements such as a or button, as both of these do bubble to document.
    2. Use .on() or .delegate() attached to an element below the level of document.body, since mobile iOS does bubble within the body.
    3. Apply the CSS style cursor:pointer to the element that needs to bubble clicks (or a parent including document.documentElement). Note however, this will disable copy\paste on the element and cause it to be highlighted when touched.
  • Calling event.stopPropagation() in the event handler is ineffective in stopping event handlers attached lower in the document; the event has already propagated to document.
  • -
  • The .live() method interacts with other event methods in ways that can be surprising, e.g., $(document).unbind("click") removes all click handlers attached by any call to .live()!
  • +
  • The .live() method interacts with other event methods in ways that can be surprising, e.g., $(document).off("click") removes all click handlers attached by any call to .live()!
  • For pages still using .live(), this list of version-specific differences may be helpful:

      diff --git a/entries/load-event.xml b/entries/load-event.xml index d29214a5..6128ccc2 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -18,7 +18,7 @@ -

      This method is a shortcut for .bind('load', handler).

      +

      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:

      <img src="book.png" alt="Book" id="book" />
      diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 9afe6bf3..68a4e086 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -21,7 +21,7 @@ 1.0 -

      This method is a shortcut for .bind('mousedown', handler) in the first variation, and .trigger('mousedown') in the second.

      +

      This method is a shortcut for .on('mousedown', handler) in the first variation, and .trigger('mousedown') in the second.

      The mousedown event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="target">
      diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml
      index 80f7a525..1dc1ffb1 100644
      --- a/entries/mouseenter.xml
      +++ b/entries/mouseenter.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mouseenter', handler) in the first two variations, and .trigger('mouseenter') in the third.

      +

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

      The mouseenter JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser. This event is sent to an element when the mouse pointer enters the element. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="outer">
      diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml
      index e0ebadb3..1082b040 100644
      --- a/entries/mouseleave.xml
      +++ b/entries/mouseleave.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mouseleave', handler) in the first two variations, and .trigger('mouseleave') in the third.

      +

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

      The mouseleave JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser. This event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="outer">
      diff --git a/entries/mousemove.xml b/entries/mousemove.xml
      index a6fd52c0..48d4a534 100644
      --- a/entries/mousemove.xml
      +++ b/entries/mousemove.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mousemove', handler) in the first two variations, and .trigger('mousemove') in the third.

      +

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

      The mousemove event is sent to an element when the mouse pointer moves inside the element. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="target">
      diff --git a/entries/mouseout.xml b/entries/mouseout.xml
      index 1dc2e6e0..67557c55 100644
      --- a/entries/mouseout.xml
      +++ b/entries/mouseout.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mouseout', handler) in the first two variation, and .trigger('mouseout') in the third.

      +

      This method is a shortcut for .on('mouseout', handler) in the first two variation, and .trigger('mouseout') in the third.

      The mouseout event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="outer">
      @@ -81,9 +81,9 @@ $("div.overout").mouseout(function(){
       });
       
       var n = 0;
      -$("div.enterleave").bind("mouseenter",function(){
      +$("div.enterleave").on("mouseenter",function(){
         $("p:first",this).text("mouse enter");
      -}).bind("mouseleave",function(){
      +}).on("mouseleave",function(){
         $("p:first",this).text("mouse leave");
         $("p:last",this).text(++n);
       });
      diff --git a/entries/mouseover.xml b/entries/mouseover.xml
      index f7db672d..1dfed9c6 100644
      --- a/entries/mouseover.xml
      +++ b/entries/mouseover.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mouseover', handler) in the first two variations, and .trigger('mouseover') in the third.

      +

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

      The mouseover event is sent to an element when the mouse pointer enters the element. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="outer">
      diff --git a/entries/mouseup.xml b/entries/mouseup.xml
      index 13f28447..cb2b50cb 100644
      --- a/entries/mouseup.xml
      +++ b/entries/mouseup.xml
      @@ -21,7 +21,7 @@
           1.0
         
         
      -    

      This method is a shortcut for .bind('mouseup', handler) in the first variation, and .trigger('mouseup') in the second.

      +

      This method is a shortcut for .on('mouseup', handler) in the first variation, and .trigger('mouseup') in the second.

      The mouseup event is sent to an element when the mouse pointer is over the element, and the mouse button is released. Any HTML element can receive this event.

      For example, consider the HTML:

      <div id="target">
      diff --git a/entries/one.xml b/entries/one.xml
      index 7f91bb52..295eb652 100644
      --- a/entries/one.xml
      +++ b/entries/one.xml
      @@ -51,12 +51,12 @@ $("body").one("click", "#foo", function() {
       });
       

      After the code is executed, a click on the element with ID foo will display the alert. Subsequent clicks will do nothing. This code is equivalent to:

      -
      $("#foo").bind("click", function( event ) {
      +    
      $("#foo").on("click", function( event ) {
         alert("This will be displayed only once.");
      -  $(this).unbind( event );
      +  $(this).off( event );
       });
       
      -

      In other words, explicitly calling .unbind() from within a regularly-bound handler has exactly the same effect.

      +

      In other words, explicitly calling .off() from within a regularly-bound handler has exactly the same effect.

      If the first argument contains more than one space-separated event types, the event handler is called once for each event type.

      diff --git a/entries/promise.xml b/entries/promise.xml index 12b6ce8c..7f18a0b4 100644 --- a/entries/promise.xml +++ b/entries/promise.xml @@ -50,7 +50,7 @@ div { ]]> Bind an event handler to the "unload" JavaScript event. -

      This method is a shortcut for .bind('unload', handler).

      +

      This method is a shortcut for .on('unload', handler).

      The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

      The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers, and contrasted with the proprietary beforeunload event.

      diff --git a/entries/val.xml b/entries/val.xml index 7e4f33ea..c9898efa 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -128,7 +128,7 @@ $.valHooks.textarea = { Use the function argument to modify the value of an input box. Date: Tue, 12 Feb 2013 10:56:40 -0500 Subject: [PATCH 076/998] Link directly to contribute.jquery.org docs in README to explain build instructions --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 8e9443f2..d5dfc651 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,7 @@ The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Wi ### Build -1. `npm install` -2. `cp config-sample.json config.json` -3. Edit config.json per https://github.com/scottgonzalez/grunt-wordpress#config -4. `grunt` +To build and deploy your changes for previewing in a [jquery-wp-content](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/). ## Style Guidelines From f5a48fa2d75babbed3044fe63447cf8f17adaabf Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 13 Feb 2013 17:29:58 -0500 Subject: [PATCH 077/998] Remove demos from examples for removed methods --- entries/jQuery.browser.xml | 23 ++++------------------- entries/toggle-event.xml | 30 +----------------------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index 1493bb89..b5b36f53 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -23,18 +23,10 @@ Show the browser info. - - +jQuery.each(jQuery.browser, function(i, val) { + $("
      " + i + " : " + val + "") + .appendTo( document.body ); +});]]> Returns true if the current useragent is some version of Microsoft's Internet Explorer. @@ -95,13 +87,6 @@ $("p").html( "The version number of the rendering engine your browser uses is: " + $.browser.version + "" ); ]]> - - Alerts the version of IE's rendering engine that is being used: diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index bb36989d..55f00192 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -45,35 +45,7 @@

      The .toggle() method is provided for convenience. It is relatively straightforward to implement the same behavior by hand, and this can be necessary if the assumptions built into .toggle() prove limiting. For example, .toggle() is not guaranteed to work correctly if applied twice to the same element. Since .toggle() internally uses a click handler to do its work, we must unbind click to remove a behavior attached with .toggle(), so other click handlers can be caught in the crossfire. The implementation also calls .preventDefault() on the event, so links will not be followed and buttons will not be clicked if .toggle() has been called on the element.

      - Click to toggle highlight on the list item. - - - - - - To toggle a style on table cells: + Toggle a style on table cells. (Not recommended. Use .toggleClass() instead.): - + deferred.isRejected() 1.5 @@ -12,4 +12,4 @@ - \ No newline at end of file + From 0fa131e4b6c621c246eb6d2f7d75dcf4c8dd6101 Mon Sep 17 00:00:00 2001 From: Vesa Laakso Date: Wed, 13 Feb 2013 17:49:57 -0500 Subject: [PATCH 079/998] Fix broken code example at entries/length.xml --- entries/length.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/length.xml b/entries/length.xml index a7f73ec4..2d67f782 100644 --- a/entries/length.xml +++ b/entries/length.xml @@ -15,7 +15,8 @@ var n = $("div").length; $("span").text("There are " + n + " divs." + "Click to add more."); -}).trigger('click'); // trigger the click to start]]> +}).trigger('click'); // trigger the click to start +]]> Date: Thu, 21 Feb 2013 11:25:09 -0500 Subject: [PATCH 081/998] Remove extraneous markup from block. Closes #255 --- entries/delegate.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entries/delegate.xml b/entries/delegate.xml index 72b79049..ee144ca9 100644 --- a/entries/delegate.xml +++ b/entries/delegate.xml @@ -41,8 +41,10 @@

      As of jQuery 1.7, .delegate() has been superseded by the .on() method. For earlier versions, however, it remains the most effective means to use event delegation. More information on event binding and delegation is in the .on() method. In general, these are the equivalent templates for the two methods:

      
      -$(elements).delegate(selector, events, data, handler);  // jQuery 1.4.3+
      -$(elements).on(events, selector, data, handler);        // jQuery 1.7+
      +// jQuery 1.4.3+
      +$(elements).delegate( selector, events, data, handler );
      +// jQuery 1.7+
      +$(elements).on( events, selector, data, handler );
        

      For example, the following .delegate() code:

      $("table").delegate("td", "click", function() {
      
      From e873a7d081f1de4454a071a7c52028ba57313ff4 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Thu, 21 Feb 2013 11:54:53 -0500
      Subject: [PATCH 082/998] Fix insertion examples.
      
      Closes #253
      ---
       entries/appendTo.xml     | 6 ++++--
       entries/insertAfter.xml  | 6 ++++--
       entries/insertBefore.xml | 6 ++++--
       entries/prependTo.xml    | 3 +--
       4 files changed, 13 insertions(+), 8 deletions(-)
      
      diff --git a/entries/appendTo.xml b/entries/appendTo.xml
      index 9f79120c..602f7204 100644
      --- a/entries/appendTo.xml
      +++ b/entries/appendTo.xml
      @@ -50,8 +50,10 @@
           

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

      - Appends all spans to the element with the ID "foo" - + Append all spans to the element with the ID "foo" (Check append() documentation for more examples) +
      + Insert all paragraphs after an element with id of "foo". Same as $("#foo").after("p") + diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml index da86ce08..94fd3d74 100644 --- a/entries/insertBefore.xml +++ b/entries/insertBefore.xml @@ -41,8 +41,10 @@

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

      - Inserts all paragraphs before an element with id of "foo". Same as $("#foo").before("p") - + Insert all paragraphs before an element with id of "foo". Same as $("#foo").before("p") + diff --git a/entries/prependTo.xml b/entries/prependTo.xml index cb24ffc1..8a9bd66e 100644 --- a/entries/prependTo.xml +++ b/entries/prependTo.xml @@ -45,10 +45,9 @@

      If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

      - Prepends all spans to the element with the ID "foo" + Prepend all spans to the element with the ID "foo" (Check .prepend() documentation for more examples) Date: Sun, 24 Feb 2013 17:52:31 -0500 Subject: [PATCH 084/998] Remove incorrect statement about box-sizing and height() --- entries/height.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/height.xml b/entries/height.xml index 5f164d20..80719630 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -78,7 +78,7 @@ $(document).height(); // returns height of HTML document

      When calling .height(value), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, a valid CSS measurement must be provided for the height (such as 100px, 50%, or auto). Note that in modern browsers, the CSS height property does not include padding, border, or margin.

      If no explicit unit was specified (like 'em' or '%') then "px" is concatenated to the value.

      -

      Note that .height(value) sets the height of the box in accordance with the CSS box-sizing property. Changing this property to border-box will cause this function to change the outerHeight of the box instead of the content height.

      +

      Note that .height(value) sets the content height of the box regardless of the value of the CSS box-sizing property.

      To set the height of each div on click to 30px plus a color change. From e4d98e564d7641cf44da0a625296220f066ce073 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Sun, 24 Feb 2013 17:54:09 -0500 Subject: [PATCH 085/998] Remove incorrect statement about box-sizing and width() --- entries/width.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/width.xml b/entries/width.xml index 0f9d71c0..648bee5b 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -75,7 +75,7 @@ $("#getw").click(function () {

      When calling .width("value"), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used for the width (such as 100px, 50%, or auto). Note that in modern browsers, the CSS width property does not include padding, border, or margin, unless the box-sizing CSS property is used.

      If no explicit unit is specified (like "em" or "%") then "px" is assumed.

      -

      Note that .width("value") sets the width of the box in accordance with the CSS box-sizing property. Changing this property to border-box will cause this function to change the outerWidth of the box instead of the content width.

      +

      Note that .width("value") sets the content width of the box regardless of the value of the CSS box-sizing property.

      Change the width of each div the first time it is clicked (and change its color). From ede5fb7fedaf30197c0e13206dcce60bae938f26 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 24 Feb 2013 18:00:46 -0500 Subject: [PATCH 086/998] Include effects options added in jQuery 1.8. Closes #81 --- includes/options-argument.xml | 74 ++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/includes/options-argument.xml b/includes/options-argument.xml index 6d3c3522..99bbf34c 100644 --- a/includes/options-argument.xml +++ b/includes/options-argument.xml @@ -9,35 +9,65 @@ A string indicating which easing function to use for the transition. - - A function to call once the animation is complete. - + + A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. + + + A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. + - A function to be called after each step of the animation. + A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. The numeric value of the property being animated at each step - - A map of properties related to the animation and the element being animated - - The animated element - - - The first value of the animated property - - - The last value of the animated property - - - The property being animated - + + An object of properties related to the animation and the element being animated. For information about the tween object and its properties, see jQuery.Tween - - A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. + + + A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. + + An enhanced Promise oject with additional properties for the animation + + + A number from 0 to 1 indicating the progress of the animation + + + A number indicating the remaining number of milliseconds until the scheduled end of the animation + - - A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. + + A function to call once the animation is complete. + + + + A function to be called when the animation completes (its Promise object is resolved). + + An enhanced Promise oject with additional properties for the animation + + + Indicates whether the animation jumped to the end + + + + A function to be called when the animation fails to complete (its Promise object is rejected). + + An enhanced Promise oject with additional properties for the animation + + + Indicates whether the animation jumped to the end + + + + A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). + + An enhanced Promise oject with additional properties for the animation + + + Indicates whether the animation jumped to the end + + From 0fd087a60bc7be29a1595cc7e44e7b9a0f2d831d Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 24 Feb 2013 18:08:27 -0500 Subject: [PATCH 087/998] 1.9.1-2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3716fbf5..04c66fdb 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": "1.9.1-1", + "version": "1.9.1-2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From fe4c6516c2d7eb66f4ad4912ea5c0eba7ceef166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 28 Feb 2013 13:16:37 -0500 Subject: [PATCH 088/998] .show()/.hide()/.toggle(): duration is required when providing an easing. --- entries/hide.xml | 7 ++++++- entries/show.xml | 7 ++++++- entries/toggle.xml | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/entries/hide.xml b/entries/hide.xml index 99a08409..6d6755c4 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -16,7 +16,12 @@ 1.4.3 - + + + A string or number determining how long the animation will run. + + + diff --git a/entries/show.xml b/entries/show.xml index 6362d200..e94ce321 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -16,7 +16,12 @@ 1.4.3 - + + + A string or number determining how long the animation will run. + + + diff --git a/entries/toggle.xml b/entries/toggle.xml index b20509bb..8127ff36 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -13,7 +13,12 @@ 1.4.3 - + + + A string or number determining how long the animation will run. + + + From 56d60378450bd52a7e1f24c1ebf4c27353367514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 28 Feb 2013 13:19:50 -0500 Subject: [PATCH 089/998] 1.9.1-3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 04c66fdb..db4a19ec 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": "1.9.1-2", + "version": "1.9.1-3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 56e8320f25fcfab9203ffbd22323b1dcc3c89a79 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Sun, 3 Mar 2013 20:11:07 -0500 Subject: [PATCH 090/998] Updating the second signature for .trigger to include the optional extraParameters. Fixes #259 --- entries/trigger.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entries/trigger.xml b/entries/trigger.xml index 11aedd2f..32c304f1 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -18,6 +18,11 @@ A jQuery.Event object. + + + + Additional parameters to pass along to the event handler. +

      Any event handlers attached with .on() or one of its shortcut methods are triggered when the corresponding event occurs. They can be fired manually, however, with the .trigger() method. A call to .trigger() executes the handlers in the same order they would be if the event were triggered naturally by the user:

      From 08bc4559f6f04c5f912b601d02c5e71ec2e166ac Mon Sep 17 00:00:00 2001 From: Wei Kin Huang Date: Sun, 3 Mar 2013 20:14:36 -0500 Subject: [PATCH 091/998] iterate through array with $.each. Closes #258 --- entries/jQuery.ajax.xml | 42 +++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index e85bd5b0..2f6bd3ae 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -284,29 +284,35 @@ jqxhr.always(function() { alert("second complete"); });

      At present, due to a bug in Firefox where .getAllResponseHeaders() returns the empty string although .getResponseHeader('Content-Type') returns a non-empty string, automatically decoding JSON CORS responses in Firefox with jQuery is not supported.

      A workaround to this is possible by overriding jQuery.ajaxSettings.xhr as follows:

      
      -var _super = jQuery.ajaxSettings.xhr;
      -jQuery.ajaxSettings.xhr = function () {
      -  var xhr = _super(),
      -      getAllResponseHeaders = xhr.getAllResponseHeaders;
      +(function () {
      +  var _super = jQuery.ajaxSettings.xhr,
      +    xhrCorsHeaders = [ "Cache-Control", "Content-Language", "Content-Type", "Expires", "Last-Modified", "Pragma" ];
       
      -  xhr.getAllResponseHeaders = function () {
      -    if ( getAllResponseHeaders() ) {
      -      return getAllResponseHeaders();
      -    }
      -    var allHeaders = "";
      +  jQuery.ajaxSettings.xhr = function () {
      +    var xhr = _super(),
      +      getAllResponseHeaders = xhr.getAllResponseHeaders;
       
      -    $( ["Cache-Control", "Content-Language", "Content-Type",
      -        "Expires", "Last-Modified", "Pragma"] )
      -    .each(function (i, header_name) {
      -      if ( xhr.getResponseHeader( header_name ) ) {
      -        allHeaders += header_name + ": " + xhr.getResponseHeader( header_name ) + "\n";
      +    xhr.getAllResponseHeaders = function () {
      +      var allHeaders = "";
      +      try {
      +        allHeaders = getAllResponseHeaders.apply( xhr );
      +        if ( allHeaders ) {
      +          return allHeaders;
      +        }
      +      } catch ( e ) {
             }
      +
      +      $.each( xhrCorsHeaders, function ( i, headerName ) {
      +        if ( xhr.getResponseHeader( headerName ) ) {
      +          allHeaders += headerName + ": " + xhr.getResponseHeader( headerName ) + "\n";
      +        }
      +      });
             return allHeaders;
      -    });
      -  };
      +    };
       
      -  return xhr;
      -};
      +    return xhr;
      +  };
      +})();
       

      Extending Ajax

      From 9f45093c7727cdeaeb152b32f67ace0c645f3e6f Mon Sep 17 00:00:00 2001 From: Jake Harding Date: Sun, 3 Mar 2013 20:16:19 -0500 Subject: [PATCH 092/998] Fix incorrect argument type for dataFilter. Closes #257 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 2f6bd3ae..21737bc8 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -60,7 +60,7 @@ Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). - + A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. From 0667f8266feb7d40ee8856bf74195fe62258c342 Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Sun, 3 Mar 2013 20:18:46 -0500 Subject: [PATCH 093/998] Fix typo in jQuery.getScript. Closes #249. --- 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 0e306da2..da850c24 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -52,7 +52,7 @@ $( "div.log" ).ajaxError(function(e, jqxhr, settings, exception) { });

      Caching Responses

      -

      Be default, $.getScript() sets the cache setting to false. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using $.ajaxSetup():

      +

      By default, $.getScript() sets the cache setting to false. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using $.ajaxSetup():

      
       $.ajaxSetup({
         cache: true
      
      From 03668b83ded965a56fcf5a03926799db7a39e57d Mon Sep 17 00:00:00 2001
      From: Maurice Gottlieb 
      Date: Sun, 3 Mar 2013 20:26:33 -0500
      Subject: [PATCH 094/998] Update CSS example caption Closes #241
      
      ---
       entries/css.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/css.xml b/entries/css.xml
      index 6af3cdaf..3e8fcc66 100644
      --- a/entries/css.xml
      +++ b/entries/css.xml
      @@ -174,7 +174,7 @@ div { height: 50px; margin: 5px; padding: 5px; float: left; }
       

      ]]> - To set the color of all paragraphs to red and background to blue: + To set the text-weight of hovered paragraphs to bolder, background to blue, and different CSS when leave: Note: If nothing is returned in the setter function (ie. function(index, style){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

      - To change the color of any paragraph to red on mouseover event. + Change the color of any paragraph to red on mouseover event. - Increase the width of #box by 200 pixels + Increase the width of #box by 200 pixels the first time it is clicked. - To highlight a clicked word in the paragraph. + Highlight a clicked word in the paragraph. @@ -174,18 +174,22 @@ div { height: 50px; margin: 5px; padding: 5px; float: left; }

      ]]>
      - To set the text-weight of hovered paragraphs to bolder, background to blue, and different CSS when leave: + Change the font weight and background color on mouseenter and mouseleave. - Increase the size of a div when you click it: + Increase the size of a div when you click it. "through the" --- entries/children.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/children.xml b/entries/children.xml index 6af201d5..7355f0cb 100644 --- a/entries/children.xml +++ b/entries/children.xml @@ -9,7 +9,7 @@ Get the children of each element in the set of matched elements, optionally filtered by a selector. -

      Given a jQuery object that represents a set of DOM elements, the .children() method allows us to search throughthe children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .children() method differs from .find() in that .children() only travels a single level down the DOM tree while .find() can traverse down multiple levels to select descendant elements (grandchildren, etc.) as well. Note also that like most jQuery methods, .children() does not return text nodes; to get all children including text and comment nodes, use .contents().

      +

      Given a jQuery object that represents a set of DOM elements, the .children() method allows us to search through the children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .children() method differs from .find() in that .children() only travels a single level down the DOM tree while .find() can traverse down multiple levels to select descendant elements (grandchildren, etc.) as well. Note also that like most jQuery methods, .children() does not return text nodes; to get all children including text and comment nodes, use .contents().

      The .children() 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.

      Consider a page with a basic nested list on it:

      
      @@ -124,4 +124,4 @@
         
         
         
      -
      \ No newline at end of file
      +
      
      From 90e9d110d3300dcb9ecd6bf2dfcfb82d36e3e1b7 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Tue, 12 Mar 2013 20:10:22 -0400
      Subject: [PATCH 097/998] Close gh-265. Clarify instructions in .removeAttr()
       example.
      
      ---
       entries/removeAttr.xml | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml
      index 7f4a3c90..bf076bc0 100644
      --- a/entries/removeAttr.xml
      +++ b/entries/removeAttr.xml
      @@ -17,7 +17,7 @@ console.log("onclick property: ", $element[0].onclick);
           
      - Clicking the button enables the input next to it. + Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute. - From b5b7a95fd68fe92f43e6dd37b4140fc273b994f7 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 12 Mar 2013 21:07:27 -0400 Subject: [PATCH 098/998] Close gh-243. Clarify $.parseJSON valid inputs. --- entries/jQuery.parseJSON.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index 41f56861..7843502d 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -9,13 +9,14 @@ Takes a well-formed JSON string and returns the resulting JavaScript object. -

      Passing in a malformed JSON string may result in an exception being thrown. For example, the following are all malformed JSON strings:

      +

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

      • {test: 1} (test does not have double quotes around it).
      • {'test': 1} ('test' is using single quotes instead of double quotes).
      -

      Additionally if you pass in nothing, an empty string, null, or undefined, 'null' will be returned from parseJSON. Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/. -

      +

      The JSON standard does not permit "control characters" such as a tab or newline. An example like `$.parseJSON('{"testing":"1\t2\n3"}')` will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like `"1\\t2\\n3"` yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

      +

      Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

      +

      Prior to jQuery 1.9, `$.parseJSON` returned `null` instead of throwing an error if it was passed an empty string, `null`, or `undefined`, even though those are not valid JSON.

      Parse a JSON string. From 747f05e636bcdf0bebc5c9808dd238a16a83b1ac Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 12 Mar 2013 21:42:41 -0400 Subject: [PATCH 099/998] Ref gh-240, deprecated/removed stuff for 1.9 --- entries/andSelf.xml | 1 + entries/die.xml | 1 + entries/jQuery.browser.xml | 1 + entries/jQuery.error.xml | 1 + entries/jQuery.sub.xml | 1 + entries/live.xml | 1 + 6 files changed, 6 insertions(+) diff --git a/entries/andSelf.xml b/entries/andSelf.xml index d85b2e88..450c0ef6 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -61,4 +61,5 @@ p, div { margin:5px; padding:5px; } + diff --git a/entries/die.xml b/entries/die.xml index f0f6e6d5..dfbdbeb7 100644 --- a/entries/die.xml +++ b/entries/die.xml @@ -49,5 +49,6 @@ $("p").die("click", foo); // ... foo will no longer be called.]]>
      + diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index b5b36f53..9a925890 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -108,5 +108,6 @@ if ( $.browser.msie ) { + diff --git a/entries/jQuery.error.xml b/entries/jQuery.error.xml index f6bd7cd5..f993cdde 100644 --- a/entries/jQuery.error.xml +++ b/entries/jQuery.error.xml @@ -17,4 +17,5 @@
      + \ No newline at end of file diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index c247e478..c300d963 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -94,4 +94,5 @@ $(document).ready(function() { + diff --git a/entries/live.xml b/entries/live.xml index 322fc9c5..822db0fc 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -104,4 +104,5 @@ $("p").live({ + From a9ecfeb891e8ce2d14696674a83a5ac97a9e7681 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 12 Mar 2013 21:57:51 -0400 Subject: [PATCH 100/998] Followup on gh-243. XML, not Markdown. --- entries/jQuery.parseJSON.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index 7843502d..a0a7a86a 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -14,9 +14,9 @@
    • {test: 1} (test does not have double quotes around it).
    • {'test': 1} ('test' is using single quotes instead of double quotes).
    -

    The JSON standard does not permit "control characters" such as a tab or newline. An example like `$.parseJSON('{"testing":"1\t2\n3"}')` will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like `"1\\t2\\n3"` yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

    +

    The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON('{"testing":"1\t2\n3"}') will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

    Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

    -

    Prior to jQuery 1.9, `$.parseJSON` returned `null` instead of throwing an error if it was passed an empty string, `null`, or `undefined`, even though those are not valid JSON.

    +

    Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

    Parse a JSON string. From ba65c8eeac0f211eb9c1cfe33a5625e1cca02051 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 12 Mar 2013 22:06:58 -0400 Subject: [PATCH 101/998] Close gh-222. Clarify .text() method operation. --- entries/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/text.xml b/entries/text.xml index 947cf9a3..af97f505 100644 --- a/entries/text.xml +++ b/entries/text.xml @@ -57,7 +57,7 @@ $("p:last").html(str); Set the content of each element in the set of matched elements to the specified text.

    Unlike the .html() method, .text() can be used in both XML and HTML documents.

    -

    We need to be aware that this method escapes the string provided as necessary so that it will render correctly in HTML. To do so, it calls the DOM method .createTextNode(), which replaces special characters with their HTML entity equivalents (such as &lt; for <). Consider the following HTML:

    +

    We need to be aware that this method escapes the string provided as necessary so that it will render correctly in HTML. To do so, it calls the DOM method .createTextNode(), does not interpret the string as HTML. Consider the following HTML:

    <div class="demo-container">
       <div class="demo-box">Demonstration Box</div>
       <ul>
    
    From d8f15aef33e7ba9444d5df3c439c42494034497f Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Tue, 12 Mar 2013 22:27:54 -0400
    Subject: [PATCH 102/998] Add deprecated-1.4 category
    
    ---
     categories.xml | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/categories.xml b/categories.xml
    index 43277b9d..7d1b720c 100644
    --- a/categories.xml
    +++ b/categories.xml
    @@ -36,6 +36,11 @@
       
       
         
    +    
    +      
    +    
         
           Get the value of an attribute for the first element in the set of matched elements.
         
           

    The .attr() method gets the attribute value for only the first element in the matched set. To get the value for each element individually, use a looping construct such as jQuery's .each() or .map() method.

    -

    As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() should not be used on plain objects, arrays, the window, or the document. To retrieve and change DOM properties, use the .prop() method.

    Using jQuery's .attr() method to get the value of an element's attribute has two main benefits:

    1. Convenience: It can be called directly on a jQuery object and chained to other jQuery methods.
    2. @@ -21,7 +20,91 @@

      Note: Attribute values are strings with the exception of a few attributes such as value and tabindex.

      +

      As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() should not be used on plain objects, arrays, the window, or the document. To retrieve and change DOM properties, use the .prop() method.

      + +

      Attributes vs. Properties

      +

      The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

      +

      For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

      +

      Concerning boolean attributes, consider a DOM element defined by the HTML markup <input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:

      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + elem.checked + true (Boolean) Will change with checkbox state
      + $(elem).prop("checked") + true (Boolean) Will change with checkbox state
      + elem.getAttribute("checked") + "checked" (String) Initial state of the checkbox; does not change
      + $(elem).attr("checked") + (1.6) + "checked" (String) Initial state of the checkbox; does not change
      + $(elem).attr("checked") + (1.6.1+) + "checked" (String) Will change with checkbox state
      + $(elem).attr("checked") + (pre-1.6) + true (Boolean) Changed with checkbox state
      +
      +

      According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

      +

      Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does. Therefore, the cross-browser-compatible way to determine if a checkbox is checked is to use the property:

      +
        +
      • + if ( elem.checked ) +
      • +
      • + if ( $(elem).prop("checked") ) +
      • +
      • + if ( $(elem).is(":checked") ) +
      • +
      +

      The same is true for other dynamic attributes, such as selected and value.

      + + + Display the checked attribute and property of a checkbox as it changes. + + + + +
      Find the title attribute of the first <em> in the page. <style></style> - <script src="http://code.jquery.com/jquery-latest.js"></script> + <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> </script> From 29c4c66b79f0d8c0bdf2d8cfee9be38e585f8a4e Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 13:34:50 -0400 Subject: [PATCH 105/998] Add warning to $.ajaxSetup(), close gh-179. --- entries/jQuery.ajaxSetup.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml index 9ec7a6a2..7d7a924d 100644 --- a/entries/jQuery.ajaxSetup.xml +++ b/entries/jQuery.ajaxSetup.xml @@ -7,10 +7,11 @@ A set of key/value pairs that configure the default Ajax request. All options are optional. - Set default values for future Ajax requests. + Set default values for future Ajax requests. Its use is not recommended.

      For details on the settings available for $.ajaxSetup(), see $.ajax().

      All subsequent Ajax calls using any function will use the new settings, unless overridden by the individual calls, until the next invocation of $.ajaxSetup().

      +

      Note: The settings specified here will affect all calls to $.ajax or AJAX-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

      For example, the following sets a default for the url parameter before pinging the server repeatedly:

      $.ajaxSetup({
         url: 'ping.php'
      
      From 73c0dbfa16f755b8be8a8ce1e564c3282afb7563 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 17 Mar 2013 16:12:44 -0400
      Subject: [PATCH 106/998] Close gh-268, clarify that focusout and blur are
       different.
      
      ---
       entries/focusout.xml | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/focusout.xml b/entries/focusout.xml
      index ea156acb..47d08d77 100644
      --- a/entries/focusout.xml
      +++ b/entries/focusout.xml
      @@ -18,12 +18,12 @@
           
         
         
      -    

      This method is a shortcut for .on('focusout', handler).

      +

      This method is a shortcut for .on('focusout', handler) when passed arguments, and .trigger('focusout') when no arguments are passed.

      The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

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

      - Watch for a loss of focus to occur inside paragraphs and note the difference between the focusout count and the blur count. + Watch for a loss of focus to occur inside paragraphs and note the difference between the focusout count and the blur count. (The blur count does not change because those events do not bubble.) Add elements to the set of matched elements.

      Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

      +

      Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order, use the $(array_of_DOM_elements) signature.

      The updated set of elements can be used in a following (chained) method, or assigned to a variable for later use. For example:

             
      
      From bbd0155736ddbae9582bd53d1b2d3b475938e4dc Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 17 Mar 2013 16:35:22 -0400
      Subject: [PATCH 108/998] Ref gh-240, clarify .attr() vs .prop() some more.
      
      ---
       entries/attr.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/attr.xml b/entries/attr.xml
      index 65e962a4..14556f2f 100644
      --- a/entries/attr.xml
      +++ b/entries/attr.xml
      @@ -20,7 +20,7 @@
             

      Note: Attribute values are strings with the exception of a few attributes such as value and tabindex.

      -

      As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() should not be used on plain objects, arrays, the window, or the document. To retrieve and change DOM properties, use the .prop() method.

      +

      As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

      Attributes vs. Properties

      The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

      From a7d8ab8190e1a1793a874d56c3b1d72e94026d87 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 16:43:48 -0400 Subject: [PATCH 109/998] Ref gh-240, jQuery 1.9 wants document for ajax events. --- entries/ajaxComplete.xml | 2 +- entries/ajaxError.xml | 2 +- entries/ajaxSend.xml | 2 +- entries/ajaxStart.xml | 2 +- entries/ajaxStop.xml | 2 +- entries/ajaxSuccess.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 8064a68c..ba1d5700 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -25,7 +25,7 @@ $( ".result" ).load( "ajax/test.html" ); });

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

      -

      Note: Because .ajaxComplete() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxComplete() method should only be attached to document.

      +

      As of jQuery 1.8, the .ajaxComplete() method should only be attached to document.

      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) {
         if ( settings.url === "ajax/test.html" ) {
      diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml
      index c0e3c5c7..0253212b 100644
      --- a/entries/ajaxError.xml
      +++ b/entries/ajaxError.xml
      @@ -23,7 +23,7 @@
         $( "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.

      -

      Note: Because .ajaxError() is implemented as a method of jQuery object instances, you can use the this keyword within the callback function to refer to the selected elements. As of jQuery 1.8, however, the .ajaxError() method should only be attached to document.

      +

      As of jQuery 1.8, the .ajaxError() method should only be attached to document.

      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. If the request failed because JavaScript raised an exception, the exception object is passed to the handler as a fourth parameter. For example, to restrict the error callback to only handling events dealing with a particular URL:

      $( document ).ajaxError(function(event, jqxhr, settings, exception) {
         if ( settings.url == "ajax/missing.html" ) {
      diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml
      index 3639b44f..63f60e36 100644
      --- a/entries/ajaxSend.xml
      +++ b/entries/ajaxSend.xml
      @@ -23,7 +23,7 @@
         $( ".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.

      -

      Note: Because .ajaxSend() is implemented as a method of jQuery instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxSend() method should only be attached to document.

      +

      As of jQuery 1.8, the .ajaxSend() method should only be attached to document.

      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) {
         if ( settings.url == "ajax/test.html" ) {
      diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml
      index 5097dcec..7b01bf30 100644
      --- a/entries/ajaxStart.xml
      +++ b/entries/ajaxStart.xml
      @@ -23,7 +23,7 @@
         $( ".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.

      -

      Note: Because .ajaxStart() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxStart() method should only be attached to document.

      +

      As of jQuery 1.8, the .ajaxStart() method should only be attached to document.

      diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index e8e947de..833b39c0 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -23,7 +23,7 @@ $( ".result" ).load( "ajax/test.html" ); });

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

      -

      Because .ajaxStop() is implemented as a method of jQuery object instances, you can use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxStop() method should only be attached to document.

      +

      As of jQuery 1.8, the .ajaxStop() method should only be attached to document.

      diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 9a9d7eed..1ced68dd 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -23,7 +23,7 @@ $( ".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.

    -

    Note: Because .ajaxSuccess() is implemented as a method of jQuery object instances, use the this keyword to refer to the selected elements within the callback function. As of jQuery 1.8, however, the .ajaxSuccess() method should only be attached to document.

    +

    As of jQuery 1.8, the .ajaxSuccess() method should only be attached to document.

    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) {
       if ( settings.url == "ajax/test.html" ) {
    
    From 38aed06b339e319e352cb204445b14f5ac6b7483 Mon Sep 17 00:00:00 2001
    From: Dave Methvin 
    Date: Sun, 17 Mar 2013 16:51:25 -0400
    Subject: [PATCH 110/998] Ref gh-240. In 1.9, empty ajax response is not valid
     JSON.
    
    ---
     entries/jQuery.ajax.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index 21737bc8..4c3619ea 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -67,7 +67,7 @@
           
           
             The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are:
    -          
    • "xml": Returns a XML document that can be processed via jQuery.
    • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
    • "json": Evaluates the response as JSON and returns a JavaScript object. In jQuery 1.4 the JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. (See json.org for more information on proper JSON formatting.)
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • "text": A plain text string.
    • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. +
      • "xml": Returns a XML document that can be processed via jQuery.
      • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
      • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
      • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • "text": A plain text string.
      • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
      From 51d1998dfea22ec597adae7b2528edbba7751daa Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 18:11:10 -0400 Subject: [PATCH 111/998] Ref gh-240, add text to note .toggle() event demise. --- entries/toggle-event.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index 55f00192..e452a65b 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -16,7 +16,7 @@
      -

      Note: jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

      +

      Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

      The .toggle() method binds a handler for the click event, so the rules outlined for the triggering of click apply here as well.

      For example, consider the HTML:
      
      From cda5625169338bedab0b54ac2e620b3766d71e59 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 17 Mar 2013 18:17:40 -0400
      Subject: [PATCH 112/998] Ref gh-240, note that "hover" pseudo-event is kaput
       in 1.9.
      
      ---
       entries/on.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/on.xml b/entries/on.xml
      index 93549cea..5ea14423 100644
      --- a/entries/on.xml
      +++ b/entries/on.xml
      @@ -81,7 +81,7 @@ $("button").on("click", { name: "Addy" }, greet);
           

      jQuery can process simple selectors of the form tag#id.class very quickly when they are used to filter delegated events. So, "#myForm", "a.external", and "button" are all fast selectors. Delegated events that use more complex selectors, particularly hierarchical ones, can be several times slower--although they are still fast enough for most applications. Hierarchical selectors can often be avoided simply by attaching the handler to a more appropriate point in the document. For example, instead of $("body").on("click", "#commentForm .addNew", addComment) use $("#commentForm").on("click", ".addNew", addComment).

      Additional notes

      There are shorthand methods for some events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

      -

      Deprecated as of jQuery 1.8: The name "hover" used as a shorthand for the string "mouseenter mouseleave". It attaches a single event handler for those two events, and the handler must examine event.type to determine whether the event is mouseenter or mouseleave. Do not confuse the "hover" pseudo-event-name with the .hover() method, which accepts one or two functions.

      +

      Deprecated in jQuery 1.8, removed in 1.9: The name "hover" used as a shorthand for the string "mouseenter mouseleave". It attaches a single event handler for those two events, and the handler must examine event.type to determine whether the event is mouseenter or mouseleave. Do not confuse the "hover" pseudo-event-name with the .hover() method, which accepts one or two functions.

      jQuery's event system requires that a DOM element allow attaching data via a property on the element, so that events can be tracked and delivered. The object, embed, and applet elements cannot attach data, and therefore cannot have jQuery events bound to them.

      The focus and blur events are specified by the W3C to not bubble, but jQuery defines cross-browser focusin and focusout events that do bubble. When focus and blur are used to attach delegated event handlers, jQuery maps the names and delivers them as focusin and focusout respectively. For consistency and clarity, use the bubbling event type names.

      In all browsers, the load, scroll, and error events (e.g., on an <img> element) do not bubble. In Internet Explorer 8 and lower, the paste and reset events do not bubble. Such events are not supported for use with delegation, but they can be used when the event handler is directly attached to the element generating the event.

      From e53a698e8a7259e25b5c251d66fdb4d8f11f5910 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 18:36:52 -0400 Subject: [PATCH 113/998] Ref gh-240, ding-dong .selector's dead. --- entries/selector.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/selector.xml b/entries/selector.xml index 8abe05bf..aad20b1e 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -1,14 +1,14 @@ - + .selector 1.3 - A selector representing selector originally passed to jQuery(). + A selector representing selector passed to jQuery(), if any, when creating the original set. -

      Should be used in conjunction with context to determine the exact query used.

      -

      The .live() method for binding event handlers uses this property to determine how to perform its searches. Plug-ins which perform similar tasks may also find the property useful. This property contains a string representing the matched set of elements, but if DOM traversal methods have been called on the object, the string may not be a valid jQuery selector expression. For this reason, the value of .selector is generally most useful immediately following the original creation of the object. Consequently, the .live() method should only be used in this scenario.

      +

      The .selector property was deprecated in jQuery 1.7 and is only maintained in jQuery 1.9 to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector should have the caller pass in the selector as part of the plugin's arguments during initialization.

      +
      From bc1823aba01b80c11d6cb8f42321a021ee745cf9 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 18:42:58 -0400 Subject: [PATCH 114/998] Remove mention of jQuery.event.props which was already discouraged. --- categories.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index 7d1b720c..89e29667 100644 --- a/categories.xml +++ b/categories.xml @@ -132,7 +132,7 @@

      The following properties are also copied to the event object, though some of their values may be undefined depending on the event:

      altKey, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, prevValue, relatedTarget, screenX, screenY, shiftKey, target, view, which

      OtherProperties

      -

      Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object. To make special properties available in all event objects, they can be added to the jQuery.event.props array. This is not recommended, since it adds overhead to every event delivered by jQuery.

      +

      Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

      Example:

                   
      
      From 958aec5fa8e72babdf347a28e6790b40a80c063e Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 17 Mar 2013 19:01:57 -0400
      Subject: [PATCH 115/998] Ref gh-240. jQuery.proxy() and `this` change.
      
      ---
       entries/jQuery.proxy.xml | 1 +
       1 file changed, 1 insertion(+)
      
      diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml
      index 03760189..19324d99 100644
      --- a/entries/jQuery.proxy.xml
      +++ b/entries/jQuery.proxy.xml
      @@ -50,6 +50,7 @@
           

      Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

      As of jQuery 1.6, any number of additional arguments may supplied to $.proxy(), and they will be passed to the function whose context will be changed.

      +

      As of jQuery 1.9, when the context is null or undefined the the proxied function will be called with the same this object as the proxy was called with. This allows $.proxy() to be used to partially apply the arguments of a function without changing the context.

      Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. From 2ae644ca42a5785c5b86ea3ccb40b788504dd20a Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 19:09:55 -0400 Subject: [PATCH 116/998] Ref gh-240. Warn about changing `input type` in oldIE. --- entries/attr.xml | 3 +++ entries/prop.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/entries/attr.xml b/entries/attr.xml index 14556f2f..9325defb 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -20,6 +20,9 @@

      Note: Attribute values are strings with the exception of a few attributes such as value and tabindex.

      +
      +

      Note: Attempting to change the type attribute (or property) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

      +

      As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

      Attributes vs. Properties

      diff --git a/entries/prop.xml b/entries/prop.xml index 53945a19..3cbc038e 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -12,6 +12,9 @@ Get the value of a property for the first element in the set of matched elements.

      The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery's .each() or .map() method.

      +
      +

      Note: Attempting to change the type property (or attribute) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

      +

      Attributes vs. Properties

      The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

      For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

      From d84b9cf5bd9a70554f2e02f353c2ad6f20346871 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 19:25:41 -0400 Subject: [PATCH 117/998] Ref gh-240, note newly pushy behavior of append-target methods. --- entries/appendTo.xml | 3 ++- entries/insertAfter.xml | 3 ++- entries/insertBefore.xml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/entries/appendTo.xml b/entries/appendTo.xml index 602f7204..67d6b3eb 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -40,7 +40,7 @@

      We can also select an element on the page and insert it into another:

      $('h2').appendTo($('.container'));
       
      -

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

      +

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned) and a new set consisting of the inserted element is returned:

      <div class="container">
         <div class="inner">Hello</div>
         <div class="inner">Goodbye</div>
      @@ -48,6 +48,7 @@
       </div>
       

      If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

      Append all spans to the element with the ID "foo" (Check append() documentation for more examples) diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml index ec9e832d..9b868546 100644 --- a/entries/insertAfter.xml +++ b/entries/insertAfter.xml @@ -32,13 +32,14 @@ </div>

      We can also select an element on the page and insert it after another:

      $('h2').insertAfter($('.container'));
      -

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved after the target (not cloned):

      +

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved after the target (not cloned) and a new set consisting of the inserted element is returned:

      <div class="container">
         <div class="inner">Hello</div>
         <div class="inner">Goodbye</div>
       </div>
       <h2>Greetings</h2>

      If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

      Insert all paragraphs after an element with id of "foo". Same as $("#foo").after("p") diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml index 94fd3d74..57816608 100644 --- a/entries/insertBefore.xml +++ b/entries/insertBefore.xml @@ -32,13 +32,14 @@ </div>

      We can also select an element on the page and insert it before another:

      $('h2').insertBefore($('.container'));
      -

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned):

      +

      If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned) and a new set consisting of the inserted element is returned:

      <h2>Greetings</h2>
       <div class="container">
         <div class="inner">Hello</div>
         <div class="inner">Goodbye</div>
       </div>

      If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

      Insert all paragraphs before an element with id of "foo". Same as $("#foo").before("p") From ca76386282dc9399bbc5c0536f588a0a5b5c2a3e Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 19:50:18 -0400 Subject: [PATCH 118/998] Close gh-178. Reword .trigger() regarding data args. --- entries/trigger.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/trigger.xml b/entries/trigger.xml index 32c304f1..1e5b5d1a 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -38,8 +38,8 @@ }); $('#foo').trigger('custom', ['Custom', 'Event']);
    -

    The event object is always passed as the first parameter to an event handler, but if additional parameters are specified during a .trigger() call, these parameters will be passed along to the handler as well. To pass more than one parameter, use an array as shown here. As of jQuery 1.6.2, a single parameter can be passed without using an array.

    -

    Note the difference between the extra parameters we're passing here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

    +

    The event object is always passed as the first parameter to an event handler. An array of arguments can also be passed to the .trigger() call, and these parameters will be passed along to the handler as well following the event object. As of jQuery 1.6.2, single string or numeric argument can be passed without being wrapped in an array.

    +

    Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

    The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

    Note: For both plain objects and DOM objects, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
    From 377809567b611f73fb83f1796765a2a6be417a23 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 19:57:20 -0400 Subject: [PATCH 119/998] Close gh-166. Make .focusin() a form event. --- entries/focusin.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entries/focusin.xml b/entries/focusin.xml index 9b7f1133..db621ebf 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -33,8 +33,7 @@ $("p").focusin(function() {
    - - + From d7dac8749e8b36ebbb7989b120cf8a9fd1d98654 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 20:02:57 -0400 Subject: [PATCH 120/998] Close gh-148, wave people away from $.unique() some more. --- entries/jQuery.unique.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index ab907519..f80f1041 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -9,7 +9,7 @@ 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. -

    The $.unique() function searches through an array of objects, sorting the array, and removing any duplicate nodes. This function only works on plain JavaScript arrays of DOM elements, and is chiefly used internally by jQuery.

    +

    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 3723f4339aa6a3b208570b2133458e6b0ce7d8f9 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 20:21:12 -0400 Subject: [PATCH 121/998] Close gh-163. Correct .replaceAll() args. --- entries/replaceAll.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/entries/replaceAll.xml b/entries/replaceAll.xml index ae1f1052..5b0f275c 100644 --- a/entries/replaceAll.xml +++ b/entries/replaceAll.xml @@ -3,8 +3,11 @@ .replaceAll() 1.2 - - A selector expression indicating which element(s) to replace. + + A selector string, jQuery object, or DOM element reference indicating which element(s) to replace. + + + Replace each target element with the set of matched elements. From a19ab997631cc6e45716daf3d3c8e5d679ade77f Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 20:36:17 -0400 Subject: [PATCH 122/998] Close gh-193. Define `XMLDocument` in Types. --- pages/Types.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index aaaec944..17549f9b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -615,3 +615,5 @@

    Promise Object

    Callbacks Object

    A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

    +

    XML Document

    +

    A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

    From d2de070e2c371d6bdc2850d4e1a2863e1f1f1aa9 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 20:39:52 -0400 Subject: [PATCH 123/998] Add Types TOC entry for XMLDocument. --- pages/Types.html | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/Types.html b/pages/Types.html index 17549f9b..1d73fa4e 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -91,6 +91,7 @@
  • Deferred Object
  • Promise Object
  • Callbacks Object
  • +
  • XML Document
  • String

    From 77fe91d3cf5450b561bb7a6c65f20ee00ee75d4b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 17 Mar 2013 20:55:03 -0400 Subject: [PATCH 124/998] Close gh-171. .fadeTo() and .fadeIn() cross-reference. --- entries/fadeIn.xml | 2 +- entries/fadeTo.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml index f65f9f5b..92b98b8f 100644 --- a/entries/fadeIn.xml +++ b/entries/fadeIn.xml @@ -19,7 +19,7 @@ -

    The .fadeIn() method animates the opacity of the matched elements.

    +

    The .fadeIn() method animates the opacity of the matched elements. It is similar to the .fadeTo() method but that method does not unhide the element and can specify the final opacity level.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used.

    We can animate any element, such as a simple image:

    <div id="clickme">
    diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml
    index 3f5c010e..a965d0c3 100644
    --- a/entries/fadeTo.xml
    +++ b/entries/fadeTo.xml
    @@ -34,7 +34,7 @@
         
       
       
    -    

    The .fadeTo() method animates the opacity of the matched elements.

    +

    The .fadeTo() method animates the opacity of the matched elements. It is similar to the .fadeIn() method but that method unhides the element and always fades to 100% opacity.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, the default duration of 400 milliseconds is used. Unlike the other effect methods, .fadeTo() requires that duration be explicitly specified.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    We can animate any element, such as a simple image:

    From fce72bc1a2815b3306a5e94d53fa5791a2a3bcac Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 20 Mar 2013 09:16:52 -0400 Subject: [PATCH 125/998] $.post, $.get: Move a
    tag --- entries/jQuery.get.xml | 2 +- entries/jQuery.post.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 368157e0..0ebe6bca 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -38,7 +38,7 @@

    This example fetches the requested HTML snippet and inserts it on the page.

    The jqXHR Object

    -

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    +

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

    // Assign handlers immediately after making the request,
     // and remember the jqxhr object for this request
    diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
    index 85268523..f6c6dfdd 100644
    --- a/entries/jQuery.post.xml
    +++ b/entries/jQuery.post.xml
    @@ -39,7 +39,7 @@
         

    This example fetches the requested HTML snippet and inserts it on the page.

    Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

    The jqXHR Object

    -

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    +

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

    // Assign handlers immediately after making the request,
     // and remember the jqxhr object for this request
    
    From 802d9db1e57742eed2d1601fdd163b13dea0fcdf Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Wed, 20 Mar 2013 09:19:32 -0400
    Subject: [PATCH 126/998] $.getJSON: add deprecation notice for
     jqXHR.success(), et al
    
    * Also, update examples per style guide
    * Closes #270
    ---
     entries/jQuery.getJSON.xml | 59 +++++++++++++++++++++++---------------
     1 file changed, 36 insertions(+), 23 deletions(-)
    
    diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
    index 30f11c4a..2fe8fcb0 100644
    --- a/entries/jQuery.getJSON.xml
    +++ b/entries/jQuery.getJSON.xml
    @@ -54,39 +54,46 @@
         

    JSONP

    If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

    The jqXHR Object

    -

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). For convenience and consistency with the callback names used by $.ajax(), it provides .error(), .success(), and .complete() methods. These methods take a function argument that is called when the request terminates, and the function receives the same arguments as the correspondingly-named $.ajax() callback.

    -

    The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.getJSON(), to chain multiple .success(), .complete(), and .error() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

    +

    As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

    +

    The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.getJSON(), to chain multiple .done(), .always(), and .fail() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

    // Assign handlers immediately after making the request,
     // and remember the jqxhr object for this request
    -var jqxhr = $.getJSON("example.json", function() {
    -  alert("success");
    +var jqxhr = $.getJSON( "example.json", function() {
    +  console.log( "success" );
     })
    -.success(function() { alert("second success"); })
    -.error(function() { alert("error"); })
    -.complete(function() { alert("complete"); });
    +.done(function() { console.log( "second success" ); })
    +.fail(function() { console.log( "error" ); })
    +.always(function() { console.log( "complete" ); });
     
     // perform other work here ...
     
     // Set another completion function for the request above
    -jqxhr.complete(function(){ alert("second complete"); });
    +jqxhr.complete(function() { console.log( "second complete" ); });
    +

    Deprecation Notice

    +

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    - Loads the four most recent cat pictures from the Flickr JSONP API. + Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API. + }); +})(); +]]>
    @@ -94,15 +101,21 @@ $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=? Load the JSON data from test.js and access a name from the returned JSON data. - - Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data. - + Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data. + If an error occurs, log an error message instead. + From d6ab15b79c03d1bab591320a9455a637afeacadb Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 20 Mar 2013 09:43:42 -0400 Subject: [PATCH 127/998] Add deprecation-[version] category to deprecated methods --- categories.xml | 5 +++++ entries/deferred.isRejected.xml | 1 + entries/deferred.isResolved.xml | 1 + entries/deferred.pipe.xml | 1 + entries/error.xml | 1 + entries/jQuery.boxModel.xml | 1 + entries/jQuery.browser.xml | 3 ++- entries/load-event.xml | 1 + entries/size.xml | 1 + entries/unload.xml | 1 + 10 files changed, 15 insertions(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index 89e29667..164fc09e 100644 --- a/categories.xml +++ b/categories.xml @@ -36,6 +36,11 @@ + + + Date: Wed, 20 Mar 2013 11:34:30 -0400 Subject: [PATCH 129/998] 1.9.1-4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bd3145cc..630bf085 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": "1.9.1-3", + "version": "1.9.1-4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 7feeb174a9c14160881fb73745d84aec80c9d394 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 20 Mar 2013 12:54:58 -0400 Subject: [PATCH 130/998] $.error(): Remove erroneous deprecated-1.8 category --- entries/jQuery.error.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entries/jQuery.error.xml b/entries/jQuery.error.xml index f993cdde..d2b05376 100644 --- a/entries/jQuery.error.xml +++ b/entries/jQuery.error.xml @@ -17,5 +17,4 @@ - - \ No newline at end of file + From 46d551af2ff09fea0312a1b3d2bfea977fca5168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 25 Mar 2013 14:12:34 -0400 Subject: [PATCH 131/998] attr: Removed unused class in markup. --- entries/attr.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/attr.xml b/entries/attr.xml index 9325defb..8ba679c8 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -29,7 +29,7 @@

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    Concerning boolean attributes, consider a DOM element defined by the HTML markup <input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:

    - +
    @@ -78,10 +78,10 @@ if ( elem.checked )
  • - if ( $(elem).prop("checked") ) + if ( $( elem ).prop( "checked" ) )
  • - if ( $(elem).is(":checked") ) + if ( $( elem ).is( ":checked" ) )
  • The same is true for other dynamic attributes, such as selected and value.

    @@ -90,17 +90,23 @@ Display the checked attribute and property of a checkbox as it changes. + p { + margin: 20px 0 0; + } + b { + color: blue; + } + ]]> + em { + color: blue; + font-weight: bold; + } + div { + color: red; + } + ]]> @@ -162,26 +171,30 @@ var title = $("em").attr("title"); Set one or more attributes for the set of matched elements.

    The .attr() method is a convenient way to set the value of attributes—especially when setting multiple attributes or using values returned by a function. Consider the following image:

    -
    <img id="greatphoto" src="brush-seller.jpg" alt="brush seller" />
    +
    <img id="greatphoto" src="brush-seller.jpg" alt="brush seller">

    Setting a simple attribute

    To change the alt attribute, simply pass the name of the attribute and its new value to the .attr() method:

    -
    $('#greatphoto').attr('alt', 'Beijing Brush Seller');
    +
    
    +$( "#greatphoto" ).attr( "alt", "Beijing Brush Seller" );
    +      

    Add an attribute the same way:

    -
    $('#greatphoto')
    -.attr('title', 'Photo by Kelly Clark');
    +
    
    +$( "#greatphoto" ).attr( "title", "Photo by Kelly Clark" );

    Setting several attributes at once

    To change the alt attribute and add the title attribute at the same time, pass both sets of names and values into the method at once using a plain JavaScript object. Each key-value pair in the object adds or modifies an attribute:

    -
    $('#greatphoto').attr({
    -  alt: 'Beijing Brush Seller',
    -  title: 'photo by Kelly Clark'
    +      
    
    +$( "#greatphoto" ).attr({
    +  alt: "Beijing Brush Seller",
    +  title: "photo by Kelly Clark"
     });

    When setting multiple attributes, the quotes around attribute names are optional.

    WARNING: When setting the 'class' attribute, you must always use quotes!

    Note: jQuery prohibits changing the type attribute on an <input> or <button> element and will throw an error in all browsers. This is because the type attribute cannot be changed in Internet Explorer.

    Computed attribute values

    By using a function to set attributes, you can compute the value based on other properties of the element. For example, to concatenate a new value with an existing value:

    -
    $('#greatphoto').attr('title', function(i, val) {
    -  return val + ' - photo by Kelly Clark'
    +      
    
    +$( "#greatphoto" ).attr( "title", function(i, val) {
    +  return val + " - photo by Kelly Clark"
     });

    This use of a function to compute attribute values can be particularly useful when modifying the attributes of multiple elements at once.

    Note: If nothing is returned in the setter function (ie. function(index, attr){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

    @@ -189,55 +202,66 @@ var title = $("em").attr("title"); Set some attributes for all <img>s in the page. + img { + padding: 10px; + } + div { + color: red; + font-size: 24px; + } + ]]> Set the id for divs based on the position in the page. + div { + color: blue; + } + span { + color: red; + } + b { + font-weight: bolder; + } + ]]> Set the src attribute from title attribute on the image. diff --git a/entries/attribute-contains-prefix-selector.xml b/entries/attribute-contains-prefix-selector.xml index 8b4ffd1e..4eada912 100644 --- a/entries/attribute-contains-prefix-selector.xml +++ b/entries/attribute-contains-prefix-selector.xml @@ -18,17 +18,17 @@ Finds all links with an hreflang attribute that is english. +Some text +Some other text +will not be outlined +]]> diff --git a/entries/attribute-contains-selector.xml b/entries/attribute-contains-selector.xml index aad84065..e07b5662 100644 --- a/entries/attribute-contains-selector.xml +++ b/entries/attribute-contains-selector.xml @@ -17,12 +17,15 @@ Finds all inputs with a name attribute that contains 'man' and sets the value with some text. - - + + diff --git a/entries/attribute-contains-word-selector.xml b/entries/attribute-contains-word-selector.xml index 0a177c0f..18df4cbc 100644 --- a/entries/attribute-contains-word-selector.xml +++ b/entries/attribute-contains-word-selector.xml @@ -17,13 +17,16 @@ Finds all inputs with a name attribute that contains the word 'man' and sets the value with some text. - - + + - \ No newline at end of file + diff --git a/entries/attribute-ends-with-selector.xml b/entries/attribute-ends-with-selector.xml index 390ef443..0febbde7 100644 --- a/entries/attribute-ends-with-selector.xml +++ b/entries/attribute-ends-with-selector.xml @@ -15,12 +15,15 @@ Finds all inputs with an attribute name that ends with 'letter' and puts text in them. - - + + - \ No newline at end of file + diff --git a/entries/attribute-equals-selector.xml b/entries/attribute-equals-selector.xml index a5ab5ef9..555cf7c9 100644 --- a/entries/attribute-equals-selector.xml +++ b/entries/attribute-equals-selector.xml @@ -15,26 +15,30 @@ Finds all inputs with a value of "Hot Fuzz" and changes the text of the next sibling span. - - + + - \ No newline at end of file + diff --git a/entries/attribute-not-equal-selector.xml b/entries/attribute-not-equal-selector.xml index 96b3b782..fabb6a2e 100644 --- a/entries/attribute-not-equal-selector.xml +++ b/entries/attribute-not-equal-selector.xml @@ -13,30 +13,30 @@ Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value. -

    This selector is equivalent to :not([attr="value"]).

    +

    This selector is equivalent to :not([attr='value']).

    - + Finds all inputs that don't have the name 'newsletter' and appends text to the span next to it. - ; not newsletter');]]> - + ; not newsletter" ); +]]> + - \ No newline at end of file + diff --git a/entries/attribute-starts-with-selector.xml b/entries/attribute-starts-with-selector.xml index 5c0a7dec..3c2f6912 100644 --- a/entries/attribute-starts-with-selector.xml +++ b/entries/attribute-starts-with-selector.xml @@ -17,12 +17,15 @@
    Finds all inputs with an attribute name that starts with 'news' and puts text in them. - - + + - \ No newline at end of file + diff --git a/entries/clone.xml b/entries/clone.xml index 79f2cd97..7b92313c 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -25,7 +25,7 @@ <div class="goodbye">Goodbye</div> </div>

    As shown in the discussion for .append(), normally when an element is inserted somewhere in the DOM, it is moved from its old location. So, given the code:

    -
    $('.hello').appendTo('.goodbye');
    +
    $( ".hello" ).appendTo( ".goodbye" );

    The resulting DOM structure would be:

    <div class="container">
       <div class="goodbye">
    @@ -34,7 +34,7 @@
       </div>
     </div>

    To prevent this and instead create a copy of the element, you could write the following:

    -
    $('.hello').clone().appendTo('.goodbye');
    +
    $( ".hello" ).clone().appendTo( ".goodbye" );

    This would produce:

    <div class="container">
       <div class="hello">Hello</div>
    @@ -48,9 +48,9 @@
         
         

    Normally, any event handlers bound to the original element are not copied to the clone. The optional withDataAndEvents parameter allows us to change this behavior, and to instead make copies of all of the event handlers as well, bound to the new copy of the element. As of jQuery 1.4, all element data (attached by the .data() method) is also copied to the new copy.

    However, objects and arrays within element data are not copied and will continue to be shared between the cloned element and the original element. To deep copy all data, copy each one manually:

    -
    var $elem = $('#elem').data( "arr": [ 1 ] ), // Original element with attached data
    +    
    var $elem = $( "#elem" ).data( "arr": [ 1 ] ), // Original element with attached data
         $clone = $elem.clone( true )
    -    .data( "arr", $.extend( [], $elem.data("arr") ) ); // Deep copy to prevent data sharing
    +      .data( "arr", $.extend( [], $elem.data( "arr" ) ) ); // Deep copy to prevent data sharing
     

    As of jQuery 1.5, withDataAndEvents can be optionally enhanced with deepWithDataAndEvents to copy the events and data for all children of the cloned element.

    @@ -60,10 +60,10 @@ Clones all b elements (and selects the clones) and prepends them to all paragraphs. From 8b21f8886f2117430c5d79a1b389b17cbda4f88e Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Sat, 6 Jul 2013 09:53:08 +0100 Subject: [PATCH 224/998] Code indentation and formatting (b entries). --- entries/before.xml | 85 +++++++++++----- entries/bind.xml | 189 +++++++++++++++++++++--------------- entries/blur.xml | 28 +++--- entries/button-selector.xml | 62 +++++++----- 4 files changed, 229 insertions(+), 135 deletions(-) diff --git a/entries/before.xml b/entries/before.xml index 2f1f8bdf..19a957b0 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -26,63 +26,100 @@ Insert content, specified by the parameter, before each element in the set of matched elements. -

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    +

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    You can create content and insert it before several elements at once:

    -
    $('.inner').before('<p>Test</p>');
    +
    
    +$( ".inner" ).before( "<p>Test</p>" );
    +    

    Each inner <div> element gets this new content:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <p>Test</p>
       <div class="inner">Hello</div>
       <p>Test</p>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    You can also select an element on the page and insert it before another:

    -
    $('.container').before($('h2'));
    +
    
    +$( ".container" ).before( $( "h2" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned):

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    In jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes:

    -
    $("<div/>").before("<p></p>");
    +
    
    +$( "<div/>" ).before( "<p></p>" );
    +	

    The result is a jQuery set that contains a paragraph and a div (in that order).

    Additional Arguments

    Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> before the first paragraph:

    -
    var $newdiv1 = $('<div id="object1"/>'),
    -    newdiv2 = document.createElement('div'),
    -    existingdiv1 = document.getElementById('foo');
    +    
    
    +var $newdiv1 = $( "<div id='object1'/>" ),
    +  newdiv2 = document.createElement( "div" ),
    +  existingdiv1 = document.getElementById( "foo" );
     
    -$('p').first().before($newdiv1, [newdiv2, existingdiv1]);
    +$( "p" ).first().before( $newdiv1, [ newdiv2, existingdiv1 ] );
     
    -

    Since .before() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('p').first().before($newdiv1, newdiv2, existingdiv1). The type and number of arguments will largely depend on how you collect the elements in your code.

    +

    Since .before() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().before( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    Inserts some HTML before all paragraphs. - - - + + + Inserts a DOM element before all paragraphs. - - - + + + Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs. - - - + + + diff --git a/entries/bind.xml b/entries/bind.xml index f1206f0f..0d23acde 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -35,27 +35,27 @@

    As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

    Any string is legal for eventType; if the string is not the name of a native DOM event, then the handler is bound to a custom event. These events are never called by the browser, but may be triggered manually from other JavaScript code using .trigger() or .triggerHandler().

    -

    If the eventType string contains a period (.) character, then the event is namespaced. The period character separates the event from its namespace. For example, in the call .bind('click.name', handler), the string click is the event type, and the string name is the namespace. Namespacing allows us to unbind or trigger some events of a type without affecting others. See the discussion of .unbind() for more information.

    +

    If the eventType string contains a period (.) character, then the event is namespaced. The period character separates the event from its namespace. For example, in the call .bind( "click.name", handler ), the string click is the event type, and the string name is the namespace. Namespacing allows us to unbind or trigger some events of a type without affecting others. See the discussion of .unbind() for more information.

    There are shorthand methods for some standard browser events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

    When an event reaches an element, all handlers bound to that event type for the element are fired. If there are multiple handlers registered, they will always execute in the order in which they were bound. After all handlers have executed, the event continues along the normal event propagation path.

    A basic usage of .bind() is:

    
    -$('#foo').bind('click', function() {
    -  alert('User clicked on "foo."');
    +$( "#foo" ).bind( "click", function() {
    +  alert( "User clicked on 'foo.'" );
     });
    -
    +

    This code will cause the element with an ID of foo to respond to the click event. When a user clicks inside this element thereafter, the alert will be shown.

    Multiple Events

    Multiple event types can be bound at once by including each one separated by a space:

    
    -$('#foo').bind('mouseenter mouseleave', function() {
    -  $(this).toggleClass('entered');
    +$( "#foo" ).bind( "mouseenter mouseleave", function() {
    +  $( this ).toggleClass( "entered" );
     });
    -
    +

    The effect of this on <div id="foo"> (when it does not initially have the "entered" class) is to add the "entered" class when the mouse enters the <div> and remove the class when the mouse leaves.

    As of jQuery 1.4 we can bind multiple event handlers simultaneously by passing an object of event type/handler pairs:

    
    -$('#foo').bind({
    +$( "#foo" ).bind({
       click: function() {
         // do something on click
       },
    @@ -63,13 +63,14 @@ $('#foo').bind({
         // do something on mouseenter
       }
     });
    -
    +

    Event Handlers

    The handler parameter takes a callback function, as shown above. Within the handler, the keyword this refers to the DOM element to which the handler is bound. To make use of the element in jQuery, it can be passed to the normal $() function. For example:

    -
    $('#foo').bind('click', function() {
    -  alert($(this).text());
    +    
    
    +$( "#foo" ).bind( "click", function() {
    +  alert( $( this ).text() );
     });
    -
    +

    After this code is executed, when the user clicks inside the element with an ID of foo, its text contents will be shown as an alert.

    As of jQuery 1.4.2 duplicate event handlers can be bound to an element instead of being discarded. This is useful when the event data feature is being used, or when other unique data resides in a closure around the event handler function.

    @@ -81,36 +82,44 @@ $('#foo').bind({

    The event object is often unnecessary and the parameter omitted, as sufficient context is usually available when the handler is bound to know exactly what needs to be done when the handler is triggered. However, at times it becomes necessary to gather more information about the user's environment at the time the event was initiated. View the full Event Object.

    Returning false from a handler is equivalent to calling both .preventDefault() and .stopPropagation() on the event object.

    Using the event object in a handler looks like this:

    -
    $(document).ready(function() {
    -  $('#foo').bind('click', function(event) {
    -    alert('The mouse cursor is at ('
    -      + event.pageX + ', ' + event.pageY + ')');
    +    
    
    +$( document ).ready(function() {
    +  $( "#foo" ).bind( "click", function(event) {
    +    alert( "The mouse cursor is at (" + 
    +      event.pageX + ", " + event.pageY + 
    +      ")" );
       });
     });
    -
    +

    Note the parameter added to the anonymous function. This code will cause a click on the element with ID foo to report the page coordinates of the mouse cursor at the time of the click.

    Passing Event Data

    The optional eventData parameter is not commonly used. When provided, this argument allows us to pass additional information to the handler. One handy use of this parameter is to work around issues caused by closures. For example, suppose we have two event handlers that both refer to the same external variable:

    -
    var message = 'Spoon!';
    -$('#foo').bind('click', function() {
    -  alert(message);
    +    
    
    +var message = "Spoon!";
    +$( "#foo" ).bind( "click", function() {
    +  alert( message );
     });
    -message = 'Not in the face!';
    -$('#bar').bind('click', function() {
    -  alert(message);
    +message = "Not in the face!";
    +$( "#bar" ).bind( "click", function() {
    +  alert( message );
     });
    -
    +

    Because the handlers are closures that both have message in their environment, both will display the message Not in the face! when triggered. The variable's value has changed. To sidestep this, we can pass the message in using eventData:

    -
    var message = 'Spoon!';
    -$('#foo').bind('click', {msg: message}, function(event) {
    -  alert(event.data.msg);
    +    
    
    +var message = "Spoon!";
    +$( "#foo" ).bind( "click", {
    +  msg: message
    +}, function(event) {
    +  alert( event.data.msg );
     });
    -message = 'Not in the face!';
    -$('#bar').bind('click', {msg: message}, function(event) {
    -  alert(event.data.msg);
    +message = "Not in the face!";
    +$( "#bar" ).bind( "click", {
    +  msg: message
    +}, function(event) {
    +  alert( event.data.msg );
     });
    -
    +

    This time the variable is not referred to directly within the handlers; instead, the variable is passed in by value through eventData, which fixes the value at the time the event is bound. The first handler will now display Spoon! while the second will alert Not in the face!

    @@ -126,92 +135,120 @@ $('#bar').bind('click', {msg: message}, function(event) { Handle click and double-click for the paragraph. Note: the coordinates are window relative, so in this case relative to the demo iframe. - + p { + background: yellow; + font-weight: bold; + cursor: pointer; + padding: 5px; + } + p.over { + background: #ccc; + } + span { + color: red; + } + ]]> + To display each paragraph's text in an alert box whenever it is clicked: - + You can pass some extra data before the event handler: - +$( "p" ).bind( "click", { + foo: "bar" +}, handler ) +]]> Cancel a default action and prevent it from bubbling up by returning false: - + Cancel only the default action by using the .preventDefault() method. - + Stop an event from bubbling without preventing the default action by using the .stopPropagation() method. - +}); +]]> Bind custom events. + p { + color:red; + } + span { + color:blue; + } + ]]> Bind multiple events simultaneously. - +}); +]]> diff --git a/entries/blur.xml b/entries/blur.xml index b174bb66..a42ee762 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -21,34 +21,40 @@ 1.0 -

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

    +

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

    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:

    -
    <form>
    -  <input id="target" type="text" value="Field 1" />
    -  <input type="text" value="Field 2" />
    +    
    
    +<form>
    +  <input id="target" type="text" value="Field 1">
    +  <input type="text" value="Field 2">
     </form>
     <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.');
    -});
    +$( "#target" ).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.

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

    -
    $('#other').click(function() {
    -  $('#target').blur();
    -});
    +
    
    +$( "#other" ).click(function() {
    +  $( "#target" ).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().

    To trigger the blur event on all paragraphs: - + diff --git a/entries/button-selector.xml b/entries/button-selector.xml index 1c66a46e..78c132ab 100644 --- a/entries/button-selector.xml +++ b/entries/button-selector.xml @@ -7,48 +7,62 @@ Selects all button elements and elements of type button. -

    An equivalent selector to $(":button") using valid CSS is $("button, input[type='button']").

    +

    An equivalent selector to $( ":button" ) using valid CSS is $( "button, input[type='button']" ).

    Find all button inputs and mark them. - + +
    +]]>
    - \ No newline at end of file + From 0683cb29f291102856da3fdc0b12f52d4c7a4b41 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Sat, 6 Jul 2013 10:26:51 +0100 Subject: [PATCH 225/998] Code indentation and formatting (c entries). --- entries/ajaxStart.xml | 5 +- entries/animate.xml | 267 +++++++++++++++++++-------------- entries/attr.xml | 17 ++- entries/callbacks.fireWith.xml | 2 +- entries/callbacks.lock.xml | 12 +- entries/change.xml | 77 ++++++---- entries/checkbox-selector.xml | 70 +++++---- entries/checked-selector.xml | 10 +- entries/child-selector.xml | 18 ++- entries/children.xml | 179 ++++++++++++++-------- entries/class-selector.xml | 36 +++-- entries/clearQueue.xml | 59 +++++--- entries/click.xml | 53 ++++--- entries/clone.xml | 31 ++-- entries/closest.xml | 72 +++++---- entries/contains-selector.xml | 6 +- entries/contents.xml | 46 ++++-- entries/context.xml | 18 +-- entries/css.xml | 165 ++++++++++++-------- 19 files changed, 702 insertions(+), 441 deletions(-) diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index 7a458c8a..5b57808e 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -18,7 +18,7 @@

    Attach the event handler to any element:

    
    -$(document).ajaxStart(function() {
    +$( document ).ajaxStart(function() {
       $( ".log" ).text( "Triggered ajaxStart handler." );
     });
         
    @@ -34,7 +34,8 @@ $( ".trigger" ).click(function() { Show a loading message whenever an Ajax request starts (and none is already active). - diff --git a/entries/animate.xml b/entries/animate.xml index 6c84aefb..08734836 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -28,7 +28,7 @@

    In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element. In order to use jQuery's built-in toggle state tracking, the 'toggle' keyword must be consistently given as the value of the property being animated.

    Animated properties can also be relative. If a value is supplied with a leading += or -= sequence of characters, then the target value is computed by adding or subtracting the given number from the current value of the property.

    -

    Note: Unlike shorthand animation methods such as .slideDown() and .fadeIn(), the .animate() method does not make hidden elements visible as part of the effect. For example, given $('someElement').hide().animate({height:'20px'}, 500), the animation will run, but the element will remain hidden.

    +

    Note: Unlike shorthand animation methods such as .slideDown() and .fadeIn(), the .animate() method does not make hidden elements visible as part of the effect. For example, given $( "someElement" ).hide().animate({height: "20px"}, 500), the animation will run, but the element will remain hidden.

    Duration

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The default duration is 400 milliseconds. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    @@ -36,22 +36,25 @@

    If supplied, the complete callback function is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, the callback is executed once per matched element, not once for the animation as a whole.

    Basic Usage

    To animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
     <img id="book" src="book.png" alt="" width="100" height="123"
    -  style="position: relative; left: 10px;" />
    + style="position: relative; left: 10px;"> +

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

    -
    $('#clickme').click(function() {
    -  $('#book').animate({
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).animate({
         opacity: 0.25,
    -    left: '+=50',
    -    height: 'toggle'
    +    left: "+=50",
    +    height: "toggle"
       }, 5000, function() {
         // Animation complete.
       });
     });
    -
    +

    @@ -69,64 +72,67 @@

    Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

    Step Function

    -

    The second version of .animate() provides a step option — a callback function that is fired at each step of the animation. This function is useful for enabling custom animation types or altering the animation as it is occurring. It accepts two arguments (now and fx), and this is set to the DOM element being animated. -

    +

    The second version of .animate() provides a step option — a callback function that is fired at each step of the animation. This function is useful for enabling custom animation types or altering the animation as it is occurring. It accepts two arguments (now and fx), and this is set to the DOM element being animated.

    • now: the numeric value of the property being animated at each step
    • fx: a reference to the jQuery.fx prototype object, which contains a number of properties such as elem for the animated element, start and end for the first and last value of the animated property, respectively, and prop for the property being animated.

    Note that the step function is called for each animated property on each animated element. For example, given two list items, the step function fires four times at each step of the animation:

    -
    $('li').animate({
    +    
    
    +$( "li" ).animate({
       opacity: .5,
    -  height: '50%'
    -},
    -{
    -  step: function(now, fx) {
    -    var data = fx.elem.id + ' ' + fx.prop + ': ' + now;
    -    $('body').append('<div>' + data + '</div>');
    +  height: "50%"
    +  }, {
    +  step: function( now, fx ) {
    +    var data = fx.elem.id + " " + fx.prop + ": " + now;
    +    $( "body" ).append( "<div>" + data + "</div>" );
       }
    -});
    +}); +

    Easing

    The remaining parameter of .animate() is a string naming an easing function to use. An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Per-property Easing

    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() {
    -  $('#book').animate({
    -    width: ['toggle', 'swing'],
    -    height: ['toggle', 'swing'],
    -    opacity: 'toggle'
    -  }, 5000, 'linear', function() {
    -      $(this).after('<div>Animation complete.</div>');
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).animate({
    +    width: [ "toggle", "swing" ],
    +    height: [ "toggle", "swing" ],
    +    opacity: "toggle"
    +  }, 5000, "linear", function() {
    +    $( this ).after( "<div>Animation complete.</div>" );
       });
    -});
    +}); +

    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() {
    -  $('#book').animate({
    -    width: 'toggle',
    -    height: 'toggle'
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).animate({
    +    width: "toggle",
    +    height: "toggle"
       }, {
         duration: 5000,
         specialEasing: {
    -      width: 'linear',
    -      height: 'easeOutBounce'
    +      width: "linear",
    +      height: "easeOutBounce"
         },
         complete: function() {
    -      $(this).after('<div>Animation complete.</div>');
    +      $( this ).after( "<div>Animation complete.</div>" );
         }
       });
    -});
    +}); +

    As previously noted, a plugin is required for the easeOutBounce function.

    Click the button to animate the div with a number of different properties. - + + div { + background-color: #bca; + width: 100px; + border: 1px solid green; + } + ]]> Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up. - + div { + position: absolute; + background-color: #abc; + left: 50px; + width: 90px; + height: 90px; + margin: 5px; + } + ]]> The first button shows how an unqueued animation works. It expands the div out to 90% width while the font-size is increasing. Once the font-size change is complete, the border animation will begin. The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed. - +
    Block2
    +]]> + div { + background-color: #bca; + width: 200px; + height: 1.1em; + text-align: center; + border: 2px solid green; + margin: 3px; + font-size: 14px; + } + button { + font-size: 14px; + } + ]]>
    Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. @@ -236,15 +251,15 @@ $( "#go" ).click(function(){ }); ]]> + div { + position: relative; + background-color: #abc; + width: 40px; + height: 40px; + float: left; + margin: 5px; + } + ]]> + Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. - Animate the left and opacity style properties of all paragraphs; run the animation outside the queue, so that it will automatically start without waiting for its turn. - + An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. Note, this code will do nothing unless the paragraph element is hidden. - +}, "slow", "easein" ); +]]> Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. - + Use an easing function to provide a different style of animation. This will only work if you have a plugin that provides this easing function. - +}, { + duration: "slow", + easing: "easein" +}); +]]> Animate all paragraphs and execute a callback function when the animation is complete. The first argument is an object of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. - diff --git a/entries/attr.xml b/entries/attr.xml index 1ce77944..e1a1707b 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -186,7 +186,8 @@ $( "#greatphoto" ).attr( "title", "Photo by Kelly Clark" ); $( "#greatphoto" ).attr({ alt: "Beijing Brush Seller", title: "photo by Kelly Clark" -}); +}); +

    When setting multiple attributes, the quotes around attribute names are optional.

    WARNING: When setting the 'class' attribute, you must always use quotes!

    Note: jQuery prohibits changing the type attribute on an <input> or <button> element and will throw an error in all browsers. This is because the type attribute cannot be changed in Internet Explorer.

    @@ -195,7 +196,8 @@ $( "#greatphoto" ).attr({
    
     $( "#greatphoto" ).attr( "title", function(i, val) {
       return val + " - photo by Kelly Clark"
    -});
    +}); +

    This use of a function to compute attribute values can be particularly useful when modifying the attributes of multiple elements at once.

    Note: If nothing is returned in the setter function (ie. function(index, attr){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

    @@ -229,11 +231,12 @@ $( "div" ).text( $( "img" ).attr( "alt" ) ); Set the id for divs based on the position in the page. diff --git a/entries/callbacks.lock.xml b/entries/callbacks.lock.xml index a660ef59..82b523a4 100644 --- a/entries/callbacks.lock.xml +++ b/entries/callbacks.lock.xml @@ -11,7 +11,8 @@ Use callbacks.lock() to lock a callback list to avoid further changes being made to the list state: - Use callbacks.lock() to lock a callback list with "memory," and then resume using the list: - - + - + To add a validity test to all text input elements: - + diff --git a/entries/checkbox-selector.xml b/entries/checkbox-selector.xml index 8efc5a13..7e3ed301 100644 --- a/entries/checkbox-selector.xml +++ b/entries/checkbox-selector.xml @@ -7,47 +7,61 @@ Selects all elements of type checkbox. -

    $(':checkbox') is equivalent to $('[type=checkbox]'). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':checkbox') is equivalent to $('*:checkbox'), so $('input:checkbox') should be used instead.

    +

    $( ":checkbox" ) is equivalent to $( "[type=checkbox]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':checkbox') is equivalent to $( "*:checkbox" ), so $( "input:checkbox" ) should be used instead.

    Finds all checkbox inputs. - +
    +]]>
    - \ No newline at end of file + diff --git a/entries/checked-selector.xml b/entries/checked-selector.xml index 614e54e0..a7fcab5b 100644 --- a/entries/checked-selector.xml +++ b/entries/checked-selector.xml @@ -21,7 +21,9 @@ countChecked(); $( "input[type=checkbox]" ).on( "click", countChecked ); ]]>
    + input, label { + line-height: 1.5em; + } + ]]>
    + + body { + font-size: 14px; + } + ]]> - +
    + This the way we write the demo so + in +
    + +

    + the morning. + Found 0 children in TAG. +

    + +]]>
    Find all children of each div. - + - +
    And One Last Time (most text directly in a div)
    +]]>
    Find all children with a class "selected" of each div. - + - +

    And One Last Time

    + +]]>
    diff --git a/entries/class-selector.xml b/entries/class-selector.xml index 34dca2a9..06df8d4e 100644 --- a/entries/class-selector.xml +++ b/entries/class-selector.xml @@ -14,16 +14,19 @@ Finds the element with the class "myClass". - - + + - + + +}); +]]> - + +
    +]]>
    - \ No newline at end of file + diff --git a/entries/click.xml b/entries/click.xml index 7c76e5ce..699e7b13 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -21,30 +21,36 @@ 1.0 -

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

    This method is a shortcut for .on( "click", handler ) in the first two variations, and .trigger( "click" ) in the third. The click event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed and released. Any HTML element can receive this event. For example, consider the HTML:

    -
    <div id="target">
    +    
    
    +<div id="target">
       Click here
     </div>
     <div id="other">
       Trigger the handler
    -</div>
    +</div> +

    The event handler can be bound to any <div>:

    -
    $("#target").click(function() {
    -  alert("Handler for .click() called.");
    -});
    +
    
    +$( "#target" ).click(function() {
    +  alert( "Handler for .click() called." );
    +});
    +    

    Now if we click on this element, the alert is displayed:

    Handler for .click() called.

    We can also trigger the event when a different element is clicked:

    -
    $("#other").click(function() {
    -  $("#target").click();
    -});
    +
    
    +$( "#other" ).click(function() {
    +  $( "#target" ).click();
    +});
    +

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

    The click event is only triggered after this exact series of events:

      @@ -56,22 +62,31 @@ Hide paragraphs on a page when they are clicked: - + Trigger the click event on all of the paragraphs on the page: - + diff --git a/entries/clone.xml b/entries/clone.xml index 7b92313c..5fd0dd93 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -20,38 +20,49 @@

      The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied to the cloned elements. The clone operation sets these fields to their default values as specified in the HTML.

      When used in conjunction with one of the insertion methods, .clone() is a convenient way to duplicate elements on a page. Consider the following HTML:

      -
      <div class="container">
      +    
      
      +<div class="container">
         <div class="hello">Hello</div>
         <div class="goodbye">Goodbye</div>
      -</div>
      +</div> +

      As shown in the discussion for .append(), normally when an element is inserted somewhere in the DOM, it is moved from its old location. So, given the code:

      -
      $( ".hello" ).appendTo( ".goodbye" );
      +
      
      +$( ".hello" ).appendTo( ".goodbye" );
      +    

      The resulting DOM structure would be:

      -
      <div class="container">
      +    
      
      +<div class="container">
         <div class="goodbye">
           Goodbye
           <div class="hello">Hello</div>
         </div>
      -</div>
      +</div> +

      To prevent this and instead create a copy of the element, you could write the following:

      -
      $( ".hello" ).clone().appendTo( ".goodbye" );
      +
      
      +$( ".hello" ).clone().appendTo( ".goodbye" );
      +    

      This would produce:

      -
      <div class="container">
      +    
      
      +<div class="container">
         <div class="hello">Hello</div>
         <div class="goodbye">
           Goodbye
           <div class="hello">Hello</div>
         </div>
      -</div>
      +</div> +

      Note: When using the .clone() method, you can modify the cloned elements or their contents before (re-)inserting them into the document.

      Normally, any event handlers bound to the original element are not copied to the clone. The optional withDataAndEvents parameter allows us to change this behavior, and to instead make copies of all of the event handlers as well, bound to the new copy of the element. As of jQuery 1.4, all element data (attached by the .data() method) is also copied to the new copy.

      However, objects and arrays within element data are not copied and will continue to be shared between the cloned element and the original element. To deep copy all data, copy each one manually:

      -
      var $elem = $( "#elem" ).data( "arr": [ 1 ] ), // Original element with attached data
      +    
      
      +var $elem = $( "#elem" ).data( "arr": [ 1 ] ), // Original element with attached data
           $clone = $elem.clone( true )
             .data( "arr", $.extend( [], $elem.data( "arr" ) ) ); // Deep copy to prevent data sharing
      -
      +

      As of jQuery 1.5, withDataAndEvents can be optionally enhanced with deepWithDataAndEvents to copy the events and data for all children of the cloned element.

      Note: Using .clone() has the side-effect of producing elements with duplicate id attributes, which are supposed to be unique. Where possible, it is recommended to avoid cloning elements with this attribute or using class attributes as identifiers instead.

      diff --git a/entries/closest.xml b/entries/closest.xml index 24fbd851..c3716fdc 100644 --- a/entries/closest.xml +++ b/entries/closest.xml @@ -78,36 +78,48 @@ </li> <li class="item-iii">III</li> </ul> - +

      Suppose we perform a search for <ul> elements starting at item A:

      
      -$('li.item-a').closest('ul')
      -  .css('background-color', 'red');
      -
      +$( "li.item-a" ) + .closest( "ul" ) + .css("background-color", "red" ); +

      This will change the color of the level-2 <ul>, since it is the first encountered when traveling up the DOM tree.

      Suppose we search for an <li> element instead:

      -
      $('li.item-a').closest('li')
      -  .css('background-color', 'red');
      -
      +
      
      +$( "li.item-a" )
      +  .closest( "li" )
      +  .css( "background-color", "red" );
      +      

      This will change the color of list item A. The .closest() method begins its search with the element itself before progressing up the DOM tree, and stops when item A matches the selector.

      We can pass in a DOM element as the context within which to search for the closest element.

      -
      var listItemII = document.getElementById('ii');
      -$('li.item-a').closest('ul', listItemII)
      -  .css('background-color', 'red');
      -$('li.item-a').closest('#one', listItemII)
      -  .css('background-color', 'green');
      +
      
      +var listItemII = document.getElementById( "ii" );
      +$( "li.item-a" )
      +  .closest( "ul", listItemII )
      +  .css( "background-color", "red" );
      +$( "li.item-a" )
      +  .closest('#one', listItemII )
      +  .css( "background-color", "green" );

      This will change the color of the level-2 <ul>, because it is both the first <ul> ancestor of list item A and a descendant of list item II. It will not change the color of the level-1 <ul>, however, because it is not a descendant of list item II.

      Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked. - + @@ -148,7 +168,7 @@ $('li.item-a').closest('#one', listItemII) Get an array of all the elements and selectors matched against the current element up through the DOM tree. -

      This signature (only!) is deprecated as of jQuery 1.7 and removed in jQuery 1.8. It was primarily meant to be used internally or by plugin authors.

      +
      This signature (only!) is deprecated as of jQuery 1.7 and removed in jQuery 1.8. It was primarily meant to be used internally or by plugin authors.
      diff --git a/entries/contains-selector.xml b/entries/contains-selector.xml index 005a0559..a08adaf5 100644 --- a/entries/contains-selector.xml +++ b/entries/contains-selector.xml @@ -15,14 +15,14 @@ Finds all divs containing "John" and underlines them. +$( "div:contains('John')" ).css( "text-decoration", "underline" ); +]]> +]]> diff --git a/entries/contents.xml b/entries/contents.xml index fb0bebdc..7e1026ca 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -8,39 +8,55 @@

      Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search throughthe immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes as well as HTML elements in the resulting jQuery object.

      The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

      -

      Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br />):

      -
      <div class="container">
      +    

      Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br>):

      +
      
      +<div class="container">
         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed 
         do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
      -  <br /><br />
      +  <br><br>
         Ut enim ad minim veniam, quis nostrud exercitation ullamco 
         laboris nisi ut aliquip ex ea commodo consequat.
      -  <br /> <br />
      +  <br><br>
         Duis aute irure dolor in reprehenderit in voluptate velit 
         esse cillum dolore eu fugiat nulla pariatur.
       </div>
       

      We can employ the .contents() method to help convert this blob of text into three well-formed paragraphs:

      
      -$('.container').contents().filter(function() {
      -  return this.nodeType == 3;
      -})
      -  .wrap('<p></p>')
      -.end()
      -.filter('br')
      +$( ".container" )
      +  .contents()
      +  .filter(function() {
      +    return this.nodeType == 3;
      +  })
      +  .wrap( "<p></p>" )
      +  .end()
      +  .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.

      Find all the text nodes inside a paragraph and wrap them with a bold tag. - - + + Change the background colour of links inside of an iframe. - - + + diff --git a/entries/context.xml b/entries/context.xml index 450e2b8b..3e07e4ae 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -13,18 +13,14 @@ Determine the exact context used. - - - + diff --git a/entries/css.xml b/entries/css.xml index 79f874d4..b3c5e258 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -18,61 +18,84 @@ Get the value of style properties for the first element in the set of matched elements.

      The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

      -

      Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css('background-color') and .css('backgroundColor'). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

      -

      Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on.

      +

      Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

      +

      Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $( elem ).css( "marginTop" ) and $( elem ).css( "marginRight" ), and so on.

      As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs.

      Get the background color of a clicked div. +
      +]]>
      Get the width, height, text color, and background color of a clicked div. " ) ); }); - ]]> + div { + height: 50px; + margin: 5px; + padding: 5px; + float: left; + } + #box1 { + width: 50px; + color: yellow; + background-color: blue; + } + #box2 { + width: 80px; + color: rgb(255,255,255); + background-color: rgb(15,99,30); + } + #box3 { + width: 40px; + color: #fcc; + background-color: #123456; + } + #box4 { + width: 70px; + background-color: #f11; + } + ]]> +
      4
      +]]>
      @@ -110,25 +133,30 @@ div { height: 50px; margin: 5px; padding: 5px; float: left; } Set one or more CSS properties for the set of matched elements.

      As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

      -

      Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({'background-color': '#ffe', 'border-left': '5px solid #ccc'}) and .css({backgroundColor: '#ffe', borderLeft: '5px solid #ccc'}). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

      -

      When using .css() as a setter, jQuery modifies the element's style property. For example, $('#mydiv').css('color', 'green') is equivalent to document.getElementById('mydiv').style.color = 'green'. Setting the value of a style property to an empty string — e.g. $('#mydiv').css('color', '') — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background> will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

      +

      Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

      +

      When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background> will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

      As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

      As of jQuery 1.4, .css() allows us to pass a function as the property value:

      -
      $('div.example').css('width', function(index) {
      +      
      
      +$( "div.example" ).css( "width", function( index ) {
         return index * 50;
       });

      This example sets the widths of the matched elements to incrementally larger values.

      -

      Note: If nothing is returned in the setter function (ie. function(index, style){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

      +

      Note: If nothing is returned in the setter function (ie. function( index, style ){} ), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

      Change the color of any paragraph to red on mouseover event.
      +
      Click me to grow
      +]]> Highlight a clicked word in the paragraph. +

      +]]>
      Change the font weight and background color on mouseenter and mouseleave. From 278a81a77e1f95a71039739269a3ed68c1b7d73c Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Mon, 8 Jul 2013 23:05:06 +0100 Subject: [PATCH 226/998] Code indentation and formatting (d entries). --- entries/data.xml | 122 ++++++++++++++++++++--------------- entries/dblclick.xml | 56 ++++++++++------ entries/deferred.always.xml | 6 +- entries/deferred.done.xml | 28 ++++---- entries/deferred.fail.xml | 10 ++- entries/deferred.pipe.xml | 1 - entries/deferred.promise.xml | 62 +++++++++--------- entries/deferred.state.xml | 2 +- entries/deferred.then.xml | 10 +-- entries/delay.xml | 37 +++++++---- entries/delegate.xml | 106 ++++++++++++++++++------------ entries/dequeue.xml | 40 +++++++----- 12 files changed, 285 insertions(+), 195 deletions(-) diff --git a/entries/data.xml b/entries/data.xml index 52c4fa58..00bee577 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -23,13 +23,12 @@

      The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks.

      We can set several distinct values for a single element and retrieve them later:

      
      -$("body").data("foo", 52);
      -$("body").data("bar", { myType: "test", count: 40 });
      -$("body").data({ baz: [ 1, 2, 3 ] });
      -
      -$("body").data("foo"); // 52
      -$("body").data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }
      -
      +$( "body" ).data( "foo", 52 ); +$( "body" ).data( "bar", { myType: "test", count: 40 } ); +$( "body" ).data( { baz: [ 1, 2, 3 ] } ); +$( "body" ).data( "foo" ); // 52 +$( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] } +

      In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element. jQuery itself uses the .data() method to save information under the names 'events' and 'handle', and also reserves any data name starting with an underscore ('_') for internal use.

      Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

      Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

      @@ -38,20 +37,26 @@ $("body").data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, Store then retrieve a value from the div element. - + @@ -73,15 +78,15 @@ $("span:last").text($("div").data("test").last);

      The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks. We can retrieve several distinct values for a single element one at a time, or as a set:

      
      -alert($('body').data('foo'));
      -alert($('body').data());
      -
      +alert( $( "body" ).data( "foo" ) ); +alert( $( "body" ).data() ); +

      The above lines alert the data values that were set on the body element. If no data at all was set on that element, undefined is returned.

      
      -alert( $("body").data("foo")); //undefined
      -$("body").data("bar", "foobar");
      -alert( $("body").data("bar")); //foobar
      -
      +alert( $( "body" ).data( "foo" ) ); //undefined +$( "body" ).data( "bar", "foobar" ); +alert( $( "body" ).data( "bar" ) ); //foobar +

      HTML5 data-* Attributes

      @@ -89,65 +94,78 @@ alert( $("body").data("bar")); //foobar

      For example, given the following HTML:

      <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>

      All of the following jQuery code will work.

      -
      $("div").data("role") === "page";
      -$("div").data("lastValue") === 43;
      -$("div").data("hidden") === true;
      -$("div").data("options").name === "John";
      +
      
      +$( "div" ).data( "role" ) === "page";
      +$( "div" ).data( "lastValue" ) === 43;
      +$( "div" ).data( "hidden" ) === true;
      +$( "div" ).data( "options" ).name === "John";
      +      

      Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

      When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

      To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

      The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

      Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

      
      -var mydata = $("#mydiv").data();
      +var mydata = $( "#mydiv" ).data();
       if ( mydata.count < 9 ) {
      -    mydata.count = 43;
      -    mydata.status = "embiggened";
      +  mydata.count = 43;
      +  mydata.status = "embiggened";
       }
      -
      +
      Get the data named "blah" stored at for an element. - + diff --git a/entries/dblclick.xml b/entries/dblclick.xml index f1b12dba..f3de4e57 100644 --- a/entries/dblclick.xml +++ b/entries/dblclick.xml @@ -21,30 +21,36 @@ 1.0 -

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

      This method is a shortcut for .on( "dblclick", handler) in the first two variations, and .trigger( "dblclick" ) in the third. The dblclick event is sent to an element when the element is double-clicked. Any HTML element can receive this event. For example, consider the HTML:

      -
      <div id="target">
      +    
      
      +<div id="target">
         Double-click here
       </div>
       <div id="other">
         Trigger the handler
      -</div>
      +</div> +

      The event handler can be bound to any <div>:

      -
      $('#target').dblclick(function() {
      -  alert('Handler for .dblclick() called.');
      -});
      +
      
      +$( "#target" ).dblclick(function() {
      +  alert( "Handler for .dblclick() called." );
      +});
      +    

      Now double-clicking on this element displays the alert:

      Handler for .dblclick() called.

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

      -
      $('#other').click(function() {
      -  $('#target').dblclick();
      -});
      +
      
      +$( "#other" ).click(function() {
      +  $( "#target" ).dblclick();
      +});
      +    

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

      The dblclick event is only triggered after this exact series of events:

        @@ -58,25 +64,35 @@ To bind a "Hello World!" alert box the dblclick event on every paragraph on the page: - + Double click to toggle background color. - + diff --git a/entries/deferred.always.xml b/entries/deferred.always.xml index a7269094..0389d852 100644 --- a/entries/deferred.always.xml +++ b/entries/deferred.always.xml @@ -21,9 +21,9 @@ Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. diff --git a/entries/deferred.done.xml b/entries/deferred.done.xml index 9592c8ba..95ebfb57 100644 --- a/entries/deferred.done.xml +++ b/entries/deferred.done.xml @@ -21,8 +21,8 @@ Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method. @@ -31,13 +31,13 @@ $.get("test.php").done(function() { diff --git a/entries/deferred.fail.xml b/entries/deferred.fail.xml index 61d30d59..32c0a593 100644 --- a/entries/deferred.fail.xml +++ b/entries/deferred.fail.xml @@ -21,9 +21,13 @@ Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. diff --git a/entries/deferred.pipe.xml b/entries/deferred.pipe.xml index 00fa1dfc..17058a9a 100644 --- a/entries/deferred.pipe.xml +++ b/entries/deferred.pipe.xml @@ -76,7 +76,6 @@ var request = $.ajax( url, { dataType: "json" } ), chained.done(function( data ) { // data retrieved from url2 as provided by the first request }); - ]]> diff --git a/entries/deferred.promise.xml b/entries/deferred.promise.xml index bb49dd23..c3976a51 100644 --- a/entries/deferred.promise.xml +++ b/entries/deferred.promise.xml @@ -17,42 +17,42 @@ Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. @@ -65,8 +65,8 @@ var obj = { alert( "Hello " + name ); } }, -// Create a Deferred -defer = $.Deferred(); + // Create a Deferred + defer = $.Deferred(); // Set object as a promise defer.promise( obj ); @@ -82,4 +82,4 @@ obj.done(function( name ) { - \ No newline at end of file + diff --git a/entries/deferred.state.xml b/entries/deferred.state.xml index 8a2350f6..33c5e5cb 100644 --- a/entries/deferred.state.xml +++ b/entries/deferred.state.xml @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/entries/deferred.then.xml b/entries/deferred.then.xml index 08a08d89..af0adaec 100644 --- a/entries/deferred.then.xml +++ b/entries/deferred.then.xml @@ -69,9 +69,12 @@ Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. @@ -124,7 +127,6 @@ var request = $.ajax( url, { dataType: "json" } ), chained.done(function( data ) { // data retrieved from url2 as provided by the first request }); - ]]> diff --git a/entries/delay.xml b/entries/delay.xml index 5da629cf..1496732e 100644 --- a/entries/delay.xml +++ b/entries/delay.xml @@ -15,7 +15,9 @@

        Added to jQuery in version 1.4, the .delay() method allows us to delay the execution of functions that follow it in the queue. It can be used with the standard effects queue or with a custom queue. Only subsequent events in a queue are delayed; for example this will not delay the no-arguments forms of .show() or .hide() which do not use the effects queue.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        Using the standard effects queue, we can, for example, set an 800-millisecond delay between the .slideUp() and .fadeIn() of <div id="foo">:

        -
        $('#foo').slideUp(300).delay(800).fadeIn(400);
        +
        
        +$( "#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.

        @@ -26,20 +28,33 @@ Animate the hiding and showing of two divs, delaying the first before showing it. + div { + position: absolute; + width: 60px; + height: 60px; + float: left; + } + .first { + background-color: #3f3; + left: 0; + } + .second { + background-color: #33f; + left: 80px; + } + ]]> +$( "button" ).click(function() { + $( "div.first" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 ); + $( "div.second" ).slideUp( 300 ).fadeIn( 400 ); +}); +]]> +

        +]]> - \ No newline at end of file + diff --git a/entries/delegate.xml b/entries/delegate.xml index ee144ca9..27a618f8 100644 --- a/entries/delegate.xml +++ b/entries/delegate.xml @@ -42,18 +42,22 @@

        As of jQuery 1.7, .delegate() has been superseded by the .on() method. For earlier versions, however, it remains the most effective means to use event delegation. More information on event binding and delegation is in the .on() method. In general, these are the equivalent templates for the two methods:

        
         // jQuery 1.4.3+
        -$(elements).delegate( selector, events, data, handler );
        +$( elements ).delegate( selector, events, data, handler );
         // jQuery 1.7+
        -$(elements).on( events, selector, data, handler );
        - 
        +$( elements ).on( events, selector, data, handler ); +

        For example, the following .delegate() code:

        -
        $("table").delegate("td", "click", function() {
        -  $(this).toggleClass("chosen");
        -});
        +
        
        +$( "table" ).delegate( "td", "click", function() {
        +  $( this ).toggleClass( "chosen" );
        +});
        +    

        is equivalent to the following code written using .on():

        -
        $("table").on("click", "td", function() {
        -  $(this).toggleClass("chosen");
        -});
        +
        
        +$( "table" ).on( "click", "td", function() {
        +  $( this ).toggleClass( "chosen" );
        +});
        +    

        To remove events attached with delegate(), see the .undelegate() method.

        Passing and handling event data works the same way as it does for .on().

        @@ -61,58 +65,80 @@ $(elements).on( events, selector, data, handler ); Click a paragraph to add another. Note that .delegate() attaches a click event handler to all paragraphs - even new ones. - + +]]> To display each paragraph's text in an alert box whenever it is clicked: - + To cancel a default action and prevent it from bubbling up, return false: - + To cancel only the default action by using the preventDefault method. - +}); +]]> Can bind custom events too. - + diff --git a/entries/dequeue.xml b/entries/dequeue.xml index d0d74e49..f77706a3 100644 --- a/entries/dequeue.xml +++ b/entries/dequeue.xml @@ -14,27 +14,37 @@ Use dequeue to end a custom queue function which allows the queue to keep going. - + div { + margin: 3px; + width: 50px; + position: absolute; + height: 50px; + left: 10px; + top: 30px; + background-color: yellow; + } + div.red { + background-color: red; + } + ]]> + - \ No newline at end of file + From ad18d2123753e55ad8f238efe1a3cfe0a7c391b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 9 Jul 2013 17:00:34 -0400 Subject: [PATCH 227/998] Cleanup. --- README.md | 11 +- entries/add.xml | 35 ++--- entries/addBack.xml | 13 +- entries/addClass.xml | 28 ++-- entries/after.xml | 42 +++--- entries/ajaxComplete.xml | 32 ++-- entries/ajaxError.xml | 27 ++-- entries/ajaxSend.xml | 32 ++-- entries/ajaxStart.xml | 5 +- entries/ajaxStop.xml | 3 +- entries/ajaxSuccess.xml | 5 +- entries/all-selector.xml | 12 +- entries/andSelf.xml | 15 +- entries/animate.xml | 94 ++++++------ entries/animated-selector.xml | 8 +- entries/append.xml | 23 ++- entries/appendTo.xml | 6 +- entries/attr.xml | 53 +++---- .../attribute-contains-prefix-selector.xml | 10 +- entries/attribute-contains-selector.xml | 2 +- entries/before.xml | 28 ++-- entries/bind.xml | 72 ++++----- entries/button-selector.xml | 35 +++-- entries/callbacks.add.xml | 29 ++-- entries/callbacks.disable.xml | 24 +-- entries/callbacks.disabled.xml | 33 +++-- entries/callbacks.empty.xml | 30 ++-- entries/callbacks.fire.xml | 37 ++--- entries/callbacks.fireWith.xml | 21 +-- entries/callbacks.fired.xml | 23 +-- entries/callbacks.has.xml | 12 +- entries/callbacks.lock.xml | 49 +++---- entries/callbacks.locked.xml | 15 +- entries/callbacks.remove.xml | 17 ++- entries/change.xml | 10 +- entries/checkbox-selector.xml | 22 +-- entries/checked-selector.xml | 14 +- entries/child-selector.xml | 10 +- entries/children.xml | 111 +++++++------- entries/class-selector.xml | 8 +- entries/clearQueue.xml | 42 +++--- entries/click.xml | 20 +-- entries/clone.xml | 8 +- entries/closest.xml | 59 ++++---- entries/contains-selector.xml | 2 +- entries/contents.xml | 34 ++--- entries/context.xml | 6 +- entries/css.xml | 137 +++++++++--------- entries/data.xml | 34 ++--- entries/dblclick.xml | 17 ++- entries/deferred.always.xml | 2 +- entries/deferred.done.xml | 12 +- entries/deferred.fail.xml | 8 +- entries/deferred.pipe.xml | 18 +-- entries/deferred.promise.xml | 16 +- entries/deferred.then.xml | 28 ++-- entries/delay.xml | 14 +- entries/delegate.xml | 37 ++--- entries/dequeue.xml | 24 +-- entries/descendant-selector.xml | 32 ++-- entries/detach.xml | 47 +++--- entries/die.xml | 21 ++- entries/disabled-selector.xml | 15 +- entries2html.xsl | 16 +- 64 files changed, 903 insertions(+), 802 deletions(-) diff --git a/README.md b/README.md index 57da9629..9c25bb24 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,13 @@ To build and deploy your changes for previewing in a [jquery-wp-content](https:/ * **No**: The `load`, `scroll` and `error` events (e.g., on an `` element) do not bubble #### Spelling + * The documentation standardizes on American English spelling. For example: * **Yes**: color, while, among, customize, argument * **No**: colour, whilst, amongst, customise, arguement #### Pronoun Usage + * Use second-person pronoun ("you") when necessary, but try to avoid it. * Favor the definite article ("the") over second-person possesive ("your"). * **Yes**: Insert the paragraph after the unordered list. @@ -41,27 +43,32 @@ To build and deploy your changes for previewing in a [jquery-wp-content](https:/ * **No**: And now we have our paragraph beneath the unordered list. #### "Voice" + * Prefer active voice over passive. * **Active**: Calling `.click()` binds a click handler to the elements in the collection * **Passive**: Click handlers are bound to elements in the collection when `.click()` is called ### Code Style -Code in the API documentation should follow the [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines) with the following addition: + +Code in the API documentation should follow the [jQuery Core Style Guide](http://contribute.jquery.org/style-guide/) with the following addition: * **Document ready syntax**: Use `$( document ).ready(function() {` instead of `$(function() {` as it's harder for new users to distinguish the difference between the latter and an IIFE. #### Code within prose content (paragraphs and the like): -* Methods: use a dot, followed by the method name, followed by parentheses: e.g. The `.focus()` method is a shortcut for `.bind('focus', handler)` in the first and second variations, and `.trigger('focus')` in the third. + +* Methods: use a dot, followed by the method name, followed by parentheses: e.g. The `.focus()` method is a shortcut for `.on( "focus", handler )` in the first and second variations, and `.trigger( "focus" )` in the third. * Properties: use a dot, followed by the property name: e.g. `.length`. * Functions: use the function name, followed by parentheses: `myFunction()`. #### Examples + * Examples should indicate what the expected result will be before presenting the code. This makes code clearer and skimming easier, especially for newer coders who may not understand what is supposed to be happening from reading the code itself. * **Yes**: Find all p elements that are children of a div element and apply a border to them. * **No**: Find all p elements that are children of a div element. * Make your example easy to follow with good comments so that the explanation isn't necessary. ### Rhetorical Context + * Subject * The entirety of jQuery's public API * Audience diff --git a/entries/add.xml b/entries/add.xml index b17d39f8..6c2d3acf 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -37,17 +37,17 @@ Add elements to the set of matched elements.

        Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

        -

        Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order, use the $(array_of_DOM_elements) signature.

        +

        Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order, use the $(array_of_DOM_elements) signature.

        The updated set of elements can be used in a following (chained) method, or assigned to a variable for later use. For example:

        
         $( "p" ).add( "div" ).addClass( "widget" );
         var pdiv = $( "p" ).add( "div" );
        -      
        +

        The following will not save the added elements, because the .add() method creates a new set and leaves the original set in pdiv unchanged:

        
         var pdiv = $( "p" );
         pdiv.add( "div" ); // WRONG, pdiv will not change
        -      
        +

        Consider a page with a simple list and a paragraph following it:

        
         <ul>
        @@ -56,9 +56,11 @@ pdiv.add( "div" ); // WRONG, pdiv will not change
           <li>list item 3</li>
         </ul>
         <p>a paragraph</p>
        -	
        +

        We can select the list items and then the paragraph by using either a selector or a reference to the DOM element itself as the .add() method's argument:

        -
        $( "li" ).add( "p" ).css( "background-color", "red" );
        +
        
        +$( "li" ).add( "p" ).css( "background-color", "red" );
        +    

        Or:

        
         $( "li" ).add( document.getElementsByTagName( "p" )[ 0 ] )
        @@ -82,24 +84,23 @@ $( "div" ).css( "border", "2px solid red" )
           .css( "background", "yellow" );
         ]]>
             
        +]]>
             
        diff --git a/entries/addBack.xml b/entries/addBack.xml
        index 83f04f8a..f8c11f32 100644
        --- a/entries/addBack.xml
        +++ b/entries/addBack.xml
        @@ -21,9 +21,10 @@
         </ul>
             

        The result of the following code is a red background behind items 3, 4 and 5:

        -
        $( "li.third-item" ).nextAll().addBack()
        +    
        
        +$( "li.third-item" ).nextAll().addBack()
           .css( "background-color", "red" );
        -
        +

        First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .addBack() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

        @@ -39,8 +40,8 @@ $( "div.after-addback" ).find( "p" ).addBack().addClass( "background" ); ]]> +]]> +]]> +]]> +]]> +

        Since .after() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().after( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on the elements that are collected in the code.

        @@ -99,9 +106,9 @@ $( "p" ).after( "Hello" ); ]]> +]]> @@ -112,10 +119,10 @@ $( "p" ).after( "Hello" ); $( "p" ).after( document.createTextNode( "Hello" ) ); ]]> +]]> @@ -127,11 +134,12 @@ $( "p" ).after( $( "b" ) ); ]]> +]]> diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 0ebeccaa..a1f7e52d 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -11,36 +11,44 @@

        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.

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

        -
        <div class="trigger">Trigger</div>
        +    
        
        +<div class="trigger">Trigger</div>
         <div class="result"></div>
         <div class="log"></div>
        -
        +

        Attach the event handler to the document:

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

        Now, make an Ajax request using any jQuery method:

        -
        $( ".trigger" ).click(function() {
        +    
        
        +$( ".trigger" ).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.

        As of jQuery 1.8, the .ajaxComplete() method should only be attached to document.

        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 ).ajaxComplete(function( event, xhr, settings ) {
           if ( settings.url === "ajax/test.html" ) {
             $( ".log" ).text( "Triggered ajaxComplete handler. The result is " +
        -                       xhr.responseHTML );
        +      xhr.responseHTML );
           }
        -});
        +}); +

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

        Show a message when an Ajax request completes. - + diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index ea7d58a2..21a03466 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -11,21 +11,28 @@

        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.

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

        -
        <button class="trigger">Trigger</button>
        +    
        
        +<button class="trigger">Trigger</button>
         <div class="result"></div>
        -<div class="log"></div>
        +<div class="log"></div> +

        Attach the event handler to the document:

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

        Now, make an Ajax request using any jQuery method:

        -
        $( "button.trigger" ).on( "click", function() {
        +    
        
        +$( "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.

        As of jQuery 1.8, the .ajaxError() method should only be attached to document.

        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, exception) {
        +    
        
        +$( document ).ajaxError(function( event, jqxhr, settings, exception ) {
           if ( settings.url == "ajax/missing.html" ) {
             $( "div.log" ).text( "Triggered ajaxError handler." );
           }
        @@ -34,9 +41,11 @@
           
           
             Show a message when an Ajax request fails.
        -    
        +});
        +]]>
           
           
           
        diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml
        index 63f60e36..e3660d9f 100644
        --- a/entries/ajaxSend.xml
        +++ b/entries/ajaxSend.xml
        @@ -11,32 +11,42 @@
           
             

        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.

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

        -
        <div class="trigger">Trigger</div>
        +    
        
        +<div class="trigger">Trigger</div>
         <div class="result"></div>
        -<div class="log"></div>
        +<div class="log"></div> +

        Attach the event handler to the document:

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

        Now, make an Ajax request using any jQuery method:

        -
        $( ".trigger" ).click(function() {
        +    
        
        +$( ".trigger" ).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.

        As of jQuery 1.8, the .ajaxSend() method should only be attached to document.

        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 ).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.xml b/entries/ajaxStart.xml index 5b57808e..0e502a19 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -36,8 +36,9 @@ $( ".trigger" ).click(function() { Show a loading message whenever an Ajax request starts (and none is already active). + $( "#loading" ).show(); +}); +]]>
        diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 436d37f4..80600f00 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -14,7 +14,8 @@
        
         <div class="trigger">Trigger</div>
         <div class="result"></div>
        -<div class="log"></div>
        +<div class="log"></div> +

        Attach the event handler to the document:

        
         $( ".log" ).ajaxStop(function() {
        diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml
        index 211aef0a..a0c25aae 100644
        --- a/entries/ajaxSuccess.xml
        +++ b/entries/ajaxSuccess.xml
        @@ -14,7 +14,8 @@
             
        
         <div class="trigger">Trigger</div>
         <div class="result"></div>
        -<div class="log"></div>
        +<div class="log"></div> +

        Attach the event handler to any element:

        
         $(document).ajaxSuccess(function() {
        @@ -34,7 +35,7 @@ $( ".trigger" ).on( "click", function() {
         $( document ).ajaxSuccess(function( event, xhr, settings ) {
           if ( settings.url == "ajax/test.html" ) {
             $( ".log" ).text( "Triggered ajaxSuccess handler. The ajax response was: " +
        -                       xhr.responseText );
        +      xhr.responseText );
           }
         });
             
        diff --git a/entries/all-selector.xml b/entries/all-selector.xml index bc3d6f8d..43e45295 100644 --- a/entries/all-selector.xml +++ b/entries/all-selector.xml @@ -24,7 +24,7 @@ $( "body" ).prepend( "

        " + elementCount + " elements found

        " ); h3 { margin: 0; } - div,span,p { + div, span, p { width: 80px; height: 40px; float: left; @@ -32,7 +32,7 @@ $( "body" ).prepend( "

        " + elementCount + " elements found

        " ); margin: 10px; background-color: #EEEEEE; } - ]]> +]]> Find all elements within document.body so elements like head, script, etc. are excluded. @@ -51,7 +51,7 @@ $( "body" ).prepend( "

        " + elementCount + " elements found

        " ); h3 { margin: 0; } - div,span,p { + div, span, p { width: 80px; height: 40px; float: left; @@ -60,11 +60,11 @@ $( "body" ).prepend( "

        " + elementCount + " elements found

        " ); background-color: #EEEEEE; } #test { - width: auto; - height: auto; + width: auto; + height: auto; background-color: transparent; } - ]]> +]]>
        diff --git a/entries/andSelf.xml b/entries/andSelf.xml index edf90ed0..a3f4c1b5 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -17,12 +17,13 @@ <li>list item 4</li> <li>list item 5</li> </ul> -
        +

        The result of the following code is a red background behind items 3, 4 and 5:

        -
        $( "li.third-item" ).nextAll().andSelf()
        +    
        
        +$( "li.third-item" ).nextAll().andSelf()
           .css( "background-color", "red" );
        -
        -

        First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

        +
        +

        First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: [ <li.third-item>, <li>, <li> ].

        The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $( "div.after-andself" ) — to the current set, selecting both the div and its enclosed paragraphs. @@ -37,7 +38,7 @@ $( "div.after-andself" ).find( "p" ).andSelf().addClass( "background" ); ]]> +]]> +]]> Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up. @@ -178,38 +178,41 @@ $( "#left" ).click(function(){ height: 90px; margin: 5px; } - ]]> +]]> The first button shows how an unqueued animation works. It expands the div out to 90% width while the font-size is increasing. Once the font-size change is complete, the border animation will begin. The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed. @@ -234,12 +237,12 @@ $( "#go4" ).click(function(){ button { font-size: 14px; } - ]]> +]]> Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. +]]> Animate all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds. @@ -280,7 +286,7 @@ $( "p" ).animate({ Animate all paragraphs to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds. @@ -289,11 +295,11 @@ $( "p" ).animate({ Animate the left and opacity style properties of all paragraphs; run the animation outside the queue, so that it will automatically start without waiting for its turn. @@ -309,10 +315,10 @@ $( "p" ).animate({ Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds.
        @@ -321,9 +327,9 @@ $( "p" ).animate({ @@ -331,10 +337,10 @@ $( "p" ).animate({ Animate all paragraphs and execute a callback function when the animation is complete. The first argument is an object of CSS properties, the second specifies that the animation should take 1000 milliseconds to complete, the third states the easing type, and the fourth argument is an anonymous callback function. diff --git a/entries/animated-selector.xml b/entries/animated-selector.xml index d6b8583d..819fcff0 100644 --- a/entries/animated-selector.xml +++ b/entries/animated-selector.xml @@ -13,7 +13,7 @@ Change the color of any div that is animated. +]]> diff --git a/entries/append.xml b/entries/append.xml index 3e8efe7e..0c80ec1d 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -20,8 +20,7 @@ 1.4 - A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of 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. - + A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of 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. Insert content, specified by the parameter, to the end of each element in the set of matched elements. @@ -72,11 +71,11 @@ $( ".container" ).append( $( "h2" ) );

        For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

        
         var $newdiv1 = $( "<div id='object1'/>" ),
        -    newdiv2 = document.createElement( "div" ),
        -    existingdiv1 = document.getElementById( "foo" );
        +  newdiv2 = document.createElement( "div" ),
        +  existingdiv1 = document.getElementById( "foo" );
         
         $( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
        -
        +

        Since .append() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').append( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

        @@ -85,10 +84,10 @@ $( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] ); $( "p" ).append( "Hello" ); ]]>
        +]]> @@ -99,10 +98,10 @@ $( "p" ).append( "Hello" ); $( "p" ).append( document.createTextNode( "Hello" ) ); ]]> +]]> @@ -113,10 +112,10 @@ $( "p" ).append( document.createTextNode( "Hello" ) ); $( "p" ).append( $( "strong" ) ); ]]> +]]> +]]> +]]> +]]> +]]> +]]> +]]> - \ No newline at end of file + diff --git a/entries/attribute-contains-selector.xml b/entries/attribute-contains-selector.xml index e07b5662..691b3f4e 100644 --- a/entries/attribute-contains-selector.xml +++ b/entries/attribute-contains-selector.xml @@ -29,4 +29,4 @@ $( "input[name*='man']" ).val( "has man in it!" ); - \ No newline at end of file + diff --git a/entries/before.xml b/entries/before.xml index 19a957b0..e60b08b2 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -64,19 +64,19 @@ $( ".container" ).before( $( "h2" ) );

        If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

        In jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes:

        
        -$( "<div/>" ).before( "<p></p>" );
        -	
        +$( "<div>" ).before( "<p></p>" ); +

        The result is a jQuery set that contains a paragraph and a div (in that order).

        Additional Arguments

        Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

        For example, the following will insert two new <div>s and an existing <div> before the first paragraph:

        
        -var $newdiv1 = $( "<div id='object1'/>" ),
        +var newdiv1 = $( "<div id='object1'/>" ),
           newdiv2 = document.createElement( "div" ),
           existingdiv1 = document.getElementById( "foo" );
         
        -$( "p" ).first().before( $newdiv1, [ newdiv2, existingdiv1 ] );
        -
        +$( "p" ).first().before( newdiv1, [ newdiv2, existingdiv1 ] ); +

        Since .before() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().before( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

        @@ -85,10 +85,10 @@ $( "p" ).first().before( $newdiv1, [ newdiv2, existingdiv1 ] ); $( "p" ).before( "Hello" ); ]]> +]]> @@ -99,10 +99,10 @@ $( "p" ).before( "Hello" ); $( "p" ).before( document.createTextNode( "Hello" ) ); ]]> +]]> @@ -113,10 +113,10 @@ $( "p" ).before( document.createTextNode( "Hello" ) ); $( "p" ).before( $( "b" ) ); ]]> +]]> diff --git a/entries/bind.xml b/entries/bind.xml index 0d23acde..145ce6b8 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -57,10 +57,10 @@ $( "#foo" ).bind( "mouseenter mouseleave", function() {
        
         $( "#foo" ).bind({
           click: function() {
        -    // do something on click
        +    // Do something on click
           },
           mouseenter: function() {
        -    // do something on mouseenter
        +    // Do something on mouseenter
           }
         });
             
        @@ -84,9 +84,9 @@ $( "#foo" ).bind( "click", function() {

        Using the event object in a handler looks like this:

        
         $( document ).ready(function() {
        -  $( "#foo" ).bind( "click", function(event) {
        -    alert( "The mouse cursor is at (" + 
        -      event.pageX + ", " + event.pageY + 
        +  $( "#foo" ).bind( "click", function( event ) {
        +    alert( "The mouse cursor is at (" +
        +      event.pageX + ", " + event.pageY +
               ")" );
           });
         });
        @@ -110,13 +110,13 @@ $( "#bar" ).bind( "click", function() {
         var message = "Spoon!";
         $( "#foo" ).bind( "click", {
           msg: message
        -}, function(event) {
        +}, function( event ) {
           alert( event.data.msg );
         });
         message = "Not in the face!";
         $( "#bar" ).bind( "click", {
           msg: message
        -}, function(event) {
        +}, function( event ) {
           alert( event.data.msg );
         });
             
        @@ -135,31 +135,31 @@ $( "#bar" ).bind( "click", { Handle click and double-click for the paragraph. Note: the coordinates are window relative, so in this case relative to the demo iframe. +]]> @@ -181,14 +181,14 @@ function handler( event ) { } $( "p" ).bind( "click", { foo: "bar" -}, handler ) +}, handler ); ]]> Cancel a default action and prevent it from bubbling up by returning false: @@ -211,40 +211,44 @@ $( "form" ).bind( "submit", function( event ) { Bind custom events. - + +]]> Bind multiple events simultaneously. +]]> - - + diff --git a/entries/callbacks.disable.xml b/entries/callbacks.disable.xml index e0f9a365..5ee0eb1b 100644 --- a/entries/callbacks.disable.xml +++ b/entries/callbacks.disable.xml @@ -6,31 +6,33 @@ Disable a callback list from doing anything more. -

        This method returns the Callbacks object onto which it is attached (this).

        -

        Example

        -

        Use callbacks.disable() to disable further calls to a callback list:

        -
        -
        +]]> +
        diff --git a/entries/callbacks.disabled.xml b/entries/callbacks.disabled.xml index 6584756d..97f9a7f5 100644 --- a/entries/callbacks.disabled.xml +++ b/entries/callbacks.disabled.xml @@ -8,27 +8,28 @@ Use callbacks.disabled() to determine if the callbacks list has been disabled: - +// Test the disabled state of the list +console.log ( callbacks.disabled() ); +// Outputs: true +]]> diff --git a/entries/callbacks.empty.xml b/entries/callbacks.empty.xml index 332da0dd..4817656e 100644 --- a/entries/callbacks.empty.xml +++ b/entries/callbacks.empty.xml @@ -6,35 +6,37 @@ Remove all of the callbacks from a list. -

        This method returns the Callbacks object onto which it is attached (this).

        -

        Example

        -

        Use callbacks.empty() to empty a list of callbacks:

        -
        -
        +]]> + diff --git a/entries/callbacks.fire.xml b/entries/callbacks.fire.xml index 7ed04514..00ec03f3 100644 --- a/entries/callbacks.fire.xml +++ b/entries/callbacks.fire.xml @@ -9,39 +9,40 @@ Call all of the callbacks with the given arguments -

        This method returns the Callbacks object onto which it is attached (this).

        -

        Example

        -

        Use callbacks.fire() to invoke the callbacks in a list with any arguments that have been passed:

        -
        -
        +]]> + diff --git a/entries/callbacks.fireWith.xml b/entries/callbacks.fireWith.xml index d36970c6..dfb2adb3 100644 --- a/entries/callbacks.fireWith.xml +++ b/entries/callbacks.fireWith.xml @@ -12,27 +12,28 @@ Call all callbacks in a list with the given context and arguments. -

        This method returns the Callbacks object onto which it is attached (this).

        -

        Example

        -

        Use callbacks.fireWith() to fire a list of callbacks with a specific context and an array of arguments:

        -
        -
        +// Outputs: "Received: foo, bar" +]]> + diff --git a/entries/callbacks.fired.xml b/entries/callbacks.fired.xml index 6a2680ab..f16fc87f 100644 --- a/entries/callbacks.fired.xml +++ b/entries/callbacks.fired.xml @@ -5,27 +5,28 @@ 1.7 Determine if the callbacks have already been called at least once. - -

        Example

        -

        Use callbacks.fired() to determine if the callbacks in a list have been called at least once:

        -
        -
        +]]> + diff --git a/entries/callbacks.has.xml b/entries/callbacks.has.xml index 71637bf5..44c65247 100644 --- a/entries/callbacks.has.xml +++ b/entries/callbacks.has.xml @@ -11,23 +11,23 @@ Use callbacks.has() to check if a callback list contains a specific callback: - @@ -42,12 +42,12 @@ callbacks.fire( "world" );
        ]]>
        - diff --git a/entries/callbacks.locked.xml b/entries/callbacks.locked.xml index ea1c2b2a..601826da 100644 --- a/entries/callbacks.locked.xml +++ b/entries/callbacks.locked.xml @@ -8,24 +8,25 @@ Use callbacks.locked() to determine the lock-state of a callback list: - diff --git a/entries/callbacks.remove.xml b/entries/callbacks.remove.xml index a6fbb876..2046fc40 100644 --- a/entries/callbacks.remove.xml +++ b/entries/callbacks.remove.xml @@ -11,31 +11,32 @@ Remove a callback or a collection of callbacks from a callback list. -

        This method returns the Callbacks object onto which it is attached (this).

        +

        This method returns the Callbacks object onto which it is attached (this).

        Use callbacks.remove() to remove callbacks from a callback list: - diff --git a/entries/change.xml b/entries/change.xml index f676731b..d5f4f4f1 100644 --- a/entries/change.xml +++ b/entries/change.xml @@ -57,7 +57,7 @@ $( "#other" ).click(function() { $( "select" ) .change(function () { var str = ""; - $( "select option:selected" ).each(function () { + $( "select option:selected" ).each(function() { str += $( this ).text() + " "; }); $( "div" ).text( str ); @@ -65,10 +65,10 @@ $( "select" ) .change(); ]]> +]]>
        diff --git a/entries/checkbox-selector.xml b/entries/checkbox-selector.xml index 7e3ed301..843cdaf7 100644 --- a/entries/checkbox-selector.xml +++ b/entries/checkbox-selector.xml @@ -17,27 +17,29 @@ var input = $( "form input:checkbox" ) .wrap( "" ) .parent() .css({ - background: "yellow", + background: "yellow", border: "3px red solid" }); + $( "div" ) .text( "For this type jQuery found " + input.length + "." ) .css( "color", "red" ); -$( "form" ) - .submit(function () { - return false; - }); // so it won't submit + +// Prevent the form from submitting +$( "form" ).submit(function( event ) { + event.preventDefault(); +}); ]]> +]]> +]]> Identify the checked radio input. +]]> +]]> +]]> +]]> diff --git a/entries/class-selector.xml b/entries/class-selector.xml index 06df8d4e..9db9370b 100644 --- a/entries/class-selector.xml +++ b/entries/class-selector.xml @@ -23,7 +23,7 @@ $( ".myClass" ).css( "border", "3px solid red" ); span class="myClass" ]]> +]]> Finds the element with both "myclass" and "otherclass" classes. @@ -44,7 +44,7 @@ $( ".myclass.otherclass" ).css( "border", "13px solid red" ); span class="myClass" ]]> +]]> diff --git a/entries/clearQueue.xml b/entries/clearQueue.xml index 5c18caa4..85baeeb2 100644 --- a/entries/clearQueue.xml +++ b/entries/clearQueue.xml @@ -14,51 +14,51 @@ Empty the queue. +]]> +]]>

        As of jQuery 1.5, withDataAndEvents can be optionally enhanced with deepWithDataAndEvents to copy the events and data for all children of the cloned element.

        diff --git a/entries/closest.xml b/entries/closest.xml index c3716fdc..b3c8e169 100644 --- a/entries/closest.xml +++ b/entries/closest.xml @@ -83,7 +83,7 @@
        
         $( "li.item-a" )
           .closest( "ul" )
        -  .css("background-color", "red" );
        +  .css( "background-color", "red" );
               

        This will change the color of the level-2 <ul>, since it is the first encountered when traveling up the DOM tree.

        Suppose we search for an <li> element instead:

        @@ -100,50 +100,53 @@ $( "li.item-a" ) .closest( "ul", listItemII ) .css( "background-color", "red" ); $( "li.item-a" ) - .closest('#one', listItemII ) - .css( "background-color", "green" ); + .closest( "#one", listItemII ) + .css( "background-color", "green" ); +

        This will change the color of the level-2 <ul>, because it is both the first <ul> ancestor of list item A and a descendant of list item II. It will not change the color of the level-1 <ul>, however, because it is not a descendant of list item II.

        Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked. - +]]> + Pass a jQuery object to closest. The closest list element toggles a yellow background when it or its descendent is clicked. +]]> diff --git a/entries/css.xml b/entries/css.xml index b3c5e258..c077da8d 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -25,20 +25,20 @@ Get the background color of a clicked div. +]]> +]]> +]]> +]]> Increase the width of #box by 200 pixels the first time it is clicked. @@ -172,13 +175,13 @@ $( "#box" ).one( "click", function() { }); ]]> +]]> @@ -186,20 +189,20 @@ $( "#box" ).one( "click", function() { Highlight a clicked word in the paragraph. +]]> @@ -253,12 +256,12 @@ $( "div" ).on( "click", function() { }); ]]> +]]> +]]> +]]> @@ -74,24 +74,25 @@ $( "p" ).dblclick( function () { Double click to toggle background color. +]]> diff --git a/entries/deferred.always.xml b/entries/deferred.always.xml index 0389d852..4dff5a86 100644 --- a/entries/deferred.always.xml +++ b/entries/deferred.always.xml @@ -28,4 +28,4 @@ $.get( "test.php" ).always(function() { - \ No newline at end of file + diff --git a/entries/deferred.done.xml b/entries/deferred.done.xml index 95ebfb57..1e4175ec 100644 --- a/entries/deferred.done.xml +++ b/entries/deferred.done.xml @@ -29,7 +29,7 @@ $.get( "test.php" ).done(function() { Resolve a Deferred object when the user clicks a button, triggering a number of callback functions: Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred, you can attach a success and failure callback using the deferred.done() and deferred.fail() methods. - \ No newline at end of file + diff --git a/entries/deferred.pipe.xml b/entries/deferred.pipe.xml index 17058a9a..66eda149 100644 --- a/entries/deferred.pipe.xml +++ b/entries/deferred.pipe.xml @@ -41,9 +41,9 @@ Filter resolve value: diff --git a/entries/deferred.then.xml b/entries/deferred.then.xml index af0adaec..86c49d03 100644 --- a/entries/deferred.then.xml +++ b/entries/deferred.then.xml @@ -70,10 +70,10 @@ Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach handlers using the .then method. @@ -86,11 +86,10 @@ $.get( "test.php" ).then( ]]> - Filter reject value: +]]> +]]> @@ -100,15 +100,15 @@ $( "body" ).delegate( "p", "click", function(){ To cancel a default action and prevent it from bubbling up, return false: To cancel only the default action by using the preventDefault method. @@ -116,24 +116,27 @@ $( "body" ).delegate( "a", "click", function( event ){ Can bind custom events too. +]]> +]]> - + - - +$( "p" ).click(function() { + $( this ).toggleClass( "off" ); +}); +var p; +$( "button" ).click(function() { + if ( p ) { + p.appendTo( "body" ); + p = null; + } else { + p = $( "p" ).detach(); + } +}); +]]> + + - \ No newline at end of file + diff --git a/entries/die.xml b/entries/die.xml index f3d0706a..52140d7f 100644 --- a/entries/die.xml +++ b/entries/die.xml @@ -29,21 +29,29 @@ To unbind all live events from all paragraphs, write: - + To unbind all live click events from all paragraphs, write: - + To unbind just one previously bound handler, pass the function in as the second argument: - +// Now foo will no longer be called +$( "p" ).die( "click", foo ); +]]> @@ -52,4 +60,3 @@ $("p").die("click", foo); // ... foo will no longer be called.]]> - diff --git a/entries/disabled-selector.xml b/entries/disabled-selector.xml index 8e601b34..f018318c 100644 --- a/entries/disabled-selector.xml +++ b/entries/disabled-selector.xml @@ -16,12 +16,15 @@ Finds all input elements that are disabled. - - + + diff --git a/entries2html.xsl b/entries2html.xsl index 9979792f..35ac66cf 100755 --- a/entries2html.xsl +++ b/entries2html.xsl @@ -6,22 +6,24 @@ -<!DOCTYPE html> -<html> -<head> - <style></style> +<!doctype html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title> demo</title> + <style> </style> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> - + </script> </head> <body> - + -<script></script> +<script></script> </body> From 4505b62ab0ee6a928fe02837fede2e80de8a303c Mon Sep 17 00:00:00 2001 From: Alex Kalicki Date: Thu, 11 Jul 2013 16:45:09 -0400 Subject: [PATCH 228/998] Made minor wording changes. --- entries/click.xml | 2 +- entries/hide.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/click.xml b/entries/click.xml index 50f357e9..4715cac3 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -51,7 +51,7 @@ $( "#other" ).click(function() { $( "#target" ).click(); }); -

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

        +

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

        The click event is only triggered after this exact series of events:

        • The mouse button is depressed while the pointer is inside the element.
        • diff --git a/entries/hide.xml b/entries/hide.xml index 6d6755c4..10e03189 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -30,7 +30,7 @@

          With no parameters, the .hide() method is the simplest way to hide an element:

          $('.target').hide();
               
          -

          The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

          +

          The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline and is hidden then shown, it will once again be displayed inline.

          When a duration, a plain object, or a "complete" function is provided, .hide() becomes an animation method. The .hide() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0, the display style property is set to none to ensure that the element no longer affects the layout of the page.

          Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

          Note that .hide() is fired immediately and will override the animation queue if no duration or a duration of 0 is specified.

          From 6bd6fb6ae80bd4741243d8e362aca7101a388a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 16 Jul 2013 08:52:06 -0400 Subject: [PATCH 229/998] Clean up sample config. --- config-sample.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config-sample.json b/config-sample.json index ee1430be..85f8556b 100644 --- a/config-sample.json +++ b/config-sample.json @@ -1,5 +1,5 @@ { - "url": "dev.api.jquery.com", - "username": "admin", - "password": "secret" + "url": "local.api.jquery.com", + "username": "admin", + "password": "secret" } From 254df6a2db4f5bdc9ad17f184dc7362815d130f5 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 17 Jul 2013 09:14:05 -0400 Subject: [PATCH 230/998] outerHeight(): Add missing img --- resources/0042_04_03.png | Bin 0 -> 4082 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 resources/0042_04_03.png diff --git a/resources/0042_04_03.png b/resources/0042_04_03.png new file mode 100644 index 0000000000000000000000000000000000000000..c6958fe8887cc8d29f797b2a3db22054bf734988 GIT binary patch literal 4082 zcmaJ^XH-*NvyK$$B}&nNKn&6m2|-Fi#{hy9>AfgLkREz{r3)c|1_UMaDoC$VB!HrT zfDn+XfFd12F9B{`_pbH*c<;S`&OUqA>~o$qd!Bh_67+R7nCL!^EXC__&tRDivYBS7V`r-LJ(mb<;P<3mUL$3fno9T5Nk%S$bF z6{EnZ^=!ST?8aOl`)N{LXxSf`UgmgtpGuM+RWPO;ecNoju)%w`*KP`xC(0y-DjK-v?}+AOFeG zQ#|JPoO6)8bI0pw+diYprd=Kmw>+O=;=23vM@P1EbFK73zeFb@jFUtEfd_0h zlfuwiSfs$y)8&x@&?Evp-0XZ%pcX9p4OHVa2=bIzR&O`D zdi5&t%W?i;WnEpJ3d|vB#20Z*@(LJkYW~Rc^Dsl}nK$nTrU8hgPdD zE@Uc&JA@*Mu*F0EJht#bl&1TFRJuFd=6a{QwGc7!$RZ)c%e0p{5$t46E$$0LFB^~U zV%>QYw)u1Iz0hKaHX)Eyc7CwibFO8n**c_!IHArsR-=8Hbawc|;;l_bsGK-!nkS2S zL_}vcb(#M)YCXEe!<`ggOVzFiM?-y>BICr3HWRir<1$qoQf+R>fV36GyBgRR-x7%ZmG;zGFR9 zT7bj0BdXOFkm+4&$|dn6Cvbs|;F4@GgnRP%BE0G^1S0#}xhVM>Kps##o~MSV-UfP1 zG5QV_{39f$_xD;==XeS1CioJxj@7|yyQ-X5h8;K{TaS@gA?VH6?}?@cIGEw1 zIRyrU@}RyueGHG;s5o~v!BwI#2T4fQx20+;9ZY7MMwn~g2J21_PY16(TBxx;t$5-1 z!*4!G$IuT0SHnCUI6gCar57IQ?ri2U_CQ=e8EAd>H5(S-5Z;ma<>sQ8PzC>)M-2%- znx|nWhoVVcQ}xk&q~qwBf;L7s{y3(9Xvj^wjdN^O>C#RM$QS8uP#r4}k$<}y`r_yw zbW6qkz6a-m1{?5hdfWTd6nnY!;Jsw&Xn>E)(zV)*cvS}Nt+3eM$IV|t{ce1rfmrEA z^Y49-_NuI`1To9aG3&S}+*ApO6uyQ5$@Y~HeSYCj#~)s#HRT;p3w~kQz{C&j2A#>C z*hL+#3L6RFg%WJ}cX{wm4}_)q)WQbElWO8)_O@3_a+nzz2P&1FoSpY$gD`54!o2LL zTe$@Vi!&|0D<{pChpTU^in(-jbX;6uI(f)vxKb_shOSV(B+IzNmM^HHbZM*G2ExL^ zPhQ^(kH+m#l*npmq)!dLn?`r%<>ifxj3jbOG&VG}lXm)_dW|F9ucMfeR7&~6qK1}= zc6d+BM4?o}2Hm)qRFI%6cJ+8h*vxS!A^TLHyREOys_mP>Kw50eyH&gZu0OR@ho3W6 zjIAVwe-m2ww%F{x!(e?=)5JyMc^3_@-3EgdaWIiw(A3?~XQzh|`vlWkf9x)_;o@Yi z>Jv|hn004-=2Vc2K$VdQ4uKbNF@957_dz>E6qV=3<7tf`ItXOlw8UJ$s(don-wS%rK>meDZAv6*+wfJR{ z#`;u)Xd7(0(LHgE+9Vn|Rsodpm>Iscm%uSr3MBq~E=cNmMQwT~@Va-W-5op=^V}z! zSPKi=q|3F9oGzb|Zts2G<1hV9Fu4LiMj&tx&NdsHK4a5&u;~Lqj4V z<0EtwBI~`-^B1P)LdzeVVHXyI*y-yCJKgg+@|~6U_sT9MZA(dm9y? z&?_Ca93tJO!xXNN#eh;13Sh_YawqVmyP;A(HZmgC%j@fmt=0Y;Q*G&;q#cIE*8C@K zZXqrcB7MEl4?(~VnQ^u-%5UB@ljWjk#(k(^VPp+qd$8kIpI6DBJ-I8dXRO}^sB{8=W{i>2Q@u$M^Kf^c2(dG z-nFFe6zumsyCsJx@1=oEamz-2*iEDG!`T2A_3WP#VKLBtv;`@?_zh#a!>%r=D=E#H z0R9ni(OzM(R9S12OBPA}2;#y$cIF%MZ1u`G{Kj;XZQy)N^l3`z-VcUm|BWmq!q7)F zS4c=mn2~hHo8S(zkkt(-_QPApy5jYb5a>MI`W{I}wNYeL!Ru!veKNjn_bXhaugz~v z{C#Wd(`ip~c`VY-pce^yzG}Sk+wvA3EC1Uhn*I}p*O`{57`d(Nx(6|l^XxopEJm@z zru)@2F zD3O(qm}O_%P=%~AGem!XA5c{iM(8{LZSK+w<&Vd^(N9nP1nq5nFJ(Pm*r1{);js zJ*zs|=ABacfJFgt`{bt0Flhc@W4iW&%vY3DUI8_hT2l-!JUTjx2vvrd07`VTeN;N4 zoWomKEZ{CUmhfnSh#L(-wn=?&D^}}5_eL}hRPcV6%-qJLoo`x&Z?zvjC0Scr+rt-+ zh>OYQ+_GMFf4*jC+_v5UCup|TzG|8aUYia0;qK;UxHvawGY-;csVLjsQjf7(&;K#s zrG#vY4@!rc?mKbvbubCDI4pidmlHXPH!duq*}y%VJ0iQoF=JRu6A|`o7h?-|{vEMI z+YwINP+~WW()#jpAL8U_5%ZV#y)2ze7muTOFI@;`7qZ?=^xm@bRnK>Ha^%r{pF$(4 zps=C9%%hkK^g|yC@Pfj^!oYAh6so?h8ITL?R}1dm0b3F0ZP@_mzz@gHV;R|8WNNmD zWc-OljzQKYs{WexF5046V@R|BWe5O(1^{3bfBUU}ZT@Wop^3CO%3NT|;Bow|_MRGA z9_cYUl0yG#a+JFLXz>Fwnglg6bs-SQgOMNQ#!;_jJj;>P#;svR4-J0f6hiPyI(mD> zJL8p>1Vz~E=iA`(F7BTiWALmY43EMT+gVd$&&+MN!_H%@D-E8(; zRo++zrk^vfzg#Gc#lD^P^6SRZWW zkbn9(6l}kmFc1SX=3<(bAG@k^WZDN>PSxwtSHu4|O<|@}^Ie9Tn(O zB$5ns*ZEUeAX`w18Z}zW({l?eYPvboQWtS?P9E>xkcXvJ!dvphvyxubevnnie`UFX zEPuQFTq+QjQ-HyGUi4rhW0_z^ zBJ3IM?!<5^J*N&<@FQ7zE2EQ|As3(`TyP-d!}>Swu5xK)!7f}Lx`aH>?VJL>@#2Ca89LsSH(GYs3=Sl ok$?|Se8=U#`JgX)an%lx38zc)tz5Gs5Agu4d%EiHRPCPq7qw2RmjD0& literal 0 HcmV?d00001 From fee98c789316b1ada6dc49bf7960762c5abf78d2 Mon Sep 17 00:00:00 2001 From: Shane Riley Date: Tue, 30 Jul 2013 22:38:49 -0400 Subject: [PATCH 231/998] Fix XSL Types path in builder --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index dd4a478b..f94272e8 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -112,7 +112,7 @@

          Quoting

          "<a href=\"home\">Home</a>"

          Built-in Methods

          -

          A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array. +

          A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array.

          "hello".charAt( 0 ) // "h"
           "hello".toUpperCase() // "HELLO"
          
          From 11f4adf4bb5be0eb906cb8e5a9de074d110ade76 Mon Sep 17 00:00:00 2001
          From: Karl Swedberg 
          Date: Wed, 31 Jul 2013 16:27:24 -0400
          Subject: [PATCH 232/998] Update grunt-jquery-content version in package.json
           to 0.10.2
          
          ---
           package.json | 2 +-
           1 file changed, 1 insertion(+), 1 deletion(-)
          
          diff --git a/package.json b/package.json
          index 6a0aa848..9799d439 100644
          --- a/package.json
          +++ b/package.json
          @@ -24,7 +24,7 @@
               "grunt": "0.3.17",
               "grunt-clean": "0.3.0",
               "grunt-wordpress": "1.0.7",
          -    "grunt-jquery-content": "0.10.0",
          +    "grunt-jquery-content": "0.10.2",
               "grunt-check-modules": "0.1.0"
             },
             "devDependencies": {},
          
          From df46282f0e653306cb536653e580af0d3d7c42c3 Mon Sep 17 00:00:00 2001
          From: Karl Swedberg 
          Date: Wed, 31 Jul 2013 16:31:28 -0400
          Subject: [PATCH 233/998] 1.10.2-1
          
          ---
           package.json | 2 +-
           1 file changed, 1 insertion(+), 1 deletion(-)
          
          diff --git a/package.json b/package.json
          index 9799d439..8ff5cb89 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": "1.10.0-2",
          +  "version": "1.10.2-1",
             "homepage": "https://github.com/jquery/api.jquery.com",
             "author": {
               "name": "jQuery Foundation (http://jquery.org/)"
          
          From 0a8d0f93c091a52b92514f05037fd3f09bd75346 Mon Sep 17 00:00:00 2001
          From: Ben Hutton 
          Date: Fri, 30 Aug 2013 10:05:03 +0100
          Subject: [PATCH 234/998] Parent: Fixed links.
          
          ---
           entries/parent.xml | 4 ++--
           1 file changed, 2 insertions(+), 2 deletions(-)
          
          diff --git a/entries/parent.xml b/entries/parent.xml
          index 2d29c99b..3e2ecb41 100644
          --- a/entries/parent.xml
          +++ b/entries/parent.xml
          @@ -10,7 +10,7 @@
             Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
             
               

          Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.

          -

          The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

          +

          The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

          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.

          Consider a page with a basic nested list on it:

          
          @@ -78,4 +78,4 @@ $("*", document.body).each(function () {
             
             
             
          -
          \ No newline at end of file
          +
          
          From eb43c5fcfd0b7421167d1d35aa4e105def5e41b1 Mon Sep 17 00:00:00 2001
          From: Mike Pennisi 
          Date: Wed, 31 Jul 2013 10:21:39 -0400
          Subject: [PATCH 235/998] Document array-accepting manipulation methods
          
          Unit tests which assert this behavior:
          
          - append:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L291
          - appendTo:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L506
          - prepend:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L607
          - prependTo:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L671
          - before:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L739
          - after:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L291
          - insertBefore:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L784
          - insertAfter:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L853
          - replaceWith:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L988
          - replaceAll:
            https://github.com/jquery/jquery/blob/410cf4ee6bd454fa7e2bb5dc37a0b051f15d3e96/test/unit/manipulation.js#L1031
          ---
           entries/after.xml        | 3 ++-
           entries/append.xml       | 3 ++-
           entries/appendTo.xml     | 3 ++-
           entries/before.xml       | 3 ++-
           entries/insertAfter.xml  | 3 ++-
           entries/insertBefore.xml | 3 ++-
           entries/prepend.xml      | 2 ++
           entries/prependTo.xml    | 3 ++-
           entries/replaceAll.xml   | 3 ++-
           entries/replaceWith.xml  | 3 ++-
           10 files changed, 20 insertions(+), 9 deletions(-)
          
          diff --git a/entries/after.xml b/entries/after.xml
          index af5c4d4a..96e0edc4 100644
          --- a/entries/after.xml
          +++ b/entries/after.xml
          @@ -4,9 +4,10 @@
             
               1.0
               
          -      HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements.
          +      HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
                 
                 
          +      
                 
               
               
          diff --git a/entries/append.xml b/entries/append.xml
          index 0c80ec1d..ef6c0988 100644
          --- a/entries/append.xml
          +++ b/entries/append.xml
          @@ -4,9 +4,10 @@
             
               1.0
               
          -      DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
          +      DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
                 
                 
          +      
                 
               
               
          diff --git a/entries/appendTo.xml b/entries/appendTo.xml
          index cabbba46..e63419e4 100644
          --- a/entries/appendTo.xml
          +++ b/entries/appendTo.xml
          @@ -4,10 +4,11 @@
             
               1.0
               
          -      A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
          +      A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
                 
                 
                 
          +      
                 
               
             
          diff --git a/entries/before.xml b/entries/before.xml
          index e60b08b2..355dbf88 100644
          --- a/entries/before.xml
          +++ b/entries/before.xml
          @@ -4,9 +4,10 @@
             
               1.0
               
          -      HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements.
          +      HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
                 
                 
          +      
                 
               
               
          diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml
          index 9b868546..b453e844 100644
          --- a/entries/insertAfter.xml
          +++ b/entries/insertAfter.xml
          @@ -4,10 +4,11 @@
             
               1.0
               
          -      A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
          +      A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
                 
                 
                 
          +      
                 
               
             
          diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml
          index 57816608..be992727 100644
          --- a/entries/insertBefore.xml
          +++ b/entries/insertBefore.xml
          @@ -4,10 +4,11 @@
             
               1.0
               
          -      A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
          +      A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
                 
                 
                 
          +      
                 
               
             
          diff --git a/entries/prepend.xml b/entries/prepend.xml
          index e8fc0aa5..d6d731a0 100644
          --- a/entries/prepend.xml
          +++ b/entries/prepend.xml
          @@ -7,11 +7,13 @@
                 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
                 
                 
          +      
                 
               
               
                 
                 
          +      
                 
                 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
               
          diff --git a/entries/prependTo.xml b/entries/prependTo.xml
          index 8a9bd66e..b768914b 100644
          --- a/entries/prependTo.xml
          +++ b/entries/prependTo.xml
          @@ -7,8 +7,9 @@
                 
                 
                 
          +      
                 
          -      A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
          +      A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
               
             
             Insert every element in the set of matched elements to the beginning of the target.
          diff --git a/entries/replaceAll.xml b/entries/replaceAll.xml
          index 5b0f275c..12cac495 100644
          --- a/entries/replaceAll.xml
          +++ b/entries/replaceAll.xml
          @@ -4,9 +4,10 @@
             
               1.2
               
          -      A selector string, jQuery object, or DOM element reference indicating which element(s) to replace.
          +      A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
           	  
                 
          +      
                 
               
             
          diff --git a/entries/replaceWith.xml b/entries/replaceWith.xml
          index bb7c9239..7551ceba 100644
          --- a/entries/replaceWith.xml
          +++ b/entries/replaceWith.xml
          @@ -4,9 +4,10 @@
             
               1.2
               
          -      The content to insert. May be an HTML string, DOM element, or jQuery object.
          +      The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
                 
                 
          +      
                 
               
             
          
          From 431028d19ec5ef09d0ebd47b03a5e951db532f6d Mon Sep 17 00:00:00 2001
          From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
          Date: Tue, 3 Sep 2013 16:32:49 -0400
          Subject: [PATCH 236/998] 1.10.2-2
          
          ---
           package.json | 2 +-
           1 file changed, 1 insertion(+), 1 deletion(-)
          
          diff --git a/package.json b/package.json
          index 8ff5cb89..cb461f30 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": "1.10.2-1",
          +  "version": "1.10.2-2",
             "homepage": "https://github.com/jquery/api.jquery.com",
             "author": {
               "name": "jQuery Foundation (http://jquery.org/)"
          
          From 8bda0c7cb9a908f9fcf9177e1b9f0e0147340c22 Mon Sep 17 00:00:00 2001
          From: yukulele 
          Date: Tue, 10 Sep 2013 09:08:47 -0400
          Subject: [PATCH 237/998] Update options-argument.xml add version argument and
           to 'start' property
          
          ---
           includes/options-argument.xml | 6 ++++++
           1 file changed, 6 insertions(+)
          
          diff --git a/includes/options-argument.xml b/includes/options-argument.xml
          index 4f0a7d34..110456cd 100644
          --- a/includes/options-argument.xml
          +++ b/includes/options-argument.xml
          @@ -44,6 +44,12 @@
           		A function to call once the animation is complete.
           		
           	
          +	
          +		A function to call when the animation begins.
          +		
          +			An enhanced Promise object with additional properties for the animation
          +		
          +	
           	
           		A function to be called when the animation completes (its Promise object is resolved).
           		
          
          From a3565d90f88a8d064b744a1c145e5c713a7803b8 Mon Sep 17 00:00:00 2001
          From: Anne-Gaelle Colom 
          Date: Thu, 11 Jul 2013 21:06:15 +0100
          Subject: [PATCH 238/998] Code indentation and formatting (e entries)
          
          ---
           entries/each.xml                              | 162 ++++++++++--------
           entries/element-selector.xml                  |  23 +--
           entries/empty-selector.xml                    |  28 +--
           entries/empty.xml                             |  34 ++--
           entries/enabled-selector.xml                  |  17 +-
           entries/end.xml                               | 140 +++++++++------
           entries/eq-selector.xml                       |  58 ++++---
           entries/eq.xml                                |  66 +++----
           entries/error.xml                             |  23 ++-
           entries/even-selector.xml                     |  23 +--
           entries/event.currentTarget.xml               |   6 +-
           entries/event.data.xml                        |   8 +-
           entries/event.delegateTarget.xml              |   8 +-
           entries/event.isDefaultPrevented.xml          |   6 +-
           .../event.isImmediatePropagationStopped.xml   |  15 +-
           entries/event.isPropagationStopped.xml        |  15 +-
           entries/event.metaKey.xml                     |  27 +--
           entries/event.namespace.xml                   |   8 +-
           entries/event.pageX.xml                       |  26 ++-
           entries/event.pageY.xml                       |  23 ++-
           entries/event.preventDefault.xml              |  12 +-
           entries/event.relatedTarget.xml               |  10 +-
           entries/event.result.xml                      |   6 +-
           entries/event.stopImmediatePropagation.xml    |  37 ++--
           entries/event.stopPropagation.xml             |   8 +-
           entries/event.target.xml                      |  37 ++--
           entries/event.timeStamp.xml                   |  22 ++-
           entries/event.type.xml                        |  10 +-
           entries/event.which.xml                       |  20 ++-
           29 files changed, 521 insertions(+), 357 deletions(-)
          
          diff --git a/entries/each.xml b/entries/each.xml
          index 2ba02bba..081dd545 100644
          --- a/entries/each.xml
          +++ b/entries/each.xml
          @@ -11,16 +11,18 @@
             
               

          The .each() method is designed to make DOM looping constructs concise and less error-prone. When called it iterates over the DOM elements that are part of the jQuery object. Each time the callback runs, it is passed the current loop iteration, beginning from 0. More importantly, the callback is fired in the context of the current DOM element, so the keyword this refers to the element.

          Suppose you have a simple unordered list on the page:

          -
          <ul>
          -    <li>foo</li>
          -    <li>bar</li>
          +    
          
          +<ul>
          +  <li>foo</li>
          +  <li>bar</li>
           </ul>
               

          You can select the list items and iterate across them:

          -
          $( "li" ).each(function( index ) {
          -  console.log( index + ": " + $(this).text() );
          +    
          
          +$( "li" ).each(function( index ) {
          +  console.log( index + ": " + $( this ).text() );
           });
          -  
          +

          A message is thus logged for each item in the list:

          0: foo @@ -29,9 +31,10 @@

          You can stop the loop from within the callback function by returning false.

          Note: most jQuery methods that return a jQuery object also loop through the set of elements in the jQuery collection — a process known as implicit iteration. When this occurs, it is often unnecessary to explicitly iterate with the .each() method:

          -
          // The .each() method is unnecessary here:
          +
          
          +// The .each() method is unnecessary here:
           $( "li" ).each(function() {
          -  $(this).addClass( "foo" );
          +  $( this ).addClass( "foo" );
           });
           
           // Instead, you should rely on implicit iteration:
          @@ -41,79 +44,102 @@ $( "li" ).addClass( "bar" );
             
               Iterate over three divs and sets their color property.
               
               
          -    
          +  div {
          +    color: red;
          +    text-align: center;
          +    cursor: pointer;
          +    font-weight: bolder;
          +    width: 300px;
          +  }
          +]]>
          +    
             
             
          -    To access a jQuery object instead of the regular DOM element, use $(this). For example:
          +    To access a jQuery object instead of the regular DOM element, use $( this ). For example:
               
               
          -    
          +  ul {
          +    font-size: 18px;
          +    margin: 0;
          +  }
          +  span {
          +    color: blue;
          +    text-decoration: underline;
          +    cursor: pointer;
          +  }
          +  .example {
          +    font-style: italic;
          +  }
          +]]>
          +    
             
             
               Use "return" to break out of each() loops early.
               
               
          -    
          +  div {
          +    width: 40px;
          +    height: 40px;
          +    margin: 5px;
          +    float: left;
          +    border: 2px blue solid;
          +    text-align: center;
          +  }
          +  span {
          +    color: red;
          +  }
          +]]>
          +    
             
             
             
          diff --git a/entries/element-selector.xml b/entries/element-selector.xml
          index 8061f340..a26a9109 100644
          --- a/entries/element-selector.xml
          +++ b/entries/element-selector.xml
          @@ -14,22 +14,25 @@
             
             
               Finds every DIV element.
          -    
          -    
          +    
          +    
               
          +]]>
             
             
             
          -
          \ No newline at end of file
          +
          diff --git a/entries/empty-selector.xml b/entries/empty-selector.xml
          index 05e13b67..8e06d87c 100644
          --- a/entries/empty-selector.xml
          +++ b/entries/empty-selector.xml
          @@ -13,18 +13,24 @@
             
             
               Finds all elements that are empty - they don't have child elements or text.
          -    
          +    
               
          -    
          +  td {
          +    text-align: center;
          +  }
          +]]>
          +    
             
             
             
          -
          \ No newline at end of file
          +
          diff --git a/entries/empty.xml b/entries/empty.xml
          index 0a1fe9ba..9fe9c957 100644
          --- a/entries/empty.xml
          +++ b/entries/empty.xml
          @@ -7,17 +7,23 @@
             Remove all child nodes of the set of matched elements from the DOM.
             
               

          This method removes not only child (and other descendant) elements, but also any text within the set of matched elements. This is because, according to the DOM specification, any string of text within an element is considered a child node of that element. Consider the following HTML:

          -
          <div class="container">
          +    
          
          +<div class="container">
             <div class="hello">Hello</div>
             <div class="goodbye">Goodbye</div>
          -</div>
          +</div> +

          We can target any element for removal:

          -
          $('.hello').empty();
          +
          
          +$( ".hello" ).empty();
          +    

          This will result in a DOM structure with the Hello text deleted:

          -
          <div class="container">
          +    
          
          +<div class="container">
             <div class="hello"></div>
             <div class="goodbye">Goodbye</div>
          -</div>
          +</div> +

          If we had any number of nested elements inside <div class="hello">, they would be removed, too.

          To avoid memory leaks, jQuery removes other constructs such as data and event handlers from the child elements before removing the elements themselves.

          If you want to remove elements without destroying their data or event handlers (so they can be re-added later), use .detach() instead.

          @@ -25,19 +31,23 @@ Removes all child nodes (including text nodes) from all paragraphs - + +]]> - \ No newline at end of file + diff --git a/entries/enabled-selector.xml b/entries/enabled-selector.xml index 7b40f5d6..177680e3 100644 --- a/entries/enabled-selector.xml +++ b/entries/enabled-selector.xml @@ -7,7 +7,7 @@ Selects all elements that are enabled. -

          As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':enabled') is equivalent to $('*:enabled'), so $('input:enabled') or similar should be used instead.

          +

          As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":enabled" ) is equivalent to $( "*:enabled" ), so $( "input:enabled" ) or similar should be used instead.

          Although their resulting selections are usually the same, :enabled selector is subtly different from :not([disabled]); :enabled selects elements that have their boolean disabled property strictly equal to false, while :not([disabled]) selects elements that do not have a disabled attribute set (regardless of its value).

          @@ -16,12 +16,15 @@
          Find all input elements that are enabled. - - + + diff --git a/entries/end.xml b/entries/end.xml index eb1fbbb1..7d95cd59 100644 --- a/entries/end.xml +++ b/entries/end.xml @@ -10,86 +10,116 @@

          Suppose we have a couple short lists on a page:

          
           <ul class="first">
          -   <li class="foo">list item 1</li>
          -   <li>list item 2</li>
          -   <li class="bar">list item 3</li>
          +  <li class="foo">list item 1</li>
          +  <li>list item 2</li>
          +  <li class="bar">list item 3</li>
           </ul>
           <ul class="second">
          -   <li class="foo">list item 1</li>
          -   <li>list item 2</li>
          -   <li class="bar">list item 3</li>
          +  <li class="foo">list item 1</li>
          +  <li>list item 2</li>
          +  <li class="bar">list item 3</li>
           </ul>
           

          The end() method is useful primarily when exploiting jQuery's chaining properties. When not using chaining, we can usually just call up a previous object by variable name, so we don't need to manipulate the stack. With end(), though, we can string all the method calls together:

          
          -$('ul.first').find('.foo').css('background-color', 'red')
          -  .end().find('.bar').css('background-color', 'green');
          -
          +$( "ul.first" ) + .find( ".foo" ) + .css( "background-color", "red" ) + .end() + .find( ".bar" ) + .css( "background-color", "green" ); +

          This chain searches for items with the class foo within the first list only and turns their backgrounds red. Then end() returns the object to its state before the call to find(), so the second find() looks for '.bar' inside <ul class="first">, not just inside that list's <li class="foo">, and turns the matching elements' backgrounds green. The net result is that items 1 and 3 of the first list have a colored background, and none of the items from the second list do.

          A long jQuery chain can be visualized as a structured code block, with filtering methods providing the openings of nested blocks and end() methods closing them:

          
          -$('ul.first').find('.foo')
          -  .css('background-color', 'red')
          -.end().find('.bar')
          -  .css('background-color', 'green')
          -.end();
          -
          +$( "ul.first" ) + .find( ".foo" ) + .css( "background-color", "red" ) + .end() + .find( ".bar" ) + .css( "background-color", "green" ) + .end(); +

          The last end() is unnecessary, as we are discarding the jQuery object immediately thereafter. However, when the code is written in this form, the end() provides visual symmetry and a sense of completion —making the program, at least to the eyes of some developers, more readable, at the cost of a slight hit to performance as it is an additional function call.

          Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. - + +
          + Tags in jQuery object after end: +
          +]]>
          Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs. - - - + + + - \ No newline at end of file + diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml index 06f56f4f..96642ece 100644 --- a/entries/eq-selector.xml +++ b/entries/eq-selector.xml @@ -18,39 +18,44 @@ Select the element at index n within the matched set.

          The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

          -

          Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:eq(1)') selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

          +

          Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(2)" ) selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

          Prior to jQuery 1.8, the :eq(index) selector did not accept a negative value for index (though the .eq(index) method did).

          Finds the third td. - -
          + +
    elem.checked From 221e0f6089e9108c144d4958f7bedb39ccd6db1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 25 Mar 2013 14:57:11 -0400 Subject: [PATCH 132/998] prop: Removed unused class in markup. --- entries/prop.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/prop.xml b/entries/prop.xml index 3cbc038e..9aa8f6c3 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -19,7 +19,7 @@

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    Concerning boolean attributes, consider a DOM element defined by the HTML markup <input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:

    - +
    - - + +
    elem.checked From 15c9c639e84ac89e3aa63eaf69e357ab826c22ff Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 26 Mar 2013 17:28:54 -0400 Subject: [PATCH 133/998] ID selector: clarify returned # of elements. Fixes #11 --- entries/id-selector.xml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/entries/id-selector.xml b/entries/id-selector.xml index 988c356c..b42cd76a 100644 --- a/entries/id-selector.xml +++ b/entries/id-selector.xml @@ -11,15 +11,15 @@ Selects a single element with the given id attribute.

    For id selectors, jQuery uses the JavaScript function document.getElementById(), which is extremely efficient. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match.

    -
    -

    As always, remember that as a developer, your time is typically the most valuable resource. Do not focus on optimization of selector speed unless it is clear that performance needs to be improved.

    -
    +

    Calling jQuery() (or $()) with an id selector as its argument will return a jQuery object containing a collection of either zero or one DOM element.

    Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.

    If the id contains characters like periods or colons you have to escape those characters with backslashes.

    - Finds the element with the id "myDiv". - + Select the element with the id "myDiv" and give it a red border. + @@ -35,8 +35,10 @@ ]]> - Finds the element with the id "myID.entry[1]". See how certain characters must be escaped with backslashes. - + Select the element with the id "myID.entry[1]" and give it a red border. Note how certain characters must be escaped with backslashes. + id="myID.entry[0]"
    id="myID.entry[1]"
    From 3813a0b7eb9f90e5bdf483ad7e9d2873a5bbd0be Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 26 Mar 2013 19:10:10 -0400 Subject: [PATCH 134/998] .serialize(): Clarify what elements it operates on. Fixes #10 --- entries/serialize.xml | 44 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/entries/serialize.xml b/entries/serialize.xml index e55b6699..db6e075a 100644 --- a/entries/serialize.xml +++ b/entries/serialize.xml @@ -6,45 +6,25 @@ Encode a set of form elements as a string for submission. -

    The .serialize() method creates a text string in standard URL-encoded notation. It operates on a jQuery object representing a set of form elements. The form elements can be of several types:

    -
    <form>
    -  <div><input type="text" name="a" value="1" id="a" /></div>
    -  <div><input type="text" name="b" value="2" id="b" /></div>
    -  <div><input type="hidden" name="c" value="3" id="c" /></div>
    -  <div>
    -    <textarea name="d" rows="8" cols="40">4</textarea>
    -  </div>
    -  <div><select name="e">
    -    <option value="5" selected="selected">5</option>
    -    <option value="6">6</option>
    -    <option value="7">7</option>
    -  </select></div>
    -  <div>
    -    <input type="checkbox" name="f" value="8" id="f" />
    -  </div>
    -  <div>
    -    <input type="submit" name="g" value="Submit" id="g" />
    -  </div>
    -</form>
    -

    The .serialize() method can act on a jQuery object that has selected individual form elements, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> tag itself for serialization:

    -
    $('form').submit(function() {
    -  alert($(this).serialize());
    -  return false;
    +    

    The .serialize() method creates a text string in standard URL-encoded notation. It can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>: $( "input, textarea, select" ).serialize();

    +

    It is typically easier, however, to select the <form> itself for serialization:

    +
    $( "form" ).on( "submit", function( event ) {
    +  event.preventDefault();
    +  console.log( $(this).serialize() );
     });
    -

    This produces a standard-looking query string:

    -
    a=1&b=2&c=3&d=4&e=5
    +

    In this case, jQuery serializes the successful controls within the form.

    Warning: selecting both the form and its children will cause duplicates in the serialized string.

    Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

    - Serialize a form to a query string, that could be sent to a server in an Ajax request. + Serialize a form to a query string that could be sent to a server in an Ajax request.

    Now, make an Ajax request using any jQuery method:

    -
    $( "button.trigger" ).click(function() {
    +    
    $( "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.

    As of jQuery 1.8, the .ajaxError() method should only be attached to document.

    -

    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. If the request failed because JavaScript raised an exception, the exception object is passed to the handler as a fourth parameter. For example, to restrict the error callback to only handling events dealing with a particular URL:

    +

    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, exception) {
       if ( settings.url == "ajax/missing.html" ) {
         $( "div.log" ).text( "Triggered ajaxError handler." );
    
    From 07787bfefe76cd1729ae4c6c3b3a4bd865a89f67 Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Wed, 27 Mar 2013 08:23:39 -0400
    Subject: [PATCH 136/998] Descendant selector: improve example/demo.
    
    Closes #39
    ---
     entries/descendant-selector.xml | 38 ++++++++++++++++++---------------
     1 file changed, 21 insertions(+), 17 deletions(-)
    
    diff --git a/entries/descendant-selector.xml b/entries/descendant-selector.xml
    index 3d3d6292..750cfad6 100644
    --- a/entries/descendant-selector.xml
    +++ b/entries/descendant-selector.xml
    @@ -16,29 +16,33 @@
         

    A descendant of an element could be a child, grandchild, great-grandchild, and so on, of that element.

    - Finds all input descendants of forms. - + Mark all inputs that are descendants of a form with a dotted blue border. Give a yellow background to inputs that are descendants of a fieldset that is a descendant of a form. + +
    + + +
    + +Sibling to form: +]]>
    - \ No newline at end of file + From 7a897af3adfe4b0721aa2fae42f653093ca2b794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 27 Mar 2013 11:05:53 -0400 Subject: [PATCH 137/998] Upgrade to grunt-jquery-content 0.8.7. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 630bf085..8ff029c2 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.x", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.5", - "grunt-jquery-content": "0.8.6", + "grunt-jquery-content": "0.8.7", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 2706b44537edc6e28f3012706088958d6937b143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 27 Mar 2013 11:08:09 -0400 Subject: [PATCH 138/998] 1.9.1-5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ff029c2..bb9b0a4f 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": "1.9.1-4", + "version": "1.9.1-5", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From a8ae312f5f0321550dd37d25ae4ffd8289859982 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 28 Mar 2013 00:02:02 -0400 Subject: [PATCH 139/998] fadeTo(): Fix img src to point to /resources/ Closes #274 --- entries/fadeTo.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml index 3f5c010e..0b98805e 100644 --- a/entries/fadeTo.xml +++ b/entries/fadeTo.xml @@ -50,10 +50,10 @@ });

    - - - - + + + +

    With duration set to 0, this method just changes the opacity CSS property, so .fadeTo(0, opacity) is the same as .css('opacity', opacity).

    From 8b18163a5d83b35ca6746e704afdc080099aa3ff Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Mon, 1 Apr 2013 04:45:52 -0500 Subject: [PATCH 140/998] Happy New Year --- LICENSE-MIT.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE-MIT.txt b/LICENSE-MIT.txt index e8b475d6..091e6f07 100644 --- a/LICENSE-MIT.txt +++ b/LICENSE-MIT.txt @@ -1,5 +1,5 @@ Copyright (c) 2009 Packt Publishing, http://packtpub.com/ -Copyright (c) 2012 jQuery Foundation, http://jquery.org/ +Copyright (c) 2013 jQuery Foundation, http://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history From 4f5a67c518b8e4de0d4afaf8618c29c38df59ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 1 Apr 2013 10:23:22 -0400 Subject: [PATCH 141/998] Upgrade to grunt-wordpress 1.0.7 and grunt-jquery-content 0.9.0. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bb9b0a4f..c37721ef 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,10 @@ } ], "dependencies": { - "grunt": "0.3.x", + "grunt": "0.3.17", "grunt-clean": "0.3.0", - "grunt-wordpress": "1.0.5", - "grunt-jquery-content": "0.8.7", + "grunt-wordpress": "1.0.7", + "grunt-jquery-content": "0.9.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 0e4ebf3ce065bde6e4934133b586164ce5116f52 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 08:06:36 -0400 Subject: [PATCH 142/998] .keypress(): Fix info re difference from keydown Closes #278 --- entries/keypress.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/keypress.xml b/entries/keypress.xml index 3a1f8a09..9e1995e0 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -23,8 +23,8 @@

    Note: as the keypress event isn't covered by any official specification, the actual behavior encountered when using it may differ across browsers, browser versions, and platforms.

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

    -

    The keypress event is sent to an element when the browser registers keyboard input. This is similar to the keydown event, except in the case of key repeats. If the user presses and holds a key, a keydown event is triggered once, but separate keypress events are triggered for each inserted character. In addition, modifier keys (such as Shift) trigger keydown events but not keypress events.

    -

    A keypress event handler 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.

    +

    The keypress event is sent to an element when the browser registers keyboard input. This is similar to the keydown event, except that modifier and non-printing keys such as Shift, Esc, and delete trigger keydown events but not keypress events. Other differences between the two events may arise depending on platform and browser.

    +

    A keypress event handler 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 controls can always get focus so are reasonable candidates for this event type.

    For example, consider the HTML:

    <form>
       <fieldset>
    @@ -36,17 +36,17 @@
     </div>

    The event handler can be bound to the input field:

    $("#target").keypress(function() {
    -  alert("Handler for .keypress() called.");
    +  console.log("Handler for .keypress() called.");
     });
    -

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

    +

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

    Handler for .keypress() called.

    -

    The message repeats if the key is held down. To trigger the event manually, apply .keypress() without an argument::

    +

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

    $('#other').click(function() {
       $("#target").keypress();
     });
    -

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

    +

    After this code executes, clicks on the Trigger the handler div will also log 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 character was entered, 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 character code.

    Note that keydown and keyup provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. An uppercase "A" is reported as 65 by all events. Because of this distinction, when catching special keystrokes such as arrow keys, .keydown() or .keyup() is a better choice.

    From 7dfdc210e894759e088eaafa5174ab9aadfe7444 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 08:20:50 -0400 Subject: [PATCH 143/998] =?UTF-8?q?Change=20?= =?UTF-8?q?=E2=80=A6=20to=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #277 --- entries/bind.xml | 4 ++-- entries/blur.xml | 4 ++-- entries/change.xml | 2 +- entries/click.xml | 4 ++-- entries/dblclick.xml | 4 ++-- entries/each.xml | 4 ++-- entries/error.xml | 2 +- entries/focus.xml | 4 ++-- entries/get.xml | 6 +++--- entries/index.xml | 10 +++++----- entries/jQuery.each.xml | 8 ++++---- entries/jQuery.param.xml | 8 ++++---- entries/keydown.xml | 4 ++-- entries/keypress.xml | 4 ++-- entries/keyup.xml | 4 ++-- entries/mousedown.xml | 4 ++-- entries/mouseenter.xml | 6 +++--- entries/mouseleave.xml | 6 +++--- entries/mousemove.xml | 10 +++++----- entries/mouseout.xml | 6 +++--- entries/mouseover.xml | 6 +++--- entries/mouseup.xml | 4 ++-- entries/scroll.xml | 4 ++-- entries/select.xml | 2 +- entries/size.xml | 4 ++-- entries/submit.xml | 2 +- entries/toggle-event.xml | 10 +++++----- 27 files changed, 68 insertions(+), 68 deletions(-) diff --git a/entries/bind.xml b/entries/bind.xml index c209799f..e8e1efae 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -100,7 +100,7 @@ $('#bar').bind('click', function() { alert(message); });
    -

    Because the handlers are closures that both have message in their environment, both will display the message Not in the face! when triggered. The variable's value has changed. To sidestep this, we can pass the message in using eventData: +

    Because the handlers are closures that both have message in their environment, both will display the message Not in the face! when triggered. The variable's value has changed. To sidestep this, we can pass the message in using eventData:

    var message = 'Spoon!';
     $('#foo').bind('click', {msg: message}, function(event) {
    @@ -111,7 +111,7 @@ $('#bar').bind('click', {msg: message}, function(event) {
       alert(event.data.msg);
     });
     
    -

    This time the variable is not referred to directly within the handlers; instead, the variable is passed in by value through eventData, which fixes the value at the time the event is bound. The first handler will now display Spoon! while the second will alert Not in the face! +

    This time the variable is not referred to directly within the handlers; instead, the variable is passed in by value through eventData, which fixes the value at the time the event is bound. The first handler will now display Spoon! while the second will alert Not in the face!

    Note that objects are passed to functions by reference, which further complicates this scenario.

    diff --git a/entries/blur.xml b/entries/blur.xml index a5a8eb6d..b174bb66 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -37,13 +37,13 @@ $('#target').blur(function() { });

    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:

    $('#other').click(function() {
       $('#target').blur();
     });
    -

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

    +

    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().

    diff --git a/entries/change.xml b/entries/change.xml index 37b9d361..7fb0ce9b 100644 --- a/entries/change.xml +++ b/entries/change.xml @@ -42,7 +42,7 @@
    $('#other').click(function() {
       $('.target').change();
     });
    -

    After this code executes, clicks on Trigger the handler will also alert the message. The message will display twice, because the handler has been bound to the change event on both of the form elements.

    +

    After this code executes, clicks on Trigger the handler will also alert the message. The message will display twice, because the handler has been bound to the change event on both of the form elements.

    As of jQuery 1.4, the change event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.

    diff --git a/entries/click.xml b/entries/click.xml index bc7ff79e..7c76e5ce 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -39,13 +39,13 @@ });

    Now if we click on this element, the alert is displayed:

    - Handler for .click() called. + Handler for .click() called.

    We can also trigger the event when a different element is clicked:

    $("#other").click(function() {
       $("#target").click();
     });
    -

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

    +

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

    The click event is only triggered after this exact series of events:

    • The mouse button is depressed while the pointer is inside the element.
    • diff --git a/entries/dblclick.xml b/entries/dblclick.xml index c0c05a1a..f1b12dba 100644 --- a/entries/dblclick.xml +++ b/entries/dblclick.xml @@ -39,13 +39,13 @@ });

      Now double-clicking on this element displays the alert:

      - Handler for .dblclick() called. + Handler for .dblclick() called.

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

      $('#other').click(function() {
         $('#target').dblclick();
       });
      -

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

      +

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

      The dblclick event is only triggered after this exact series of events:

      • The mouse button is depressed while the pointer is inside the element.
      • diff --git a/entries/each.xml b/entries/each.xml index a5de051a..2ba02bba 100644 --- a/entries/each.xml +++ b/entries/each.xml @@ -23,9 +23,9 @@

        A message is thus logged for each item in the list:

        - 0: foo + 0: foo
        - 1: bar + 1: bar

        You can stop the loop from within the callback function by returning false.

        Note: most jQuery methods that return a jQuery object also loop through the set of elements in the jQuery collection — a process known as implicit iteration. When this occurs, it is often unnecessary to explicitly iterate with the .each() method:

        diff --git a/entries/error.xml b/entries/error.xml index 380d89ef..69b79e50 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -31,7 +31,7 @@

        If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed:

        - Handler for .error() called. + Handler for .error() called.

        The event handler must be attached before the browser fires the error event, which is why the example sets the src attribute after attaching the handler. Also, the error event may not be correctly fired when the page is served locally; error relies on HTTP status codes and will generally not be triggered if the URL uses the file: protocol.

        diff --git a/entries/focus.xml b/entries/focus.xml index 208cc4aa..5c680f5a 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -44,13 +44,13 @@ });

        Now clicking on the first field, or tabbing to it from another field, displays the alert:

        - Handler for .focus() called. + Handler for .focus() called.

        We can trigger the event when another element is clicked:

        $('#other').click(function() {
           $('#target').focus();
         });
        -

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

        +

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

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

        diff --git a/entries/get.xml b/entries/get.xml index de6ef14a..7d89b1c3 100644 --- a/entries/get.xml +++ b/entries/get.xml @@ -26,7 +26,7 @@
        ($('li').get(0));

        Since the index is zero-based, the first list item is returned:

        - <li id="foo"> + <li id="foo">

        Each jQuery object also masquerades as an array, so we can use the array dereferencing operator to get at the list item instead:

        alert($('li')[0]);
        @@ -34,7 +34,7 @@
        alert($('li').get(-1));

        A negative index is counted from the end of the matched set, so this example will return the last item in the list:

        - <li id="bar"> + <li id="bar">

        @@ -78,4 +78,4 @@ $("*", document.body).click(function (e) { - \ No newline at end of file + diff --git a/entries/index.xml b/entries/index.xml index acde75f6..74fff3ac 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -40,7 +40,7 @@ alert('Index: ' + $('li').index(listItem)); We get back the zero-based position of the list item:

        - Index: 1 + Index: 1

        Similarly, if we retrieve a jQuery object consisting of one of the three list items, .index() will search for that list item:

        
        @@ -49,7 +49,7 @@ alert('Index: ' + $('li').index(listItem));
         

        We get back the zero-based position of the list item:

        - Index: 1 + Index: 1

        Note that if the jQuery collection used as the .index() method's argument contains more than one element, the first element within the matched set of elements will be used.

        
        @@ -58,7 +58,7 @@ alert('Index: ' + $('li').index(listItems));
         

        We get back the zero-based position of the first list item within the matched set:

        - Index: 1 + Index: 1

        If we use a string as the .index() method's argument, it is interpreted as a jQuery selector string. The first element among the object's matched elements which also matches this selector is located.

        
        @@ -67,13 +67,13 @@ alert('Index: ' + listItem.index('li'));
         

        We get back the zero-based position of the list item:

        - Index: 1 + Index: 1

        If we omit the argument, .index() will return the position of the first element within the set of matched elements in relation to its siblings:

        alert('Index: ' + $('#bar').index());

        Again, we get back the zero-based position of the list item:

        - Index: 1 + Index: 1

        diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index 31584a79..16ae2b6e 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -19,9 +19,9 @@

        This produces two messages:

        - 0: 52 + 0: 52
        - 1: 97 + 1: 97

        If an object is used as the collection, the callback is passed a key-value pair each time:

        var obj = {
        @@ -33,9 +33,9 @@ $.each( obj, function( key, value ) {
         });

        Once again, this produces two messages:

        - flammable: inflammable + flammable: inflammable
        - duh: no duh + duh: no duh

        We can break the $.each() loop at a particular iteration by making the callback function return false. Returning non-false is the same as a continue statement in a for loop; it will skip immediately to the next iteration.

        diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 9914cbb5..38cb3b8c 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -53,9 +53,9 @@ alert(recursiveDecoded);

        The values of recursiveEncoded and recursiveDecoded are alerted as follows:

        - a%5Bone%5D=1&a%5Btwo%5D=2&a%5Bthree%5D=3&b%5B%5D=1&b%5B%5D=2&b%5B%5D=3 + a%5Bone%5D=1&a%5Btwo%5D=2&a%5Bthree%5D=3&b%5B%5D=1&b%5B%5D=2&b%5B%5D=3
        - a[one]=1&a[two]=2&a[three]=3&b[]=1&b[]=2&b[]=3 + a[one]=1&a[two]=2&a[three]=3&b[]=1&b[]=2&b[]=3

        To emulate the behavior of $.param() prior to jQuery 1.4, we can set the traditional argument to true:

        var myObject = {
        @@ -74,9 +74,9 @@ alert(shallowDecoded);
         

        The values of shallowEncoded and shallowDecoded are alerted as follows:

        - a=%5Bobject+Object%5D&b=1&b=2&b=3 + a=%5Bobject+Object%5D&b=1&b=2&b=3
        - a=[object+Object]&b=1&b=2&b=3 + a=[object+Object]&b=1&b=2&b=3

        diff --git a/entries/keydown.xml b/entries/keydown.xml index 0988808d..a022191c 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -36,13 +36,13 @@ });

        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:

        $('#other').click(function() {
           $('#target').keydown();
         });
        -

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

        +

        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.

        diff --git a/entries/keypress.xml b/entries/keypress.xml index 9e1995e0..b1c3f557 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -40,13 +40,13 @@ });

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

        - Handler for .keypress() called. + Handler for .keypress() called.

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

        $('#other').click(function() {
           $("#target").keypress();
         });
        -

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

        +

        After this code executes, clicks on the Trigger the handler div will also log 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 character was entered, 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 character code.

        Note that keydown and keyup provide a code indicating which key is pressed, while keypress indicates which character was entered. For example, a lowercase "a" will be reported as 65 by keydown and keyup, but as 97 by keypress. An uppercase "A" is reported as 65 by all events. Because of this distinction, when catching special keystrokes such as arrow keys, .keydown() or .keyup() is a better choice.

        diff --git a/entries/keyup.xml b/entries/keyup.xml index 92874d13..be9bcf94 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -37,13 +37,13 @@

        Now when the insertion point is inside the field and a key is pressed and released, the alert is displayed:

        - Handler for .keyup() called. + Handler for .keyup() called.

        To trigger the event manually, apply .keyup() without arguments:

        $('#other').click(function() {
           $('#target').keyup();
         });
        -

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

        +

        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.

        diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 68a4e086..715ac0a0 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -39,13 +39,13 @@ });

        Now if we click on this element, the alert is displayed:

        - Handler for .mousedown() called. + Handler for .mousedown() called.

        We can also trigger the event when a different element is clicked:

        $('#other').click(function() {
           $('#target').mousedown();
         });
        -

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

        +

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

        The mousedown event is sent when any mouse button is clicked. To act only on specific buttons, we can use the event object's which property. Not all browsers support this property (Internet Explorer uses button instead), but jQuery normalizes the property so that it is safe to use in any browser. The value of which will be 1 for the left button, 2 for the middle button, or 3 for the right button.

        This event is primarily useful for ensuring that the primary button was used to begin a drag operation; if ignored, strange results can occur when the user attempts to use a context menu. While the middle and right buttons can be detected with these properties, this is not reliable. In Opera and Safari, for example, right mouse button clicks are not detectable by default.

        If the user clicks on an element, drags away from it, and releases the button, this is still counted as a mousedown event. This sequence of actions is treated as a "canceling" of the button press in most user interfaces, so it is usually better to use the click event unless we know that the mousedown event is preferable for a particular situation.

        diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml index 1dc1ffb1..4ad7f77b 100644 --- a/entries/mouseenter.xml +++ b/entries/mouseenter.xml @@ -41,12 +41,12 @@
        $('#outer').mouseenter(function() {
           $('#log').append('<div>Handler for .mouseenter() called.</div>');
         });
        -

        Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

        +

        Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

        $('#other').click(function() {
               $('#outer').mouseenter();
             });
        -

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

        -

        The mouseenter event differs from mouseover in the way it handles event bubbling. If mouseover were used in this example, then when the mouse pointer moved over the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseenter event, on the other hand, only triggers its handler when the mouse enters the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse enters the Outer element, but not the Inner element.

        +

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

        +

        The mouseenter event differs from mouseover in the way it handles event bubbling. If mouseover were used in this example, then when the mouse pointer moved over the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseenter event, on the other hand, only triggers its handler when the mouse enters the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse enters the Outer element, but not the Inner element.

        Show texts when mouseenter and mouseout event triggering. diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml index 1082b040..11a15d2a 100644 --- a/entries/mouseleave.xml +++ b/entries/mouseleave.xml @@ -41,12 +41,12 @@
        $('#outer').mouseleave(function() {
           $('#log').append('<div>Handler for .mouseleave() called.</div>');
         });
        -

        Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

        +

        Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

        $('#other').click(function() {
           $('#outer').mouseleave();
         });
        -

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

        -

        The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.

        +

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

        +

        The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.

        Show number of times mouseout and mouseleave events are triggered. mouseout fires when the pointer moves out of child element as well, while mouseleave fires only when the pointer moves out of the bound element. diff --git a/entries/mousemove.xml b/entries/mousemove.xml index 48d4a534..d6609404 100644 --- a/entries/mousemove.xml +++ b/entries/mousemove.xml @@ -39,13 +39,13 @@ });

        Now when the mouse pointer moves within the target button, the messages are appended to <div id="log">:

        - Handler for .mousemove() called at (399, 48) + Handler for .mousemove() called at (399, 48)
        - Handler for .mousemove() called at (398, 46) + Handler for .mousemove() called at (398, 46)
        - Handler for .mousemove() called at (397, 44) + Handler for .mousemove() called at (397, 44)
        - Handler for .mousemove() called at (396, 42) + Handler for .mousemove() called at (396, 42)

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

        @@ -54,7 +54,7 @@ });

        After this code executes, clicks on the Trigger button will also append the message:

        - Handler for .mousemove() called at (undefined, undefined) + Handler for .mousemove() called at (undefined, undefined)

        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.

        diff --git a/entries/mouseout.xml b/entries/mouseout.xml index 67557c55..3314631e 100644 --- a/entries/mouseout.xml +++ b/entries/mouseout.xml @@ -41,12 +41,12 @@
        $('#outer').mouseout(function() {
           $('#log').append('Handler for .mouseout() called.');
         });
        -

        Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. To trigger the event manually, apply .mouseout() without an argument::

        +

        Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. To trigger the event manually, apply .mouseout() without an argument::

        $('#other').click(function() {
           $('#outer').mouseout();
         });
        -

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

        -

        This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves out of the Inner element in this example, a mouseout event will be sent to that, then trickle up to Outer. This can trigger the bound mouseout handler at inopportune times. See the discussion for .mouseleave() for a useful alternative.

        +

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

        +

        This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves out of the Inner element in this example, a mouseout event will be sent to that, then trickle up to Outer. This can trigger the bound mouseout handler at inopportune times. See the discussion for .mouseleave() for a useful alternative.

        Show the number of times mouseout and mouseleave events are triggered. diff --git a/entries/mouseover.xml b/entries/mouseover.xml index 1dfed9c6..4c03a067 100644 --- a/entries/mouseover.xml +++ b/entries/mouseover.xml @@ -41,12 +41,12 @@
        $('#outer').mouseover(function() {
           $('#log').append('<div>Handler for .mouseover() called.</div>');
         });
        -

        Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. We can also trigger the event when another element is clicked:

        +

        Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. We can also trigger the event when another element is clicked:

        $('#other').click(function() {
               $('#outer').mouseover();
               });
        -

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

        -

        This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves over the Inner element in this example, a mouseover event will be sent to that, then trickle up to Outer. This can trigger our bound mouseover handler at inopportune times. See the discussion for .mouseenter() for a useful alternative.

        +

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

        +

        This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves over the Inner element in this example, a mouseover event will be sent to that, then trickle up to Outer. This can trigger our bound mouseover handler at inopportune times. See the discussion for .mouseenter() for a useful alternative.

        Show the number of times mouseover and mouseenter events are triggered. diff --git a/entries/mouseup.xml b/entries/mouseup.xml index cb2b50cb..88242fe4 100644 --- a/entries/mouseup.xml +++ b/entries/mouseup.xml @@ -41,13 +41,13 @@

        Now if we click on this element, the alert is displayed:

        - Handler for .mouseup() called. + Handler for .mouseup() called.

        We can also trigger the event when a different element is clicked:

        $('#other').click(function() {
           $('#target').mouseup();
         });
        -

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

        +

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

        If the user clicks outside an element, drags onto it, and releases the button, this is still counted as a mouseup event. This sequence of actions is not treated as a button press in most user interfaces, so it is usually better to use the click event unless we know that the mouseup event is preferable for a particular situation.

        diff --git a/entries/scroll.xml b/entries/scroll.xml index c70b9545..0f96c8ed 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -48,13 +48,13 @@ });

        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:

        $('#other').click(function() {
           $('#target').scroll();
         });
        -

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

        +

        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.

        diff --git a/entries/select.xml b/entries/select.xml index 01043375..19e3f90f 100644 --- a/entries/select.xml +++ b/entries/select.xml @@ -40,7 +40,7 @@ });

        After this code executes, clicks on the Trigger button will also alert the message:

        - Handler for .select() called. + Handler for .select() called.

        In addition, the default select action on the field will be fired, so the entire text field will be selected.

        diff --git a/entries/size.xml b/entries/size.xml index 57c67e6b..d1177068 100644 --- a/entries/size.xml +++ b/entries/size.xml @@ -21,10 +21,10 @@ alert( "Size: " + $("li").length );

        This results in two alerts:

        - Size: 2 + Size: 2

        - Size: 2 + Size: 2

        diff --git a/entries/submit.xml b/entries/submit.xml index bdf2c436..8404edee 100644 --- a/entries/submit.xml +++ b/entries/submit.xml @@ -43,7 +43,7 @@
        $('#other').click(function() {
           $('#target').submit();
         });
        -

        After this code executes, clicks on Trigger the handler will also display the message. In addition, the default submit action on the form will be fired, so the form will be submitted.

        +

        After this code executes, clicks on Trigger the handler will also display the message. In addition, the default submit action on the form will be fired, so the form will be submitted.

        The JavaScript submit event does not bubble in Internet Explorer. However, scripts that rely on event delegation with the submit event will work consistently across browsers as of jQuery 1.4, which has normalized the event's behavior.

        diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index e452a65b..1cace6b5 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -31,15 +31,15 @@ });

        As the element is clicked repeatedly, the messages alternate:

        - First handler for .toggle() called. + First handler for .toggle() called.
        - Second handler for .toggle() called. + Second handler for .toggle() called.
        - First handler for .toggle() called. + First handler for .toggle() called.
        - Second handler for .toggle() called. + Second handler for .toggle() called.
        - First handler for .toggle() called. + First handler for .toggle() called.

        If more than two handlers are provided, .toggle() will cycle among all of them. For example, if there are three handlers, then the first handler will be called on the first click, the fourth click, the seventh click, and so on.

        The .toggle() method is provided for convenience. It is relatively straightforward to implement the same behavior by hand, and this can be necessary if the assumptions built into .toggle() prove limiting. For example, .toggle() is not guaranteed to work correctly if applied twice to the same element. Since .toggle() internally uses a click handler to do its work, we must unbind click to remove a behavior attached with .toggle(), so other click handlers can be caught in the crossfire. The implementation also calls .preventDefault() on the event, so links will not be followed and buttons will not be clicked if .toggle() has been called on the element.

        From bcf6a56043ebc23bd5884ad21d4e540c168e7c9b Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 09:39:23 -0400 Subject: [PATCH 144/998] :lt, :gt selectors: update to include -index Closes #276 --- entries/gt-selector.xml | 30 ++++++++++++++++++++---------- entries/lt-selector.xml | 22 ++++++++++++++++------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/entries/gt-selector.xml b/entries/gt-selector.xml index 8a26148e..628c48f7 100644 --- a/entries/gt-selector.xml +++ b/entries/gt-selector.xml @@ -1,13 +1,20 @@ :gt() Selector - :gt(index) + :gt(index) 1.0 Zero-based index. + + :gt(-index) + 1.8 + + Zero-based index, counting backwards from the last element. + + Select all elements at an index greater than index within the matched set.

        @@ -15,18 +22,21 @@

        The index-related selector expressions (including this "greater than" selector) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

        Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:gt(1)') selects elements after the second element in the document with the class myclass, rather than after the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

        +

        Prior to jQuery 1.8, the :gt(index) selector did not accept a negative value for index

        - Finds TD #5 and higher. Reminder: the indexing starts at 0. - - + Give TD #5 and higher a yellow background and TD #8 a red text color. + + diff --git a/entries/lt-selector.xml b/entries/lt-selector.xml index 2e158f62..450076cc 100644 --- a/entries/lt-selector.xml +++ b/entries/lt-selector.xml @@ -1,13 +1,20 @@ :lt() Selector - :lt(index) + :lt(index) 1.0 Zero-based index. + + :lt(-index) + 1.8 + + Zero-based index, counting backwards from the last element. + + Select all elements at an index less than index within the matched set.

        @@ -15,16 +22,19 @@

        The index-related selectors (including this "less than" selector) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

        Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:lt(1)') selects the first element in the document with the class myclass, rather than selecting no elements. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

        +

        Prior to jQuery 1.8, the :lt(index) selector did not accept a negative value for index

        - Finds TDs less than the one with the 4th index (TD#4). - - + From becece18f8978bd4128efc0964cf52c7fbe93944 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 10:02:11 -0400 Subject: [PATCH 145/998] $.Callbacks: change an example to avoid confusion No ticket. --- entries/jQuery.Callbacks.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.Callbacks.xml b/entries/jQuery.Callbacks.xml index 7082eaa6..84142ba2 100644 --- a/entries/jQuery.Callbacks.xml +++ b/entries/jQuery.Callbacks.xml @@ -19,7 +19,7 @@ function fn1( value ) { } function fn2( value ) { - fn1("fn2 says: " + value); + console.log("fn2 says: " + value); return false; } From 2530f20aed3d0bd501f7d0c2463fd0ace493462f Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 10:24:09 -0400 Subject: [PATCH 146/998] Deferred methods: Update arg types for progress, reject, resolve cf. http://forum.jquery.com/topic/confusion-of-anything-vs-object-in-documentation --- entries/deferred.progress.xml | 8 +++++--- entries/deferred.reject.xml | 4 ++-- entries/deferred.resolve.xml | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/entries/deferred.progress.xml b/entries/deferred.progress.xml index ce956eef..fd7635a1 100644 --- a/entries/deferred.progress.xml +++ b/entries/deferred.progress.xml @@ -3,15 +3,17 @@ deferred.progress() 1.7 - + + + - A function, or array of functions, that is called when the Deferred generates progress notifications. + A function, or array of functions, to be called when the Deferred generates progress notifications. Add handlers to be called when the Deferred object generates progress notifications. -

        The argument can be either a single function or an array of functions. When the Deferred generates progress notifications by calling notify or notifyWith, the progressCallbacks are called. Since deferred.progress() returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any progressCallbacks added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the .notify() or notifyWith() call. For more information, see the documentation jQuery.Deferred().

        +

        The argument can be either a single function or an array of functions. When the Deferred generates progress notifications by calling notify or notifyWith, the progressCallbacks are called. Since deferred.progress() returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any progressCallbacks added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the .notify() or notifyWith() call. For more information, see the documentation for jQuery.Deferred().

        diff --git a/entries/deferred.reject.xml b/entries/deferred.reject.xml index 0c458dc5..c4c488c8 100644 --- a/entries/deferred.reject.xml +++ b/entries/deferred.reject.xml @@ -3,7 +3,7 @@ deferred.reject() 1.5 - + Optional arguments that are passed to the failCallbacks. @@ -12,7 +12,7 @@ Reject a Deferred object and call any failCallbacks with the given args.

        Normally, only the creator of a Deferred should call this method; you can prevent other code from changing the Deferred's state by returning a restricted Promise object through deferred.promise().

        -

        When the Deferred is rejected, any failCallbacks added by deferred.then or deferred.fail are called. Callbacks are executed in the order they were added. Each callback is passed the args from the deferred.reject() call. Any failCallbacks added after the Deferred enters the rejected state are executed immediately when they are added, using the arguments that were passed to the .reject() call. For more information, see the documentation for Deferred object.

        +

        When the Deferred is rejected, any failCallbacks added by deferred.then() or deferred.fail() are called. Callbacks are executed in the order they were added. Each callback is passed the args from the deferred.reject() call. Any failCallbacks added after the Deferred enters the rejected state are executed immediately when they are added, using the arguments that were passed to the deferred.reject() call. For more information, see the documentation for jQuery.Deferred().

        diff --git a/entries/deferred.resolve.xml b/entries/deferred.resolve.xml index edeb418c..8ed34680 100644 --- a/entries/deferred.resolve.xml +++ b/entries/deferred.resolve.xml @@ -3,7 +3,7 @@ deferred.resolve() 1.5 - + Optional arguments that are passed to the doneCallbacks. @@ -11,7 +11,7 @@ Resolve a Deferred object and call any doneCallbacks with the given args. -

        When the Deferred is resolved, any doneCallbacks added by deferred.then or deferred.done are called. Callbacks are executed in the order they were added. Each callback is passed the args from the .resolve(). Any doneCallbacks added after the Deferred enters the resolved state are executed immediately when they are added, using the arguments that were passed to the .resolve() call. For more information, see the documentation for Deferred object.

        +

        When the Deferred is resolved, any doneCallbacks added by deferred.then() or deferred.done() are called. Callbacks are executed in the order they were added. Each callback is passed the args from the deferred.resolve(). Any doneCallbacks added after the Deferred enters the resolved state are executed immediately when they are added, using the arguments that were passed to the deferred.resolve() call. For more information, see the documentation for jQuery.Deferred().

        From 783cd0d11e6023ff6a2032ffa85a2ecd1dedb7d3 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 10:25:04 -0400 Subject: [PATCH 147/998] 1.9.1-6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c37721ef..10f9484c 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": "1.9.1-5", + "version": "1.9.1-6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From c5a906fea436bfad0337bb0ccb0d42c8e4fabbee Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 10:46:09 -0400 Subject: [PATCH 148/998] addclass: Fix error in expected outcome of an example. Closes #273 --- entries/addClass.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/addClass.xml b/entries/addClass.xml index e8bc5232..1deb5b09 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -22,10 +22,10 @@
        $("p").removeClass("myClass noClass").addClass("yourClass");

        Here, the myClass and noClass classes are removed from all paragraphs, while yourClass is added.

        As of jQuery 1.4, the .addClass() method's argument can receive a function.

        -
        $("ul li:last").addClass(function(index) {
        +    
        $("ul li").addClass(function(index) {
           return "item-" + index;
         });
        -

        Given an unordered list with five <li> elements, this example adds the class "item-4" to the last <li>.

        +

        Given an unordered list with two <li> elements, this example adds the class "item-0" to the first <li> and "item-1" to the second.

        Add the class "selected" to the matched elements. From 47b36c94bd8bf8b202ce3849fb3efe1d47cbb190 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 5 Apr 2013 10:51:04 -0400 Subject: [PATCH 149/998] Add .data(obj) example --- entries/data.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/entries/data.xml b/entries/data.xml index 21d5fc27..f9e439be 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -23,11 +23,12 @@

        The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks.

        We can set several distinct values for a single element and retrieve them later:

        
        -$('body').data('foo', 52);
        -$('body').data('bar', { myType: 'test', count: 40 });
        +$("body").data("foo", 52);
        +$("body").data("bar", { myType: "test", count: 40 });
        +$("body").data({ baz: [ 1, 2, 3 ] });
         
        -$('body').data('foo'); // 52
        -$('body').data(); // {foo: 52, bar: { myType: 'test', count: 40 }}
        +$("body").data("foo"); // 52
        +$("body").data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }
         

        In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element. jQuery itself uses the .data() method to save information under the names 'events' and 'handle', and also reserves any data name starting with an underscore ('_') for internal use.

        Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

        From 0626a9c124d035355e8d6f0bd0af833459df1b2f Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 10:54:34 -0400 Subject: [PATCH 150/998] .data(): Fix link to W3C HTML5 spec for data-* attrs Closes #269 --- entries/data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/data.xml b/entries/data.xml index f9e439be..056b66f6 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -85,7 +85,7 @@ alert( $("body").data("bar")); //foobar

        HTML5 data-* Attributes

        -

        As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

        +

        As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

        For example, given the following HTML:

        <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>

        All of the following jQuery code will work.

        From 4eefe05563c78dc8d049e4b312f0d20abe798ed7 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 5 Apr 2013 16:53:13 -0400 Subject: [PATCH 151/998] $.ajax(), .ajaxError(): Note re x-domain script/JSONP. Closes #37 --- entries/ajaxError.xml | 2 +- entries/jQuery.ajax.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index e7cdbf87..ea7d58a2 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -9,7 +9,7 @@ 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.

        +

        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.

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

        <button class="trigger">Trigger</button>
         <div class="result"></div>
        diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
        index 4c3619ea..02f8ef65 100644
        --- a/entries/jQuery.ajax.xml
        +++ b/entries/jQuery.ajax.xml
        @@ -74,7 +74,7 @@
                 
                 
                 
        -        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."  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 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."  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. 
               
               
                 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.
        
        From 6471f84f565b08c176add11188e5bb4cfe081f9e Mon Sep 17 00:00:00 2001
        From: Rick Waldron 
        Date: Sat, 6 Apr 2013 18:03:55 -0400
        Subject: [PATCH 152/998] jQuery.type(): correct terminology, add "boxed"
         examples
        
        Signed-off-by: Rick Waldron 
        ---
         entries/jQuery.type.xml | 6 +++++-
         1 file changed, 5 insertions(+), 1 deletion(-)
        
        diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml
        index 47c1f443..994cfb99 100644
        --- a/entries/jQuery.type.xml
        +++ b/entries/jQuery.type.xml
        @@ -19,13 +19,17 @@
                   
      • jQuery.type( null ) === "null"
      -
    • If the object has an internal [[Class]] equivalent to one of the browser's built-in objects, the associated name is returned. (More details about this technique.) +
    • If the argument is either a primitive value or an instance of a standard built-in ECMAScript object, the [[Class]] internal property is used to determine the type. (More details about this technique.)
      • jQuery.type( true ) === "boolean"
      • +
      • jQuery.type( new Boolean() ) === "boolean"
      • jQuery.type( 3 ) === "number"
      • +
      • jQuery.type( new Number(3) ) === "number"
      • jQuery.type( "test" ) === "string"
      • +
      • jQuery.type( new String("test") ) === "string"
      • jQuery.type( function(){} ) === "function"
      • jQuery.type( [] ) === "array"
      • +
      • jQuery.type( new Array() ) === "array"
      • jQuery.type( new Date() ) === "date"
      • jQuery.type( new Error() ) === "error" // as of jQuery 1.9
      • jQuery.type( /test/ ) === "regexp"
      • From 195b519fe6c31222cefd3f546698c87ca42a3971 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 10 Apr 2013 09:26:08 -0400 Subject: [PATCH 153/998] :root selector: Remove stray arg from copy/pasta --- entries/root-selector.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/entries/root-selector.xml b/entries/root-selector.xml index 76a6acec..76924b25 100644 --- a/entries/root-selector.xml +++ b/entries/root-selector.xml @@ -4,9 +4,6 @@ :root 1.9 - - The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-last-child(even), :nth-last-child(4n) ) - Selects the element that is the root of the document. From ca763901c2b553fea191486a5f684528004bd3bb Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 10 Apr 2013 09:26:52 -0400 Subject: [PATCH 154/998] 1.9.1-7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10f9484c..d5539c9e 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": "1.9.1-6", + "version": "1.9.1-7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From f24dcab02779c43ea6e7ed46934cfadef0fda5e3 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 10 Apr 2013 09:33:47 -0400 Subject: [PATCH 155/998] jQuery.type():
      • ->
      • --- entries/jQuery.type.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml index 994cfb99..49f4df67 100644 --- a/entries/jQuery.type.xml +++ b/entries/jQuery.type.xml @@ -26,7 +26,7 @@
      • jQuery.type( 3 ) === "number"
      • jQuery.type( new Number(3) ) === "number"
      • jQuery.type( "test" ) === "string"
      • -
      • jQuery.type( new String("test") ) === "string"
      • +
      • jQuery.type( new String("test") ) === "string"
      • jQuery.type( function(){} ) === "function"
      • jQuery.type( [] ) === "array"
      • jQuery.type( new Array() ) === "array"
      • From ec4a0223eb6b05805cb266562695b9c8bcab6a90 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 10 Apr 2013 09:35:42 -0400 Subject: [PATCH 156/998] 1.9.1-8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5539c9e..e4ef8a8e 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": "1.9.1-7", + "version": "1.9.1-8", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From a7ddd36da00313b6ed10404f7c2e6eae1498f5b1 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 21 Apr 2013 19:28:55 -0400 Subject: [PATCH 157/998] jQuery.browser. Make abundantly clear that jQuery.browser is removed as of jQuery 1.9. Closes #283 --- categories.xml | 3 +++ entries/jQuery.browser.xml | 44 ++++++++------------------------------ 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/categories.xml b/categories.xml index 164fc09e..00f9c0a7 100644 --- a/categories.xml +++ b/categories.xml @@ -227,6 +227,9 @@ + + +
        - Returns true if the current useragent is some version of Microsoft's Internet Explorer. + Return true if the current useragent is some version of Microsoft's Internet Explorer. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. - Alerts "this is WebKit!" only for WebKit browsers + Alert "this is WebKit!" only for WebKit browsers. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. - - - Alerts "Do stuff for Firefox 3" only for Firefox 3 browsers. - - - - Set a CSS property that's specific to a particular browser. - @@ -71,7 +52,7 @@ jQuery.each(jQuery.browser, function(i, val) { 1.1.3 - The version number of the rendering engine for the user's browser. + The version number of the rendering engine for the user's browser. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin.

        Here are some typical results:

          @@ -83,32 +64,25 @@ jQuery.each(jQuery.browser, function(i, val) {

          Note that IE8 claims to be 7 in Compatibility View.

          - Returns the version number of the rendering engine used by the user's current browser. For example, FireFox 4 returns 2.0 (the version of the Gecko rendering engine it utilizes). + Return the version number of the rendering engine used by the user's current browser. For example, FireFox 4 returns 2.0 (the version of the Gecko rendering engine it utilizes). Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. - Alerts the version of IE's rendering engine that is being used: + Alert the version of IE's rendering engine that is being used. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. - - - Often you only care about the "major number," the whole number, which you can get by using JavaScript's built-in parseInt() function: - - + + From ba23a347ede7228d19c9e8eaab44e2147fea82d6 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Sun, 21 Apr 2013 19:35:45 -0400 Subject: [PATCH 158/998] Fixing typo in offset doc --- entries/offset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/offset.xml b/entries/offset.xml index 545a9797..21ff6eb6 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -8,7 +8,7 @@ Get the current coordinates of the first element in the set of matched elements, relative to the document. -

          The .offset() method allows us to retrieve the current position of an element 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 the more useful.

          +

          The .offset() method allows us to retrieve the current position of an element 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 borders, margins, or padding set on the body element.

          From d8dd08398eb7116018093bf8bf9df87e8b3759ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 23 Apr 2013 12:21:21 -0400 Subject: [PATCH 159/998] Added CONTRIBUTING.md. --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..7eef9342 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Welcome! Thanks for your interest in contributing to api.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [documentation](http://contribute.jquery.org/documentation). + +You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). + +You can find us on [IRC](http://irc.jquery.org), specifically in [#jquery-dev](irc://irc.freenode.net/#jquery-dev) should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). From 0c742bccdf05b3c53a68971f16a086a6e2fa8126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 23 Apr 2013 14:15:14 -0400 Subject: [PATCH 160/998] CONTRIBUTING: Added link to #jquery-content. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7eef9342..f6ce8293 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,4 +2,4 @@ Welcome! Thanks for your interest in contributing to api.jquery.com. You're **al You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). -You can find us on [IRC](http://irc.jquery.org), specifically in [#jquery-dev](irc://irc.freenode.net/#jquery-dev) should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). +You can find us on [IRC](http://irc.jquery.org), specifically in [#jquery-dev](irc://irc.freenode.net/#jquery-dev) and [#jquery-content](irc://irc.freenode.net/#jquery-content) should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). From bdf04d6fc68c5c22cea23adf18d3ce42f6afbe11 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 30 Apr 2013 17:35:24 -0400 Subject: [PATCH 161/998] Fix a few entries with multiple return types: * .get(), .prop(), and .val() * Closes #291 --- entries/get.xml | 4 +++- entries/prop.xml | 4 +++- entries/val.xml | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/entries/get.xml b/entries/get.xml index 7d89b1c3..65194020 100644 --- a/entries/get.xml +++ b/entries/get.xml @@ -1,5 +1,7 @@ - + + + .get() 1.0 diff --git a/entries/prop.xml b/entries/prop.xml index 9aa8f6c3..bbee69f1 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -1,7 +1,9 @@ Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element. - + + + .prop() 1.6 diff --git a/entries/val.xml b/entries/val.xml index c9898efa..97efe196 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -1,7 +1,10 @@ Get the current value of the first element in the set of matched elements or set the value of every matched element. - + + + + .val() 1.0 From 9623971f08f58be9e361bdc4df7f0811d52bd8dc Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 30 Apr 2013 17:35:40 -0400 Subject: [PATCH 162/998] 1.9.1-9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4ef8a8e..6dfe5311 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": "1.9.1-8", + "version": "1.9.1-9", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 5f58e3f68fcdfd3c01e297575814faffc4b363e8 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 30 Apr 2013 18:49:29 -0400 Subject: [PATCH 163/998] 1.9.1-10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6dfe5311..f010ced8 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": "1.9.1-9", + "version": "1.9.1-10", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 99ac813af1641a5d6640fd15faec67e166cc8c60 Mon Sep 17 00:00:00 2001 From: Marcus Ekwall Date: Tue, 30 Apr 2013 18:54:23 -0400 Subject: [PATCH 164/998] jQuery.When(): Clarifying example code --- entries/jQuery.when.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index 30dde8ff..f46cabfc 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -22,12 +22,14 @@ Execute a function after two ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). - From 32bcb8e3e879ed3131a80ff0991d6299e05f4855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 1 May 2013 08:52:37 -0400 Subject: [PATCH 165/998] Change notes to use warning class instead of blockquotes. --- entries/animate.xml | 12 ++++++------ entries/attr.xml | 8 ++++---- entries/bind.xml | 8 ++++---- entries/clone.xml | 8 ++++---- entries/delay.xml | 4 ++-- entries/error.xml | 4 ++-- entries/fadeOut.xml | 4 ++-- entries/find.xml | 4 ++-- entries/finish.xml | 4 ++-- entries/focus.xml | 4 ++-- entries/height.xml | 4 ++-- entries/jQuery.ajax.xml | 4 ++-- entries/jQuery.ajaxSetup.xml | 4 ++-- entries/jQuery.contains.xml | 4 ++-- entries/jQuery.getJSON.xml | 4 ++-- entries/jQuery.param.xml | 8 ++++---- entries/jQuery.support.xml | 4 ++-- entries/load-event.xml | 12 ++++++------ entries/load.xml | 4 ++-- entries/offset.xml | 4 ++-- entries/position.xml | 4 ++-- entries/promise.xml | 4 ++-- entries/prop.xml | 4 ++-- entries/ready.xml | 4 ++-- entries/scrollLeft.xml | 4 ++-- entries/select.xml | 4 ++-- entries/stop.xml | 4 ++-- entries/submit.xml | 4 ++-- entries/toggle-event.xml | 4 ++-- entries/toggle.xml | 4 ++-- entries/trigger.xml | 2 +- entries/unbind.xml | 4 ++-- entries/unload.xml | 4 ++-- entries/val.xml | 4 ++-- 34 files changed, 83 insertions(+), 83 deletions(-) diff --git a/entries/animate.xml b/entries/animate.xml index e67347ff..4c4ec428 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -27,9 +27,9 @@

          Shorthand CSS properties (e.g. font, background, border) are not fully supported. For example, if you want to animate the rendered border width, at least a border style and border width other than "auto" must be set in advance. Or, if you want to animate font size, you would use fontSize or the CSS equivalent 'font-size' rather than simply 'font'.

          In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element.

          Animated properties can also be relative. If a value is supplied with a leading += or -= sequence of characters, then the target value is computed by adding or subtracting the given number from the current value of the property.

          -
          +

          Note: Unlike shorthand animation methods such as .slideDown() and .fadeIn(), the .animate() method does not make hidden elements visible as part of the effect. For example, given $('someElement').hide().animate({height:'20px'}, 500), the animation will run, but the element will remain hidden.

          -
          +

          Duration

          Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The default duration is 400 milliseconds. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

          Complete Function

          @@ -62,12 +62,12 @@

          The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

          Directional properties (top, right, bottom, left) have no discernible effect on elements if their position style property is static, which it is by default.

          -
          +

          Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

          -
          -
          + +

          Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

          -
          +

          Step Function

          The second version of .animate() provides a step option — a callback function that is fired at each step of the animation. This function is useful for enabling custom animation types or altering the animation as it is occurring. It accepts two arguments (now and fx), and this is set to the DOM element being animated.

          diff --git a/entries/attr.xml b/entries/attr.xml index 8ba679c8..d53f6637 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -17,12 +17,12 @@
        • Convenience: It can be called directly on a jQuery object and chained to other jQuery methods.
        • Cross-browser consistency: The values of some attributes are reported inconsistently across browsers, and even across versions of a single browser. The .attr() method reduces such inconsistencies.
        • -
          +

          Note: Attribute values are strings with the exception of a few attributes such as value and tabindex.

          -
          -
          + +

          Note: Attempting to change the type attribute (or property) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

          -
          +

          As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

          Attributes vs. Properties

          diff --git a/entries/bind.xml b/entries/bind.xml index e8e1efae..f1206f0f 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -113,13 +113,13 @@ $('#bar').bind('click', {msg: message}, function(event) {

          This time the variable is not referred to directly within the handlers; instead, the variable is passed in by value through eventData, which fixes the value at the time the event is bound. The first handler will now display Spoon! while the second will alert Not in the face!

          -
          +

          Note that objects are passed to functions by reference, which further complicates this scenario.

          -
          +

          If eventData is present, it is the second argument to the .bind() method; if no additional data needs to be sent to the handler, then the callback is passed as the second and final argument.

          -
          +

          See the .trigger() method reference for a way to pass data to a handler at the time the event happens rather than when the handler is bound.

          -
          +

          As of jQuery 1.4 we can no longer attach data (and thus, events) to object, embed, or applet elements because critical errors occur when attaching data to Java applets.

          Note: Although demonstrated in the next example, it is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable.

          diff --git a/entries/clone.xml b/entries/clone.xml index 1ce4883d..df9227f6 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -42,9 +42,9 @@ <div class="hello">Hello</div> </div> </div> -
          +

          Note: When using the .clone() method, you can modify the cloned elements or their contents before (re-)inserting them into the document.

          -
          +

          Normally, any event handlers bound to the original element are not copied to the clone. The optional withDataAndEvents parameter allows us to change this behavior, and to instead make copies of all of the event handlers as well, bound to the new copy of the element. As of jQuery 1.4, all element data (attached by the .data() method) is also copied to the new copy.

          However, objects and arrays within element data are not copied and will continue to be shared between the cloned element and the original element. To deep copy all data, copy each one manually:

          var $elem = $('#elem').data( "arr": [ 1 ] ), // Original element with attached data
          @@ -52,9 +52,9 @@
               .data( "arr", $.extend( [], $elem.data("arr") ) ); // Deep copy to prevent data sharing
           

          As of jQuery 1.5, withDataAndEvents can be optionally enhanced with deepWithDataAndEvents to copy the events and data for all children of the cloned element.

          -
          +

          Note: Using .clone() has the side-effect of producing elements with duplicate id attributes, which are supposed to be unique. Where possible, it is recommended to avoid cloning elements with this attribute or using class attributes as identifiers instead.

          -
          + Clones all b elements (and selects the clones) and prepends them to all paragraphs. diff --git a/entries/delay.xml b/entries/delay.xml index 7562a0bd..5da629cf 100644 --- a/entries/delay.xml +++ b/entries/delay.xml @@ -17,11 +17,11 @@

          Using the standard effects queue, we can, for example, set an 800-millisecond delay between the .slideUp() and .fadeIn() of <div id="foo">:

          $('#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.

          -
          + Animate the hiding and showing of two divs, delaying the first before showing it. diff --git a/entries/error.xml b/entries/error.xml index 69b79e50..ab3dd595 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -33,9 +33,9 @@

          Handler for .error() called.

          -
          +

          The event handler must be attached before the browser fires the error event, which is why the example sets the src attribute after attaching the handler. Also, the error event may not be correctly fired when the page is served locally; error relies on HTTP status codes and will generally not be triggered if the URL uses the file: protocol.

          -
          +

          Note: A jQuery error event handler should not be attached to the window object. The browser fires the window's error event when a script error occurs. However, the window error event receives different arguments and has different return value requirements than conventional event handlers. Use window.onerror instead.

          diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index 814213f2..5f972aa1 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -38,9 +38,9 @@

          -
          +

          Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

          -
          +

          Easing

          As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

          Callback Function

          diff --git a/entries/find.xml b/entries/find.xml index 28d4228a..14ddba90 100644 --- a/entries/find.xml +++ b/entries/find.xml @@ -46,9 +46,9 @@

          If we begin at item II, we can find list items within it:

          $('li.item-ii').find('li').css('background-color', 'red');

          The result of this call is a red background on items A, B, 1, 2, 3, and C. Even though item II matches the selector expression, it is not included in the results; only descendants are considered candidates for the match.

          -
          +

          Unlike in the rest of the tree traversal methods, the selector expression is required in a call to .find(). If we need to retrieve all of the descendant elements, we can pass in the universal selector '*' to accomplish this.

          -
          +

          Selector context is implemented with the .find() method; therefore, $('li.item-ii').find('li') is equivalent to $('li', 'li.item-ii').

          As of jQuery 1.6, we can also filter the selection with a given jQuery collection or element. With the same nested list as above, if we start with:

          var $allListElements = $('li');
          diff --git a/entries/finish.xml b/entries/finish.xml index bb6ed7e5..3c143118 100644 --- a/entries/finish.xml +++ b/entries/finish.xml @@ -12,9 +12,9 @@

          When .finish() is called on an element, the currently-running animation and all queued animations (if any) immediately stop and their CSS properties set to their target values. All queued animations are removed.

          If the first argument is provided, only the animations in the queue represented by that string will be stopped.

          The .finish() method is similar to .stop(true, true) in that it clears the queue and the current animation jumps to its end value. It differs, however, in that .finish() also causes the CSS property of all queued animations to jump to their end values, as well.

          -
          +

          Animations may be stopped globally by setting the property $.fx.off to true. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.

          -
          + Click the Go button once to start the animation, and then click the other buttons to see how they affect the current and queued animations. diff --git a/entries/focus.xml b/entries/focus.xml index 5c680f5a..67b2a097 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -26,9 +26,9 @@
        • The focus event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
        • Elements with focus are usually highlighted in some way by the browser, for example with a dotted line surrounding the element. The focus is used to determine which element is the first to receive keyboard-related events.
        -
        +

        Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use .focus() on elements that are visible. To run an element's focus event handlers without setting focus to the element, use .triggerHandler("focus") instead of .focus().

        -
        +

        For example, consider the HTML:

        <form>
           <input id="target" type="text" value="Field 1" />
        diff --git a/entries/height.xml b/entries/height.xml
        index 80719630..7ecbc047 100644
        --- a/entries/height.xml
        +++ b/entries/height.xml
        @@ -16,9 +16,9 @@
               
        $(window).height();   // returns height of browser viewport
         $(document).height(); // returns height of HTML document

        Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property.

        -
        +

        Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

        -
        + Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 02f8ef65..6ae1517b 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -205,9 +205,9 @@ $.ajax({

      -
      +

      Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

      -
      +
      // Assign handlers immediately after making the request,
       // and remember the jqxhr object for this request
       var jqxhr = $.ajax( "example.php" )
      diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml
      index 7d7a924d..a172687a 100644
      --- a/entries/jQuery.ajaxSetup.xml
      +++ b/entries/jQuery.ajaxSetup.xml
      @@ -21,9 +21,9 @@
         // url not set here; uses ping.php
         data: {'name': 'Dan'}
       });
      -
      +

      Note: Global callback functions should be set with their respective global Ajax event handler methods—.ajaxStart(), .ajaxStop(), .ajaxComplete(), .ajaxError(), .ajaxSuccess(), .ajaxSend()—rather than within the options object for $.ajaxSetup().

      -
      + Sets the defaults for Ajax requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following Ajax requests then sends some data without having to set anything else. diff --git a/entries/jQuery.contains.xml b/entries/jQuery.contains.xml index 45db68c5..d1730e9c 100644 --- a/entries/jQuery.contains.xml +++ b/entries/jQuery.contains.xml @@ -13,9 +13,9 @@ Check to see if a DOM element is a descendant of another DOM element.

      The $.contains() method returns true if the DOM element provided by the second argument is a descendant of the DOM element provided by the first argument, whether it is a direct child or nested more deeply. Otherwise, it returns false. Only element nodes are supported; if the second argument is a text or comment node, $.contains() will return false.

      -
      +

      Note: The first argument must be a DOM element, not a jQuery object or plain JavaScript object.

      -
      +
      Check if an element is a descendant of another. diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 2fe8fcb0..6e3316d1 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -48,9 +48,9 @@

      Using this structure, the example loops through the requested data, builds an unordered list, and appends it to the body.

      The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

      As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

      -
      +

      Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

      -
      +

      JSONP

      If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

      The jqXHR Object

      diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 38cb3b8c..2b077390 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -29,12 +29,12 @@
      [{name:"first",value:"Rick"},
       {name:"last",value:"Astley"},
       {name:"job",value:"Rock Star"}]
      -
      +

      Note: Because some frameworks have limited ability to parse serialized arrays, developers should exercise caution when passing an obj argument that contains objects or arrays nested within another array.

      -
      -
      + +

      Note: Because there is no universally agreed-upon specification for param strings, it is not possible to encode complex data structures using this method in a manner that works ideally across all languages supporting such input. Until such time that there is, the $.param method will remain in its current form.

      -
      +

      In jQuery 1.4, HTML5 input elements are also serialized.

      We can display a query string representation of an object and a URI-decoded version of the same as follows:

      var myObject = {
      diff --git a/entries/jQuery.support.xml b/entries/jQuery.support.xml
      index 605aeb15..967de747 100644
      --- a/entries/jQuery.support.xml
      +++ b/entries/jQuery.support.xml
      @@ -10,7 +10,7 @@
           

      Since jQuery requires these tests internally, they must be performed on every page load. Although some of these properties are documented below, they are not subject to a long deprecation/removal cycle and may be removed once internal jQuery code no longer needs them.

      -
      +

      Following are a few resources that explain how feature detection works:

      -
      +

      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.

      The tests included in jQuery.support are as follows:

        diff --git a/entries/load-event.xml b/entries/load-event.xml index a40eedfd..817aea0a 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -29,10 +29,10 @@

        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:

        @@ -43,10 +43,10 @@
      • Can cease to fire for images that already live in the browser's cache

      -
    -
    + +

    Note: The .live() and .delegate() methods cannot be used to detect the load event of an iframe. The load event does not correctly bubble up the parent document and the event.target isn't set by Firefox, IE9 or Chrome, which is required to do event delegation.

    -
    +
    Run a function when the page is fully loaded including graphics. diff --git a/entries/load.xml b/entries/load.xml index 6a0d718d..a0b4aa38 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -17,9 +17,9 @@ Load data from the server and place the returned HTML into the matched element. -
    +

    Note: The event handling suite also has a method named .load(). jQuery determines which method to fire based on the set of arguments passed to it.

    -
    +

    This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

    $('#result').load('ajax/test.html');

    If no element is matched by the selector — in this case, if the document does not contain an element with id="result" — the Ajax request will not be sent.

    diff --git a/entries/offset.xml b/entries/offset.xml index 21ff6eb6..697b79f3 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -10,10 +10,10 @@

    The .offset() method allows us to retrieve the current position of an element 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 borders, margins, or padding set on the body 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: diff --git a/entries/position.xml b/entries/position.xml index 52c1d16c..4b314139 100644 --- a/entries/position.xml +++ b/entries/position.xml @@ -8,9 +8,9 @@

    The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful.

    Returns an object containing the properties top and left.

    -
    +

    Note: jQuery does not support getting the position coordinates of hidden elements or accounting for borders, margins, or padding set on the body element.

    -
    +
    Access the position of the second paragraph: diff --git a/entries/promise.xml b/entries/promise.xml index 7f18a0b4..624c2f75 100644 --- a/entries/promise.xml +++ b/entries/promise.xml @@ -16,9 +16,9 @@

    By default, type is "fx", which means the returned Promise is resolved when all animations of the selected elements have completed.

    Resolve context and sole argument is the collection onto which .promise() has been called.

    If target is provided, .promise() will attach the methods onto it and then return this object rather than create a new one. This can be useful to attach the Promise behavior to an object that already exists.

    -
    +

    Note: The returned Promise is linked to a Deferred object stored on the .data() for an element. Since the.remove() method removes the element's data as well as the element itself, it will prevent any of the element's unresolved Promises from resolving. If it is necessary to remove an element from the DOM before its Promise is resolved, use .detach() instead and follow with .removeData() after resolution.

    -
    +
    Using .promise() on a collection with no active animation returns a resolved Promise: diff --git a/entries/prop.xml b/entries/prop.xml index bbee69f1..8ee297f1 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -14,9 +14,9 @@ Get the value of a property for the first element in the set of matched elements.

    The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery's .each() or .map() method.

    -
    +

    Note: Attempting to change the type property (or attribute) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

    -
    +

    Attributes vs. Properties

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    diff --git a/entries/ready.xml b/entries/ready.xml index e9c0f892..8f329c38 100644 --- a/entries/ready.xml +++ b/entries/ready.xml @@ -11,10 +11,10 @@

    While JavaScript provides the load event for executing code when a page is rendered, this event does not get triggered until all assets such as images have been completely received. In most cases, the script can be run as soon as the DOM hierarchy has been fully constructed. The handler passed to .ready() is guaranteed to be executed after the DOM is ready, so this is usually the best place to attach all other event handlers and run other jQuery code. When using scripts that rely on the value of CSS style properties, it's important to reference external stylesheets or embed style elements before referencing the scripts.

    In cases where code relies on loaded assets (for example, if the dimensions of an image are required), the code should be placed in a handler for the load event instead.

    -
    +

    The .ready() method is generally incompatible with the <body onload=""> attribute. If load must be used, either do not use .ready() or use jQuery's .load() method to attach load event handlers to the window or to more specific items, like images.

    -
    +

    All three of the following syntaxes are equivalent:

    • diff --git a/entries/scrollLeft.xml b/entries/scrollLeft.xml index bd65f6ae..85f539e3 100644 --- a/entries/scrollLeft.xml +++ b/entries/scrollLeft.xml @@ -9,9 +9,9 @@ Get the current horizontal position of the scroll bar for the first element in the set of matched elements.

      The horizontal scroll position is the same as the number of pixels that are hidden from view to the left of the scrollable area. If the scroll bar is at the very left, or if the element is not scrollable, this number will be 0.

      -
      +

      Note:.scrollLeft(), when called directly or animated as a property using .animate(), will not work if the element it is being applied to is hidden.

      -
      +
      Get the scrollLeft of a paragraph. diff --git a/entries/select.xml b/entries/select.xml index 19e3f90f..d49f5ae2 100644 --- a/entries/select.xml +++ b/entries/select.xml @@ -43,9 +43,9 @@ Handler for .select() called.

      In addition, the default select action on the field will be fired, so the entire text field will be selected.

      -
      +

      The method for retrieving the current selected text differs from one browser to another. A number of jQuery plug-ins offer cross-platform solutions.

      -
      + To do something when text in input boxes is selected: diff --git a/entries/stop.xml b/entries/stop.xml index 2f0f8721..498cb257 100644 --- a/entries/stop.xml +++ b/entries/stop.xml @@ -41,9 +41,9 @@ });

      Toggling Animations

      As of jQuery 1.7, stopping a toggled animation prematurely with .stop() will trigger jQuery's internal effects tracking. In previous versions, calling the .stop() method before a toggled animation was completed would cause the animation to lose track of its state (if jumpToEnd was false). Any subsequent animations would start at a new "half-way" state, sometimes resulting in the element disappearing. To observe the new behavior, see the final example below.

      -
      +

      Animations may be stopped globally by setting the property $.fx.off to true. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.

      -
      + Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one. diff --git a/entries/submit.xml b/entries/submit.xml index 8404edee..02768909 100644 --- a/entries/submit.xml +++ b/entries/submit.xml @@ -23,9 +23,9 @@

      This method is a shortcut for .on('submit', handler) in the first variation, and .trigger('submit') in the third.

      The submit event is sent to an element when the user is attempting to submit a form. It can only be attached to <form> elements. Forms can be submitted either by clicking an explicit <input type="submit">, <input type="image">, or <button type="submit">, or by pressing Enter when certain form elements have focus.

      -
      +

      Depending on the browser, the Enter key may only cause a form submission if the form has exactly one text field, or only when there is a submit button present. The interface should not rely on a particular behavior for this key unless the issue is forced by observing the keypress event for presses of the Enter key.

      -
      +

      For example, consider the HTML:

      <form id="target" action="destination.html">
         <input type="text" value="Hello there" />
      diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml
      index 1cace6b5..50588c12 100644
      --- a/entries/toggle-event.xml
      +++ b/entries/toggle-event.xml
      @@ -15,9 +15,9 @@
           
         
         
      -    
      +

      Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

      -
      +

      The .toggle() method binds a handler for the click event, so the rules outlined for the triggering of click apply here as well.

      For example, consider the HTML:
       <div id="target">
      diff --git a/entries/toggle.xml b/entries/toggle.xml
      index 8127ff36..b112cd3f 100644
      --- a/entries/toggle.xml
      +++ b/entries/toggle.xml
      @@ -30,9 +30,9 @@
         
       
         
      -    
      +

      Note: The event handling suite also has a method named .toggle(). Which one is fired depends on the set of arguments passed.

      -
      +

      With no parameters, the .toggle() method simply toggles the visibility of elements:

      $('.target').toggle();

      The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS display property. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

      diff --git a/entries/trigger.xml b/entries/trigger.xml index 1e5b5d1a..67039fd0 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -41,7 +41,7 @@ $('#foo').trigger('custom', ['Custom', 'Event']);

      The event object is always passed as the first parameter to an event handler. An array of arguments can also be passed to the .trigger() call, and these parameters will be passed along to the handler as well following the event object. As of jQuery 1.6.2, single string or numeric argument can be passed without being wrapped in an array.

      Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

      The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

      -
      Note: For both plain objects and DOM objects, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      +
      Note: For both plain objects and DOM objects, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      Clicks to button #2 also trigger a click for button #1. diff --git a/entries/unbind.xml b/entries/unbind.xml index 59aec250..a4f6b5db 100644 --- a/entries/unbind.xml +++ b/entries/unbind.xml @@ -48,9 +48,9 @@ $('#foo').unbind('click', function() { alert('The quick brown fox jumps over the lazy dog.'); });

      Even though the two functions are identical in content, they are created separately and so JavaScript is free to keep them as distinct function objects. To unbind a particular handler, we need a reference to that function and not a different one that happens to do the same thing.

      -
      +

      Note: Using a proxied function to unbind an event on an element will unbind all proxied functions on that element, as the same proxy function is used for all proxied events. To allow unbinding a specific event, use unique class names on the event (e.g. click.proxy1, click.proxy2) when attaching them.

      -
      +

      Using Namespaces

      Instead of maintaining references to handlers in order to unbind them, we can namespace the events and use this capability to narrow the scope of our unbinding actions. As shown in the discussion for the .bind() method, namespaces are defined by using a period (.) character when binding a handler:

      $('#foo').bind('click.myEvents', handler);
      diff --git a/entries/unload.xml b/entries/unload.xml index f2cbe83a..3594eb75 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -20,9 +20,9 @@

      This method is a shortcut for .on('unload', handler).

      The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

      -
      +

      The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers, and contrasted with the proprietary beforeunload event.

      -
      +

      Any unload event handler should be bound to the window object:

      $(window).unload(function() {
         alert('Handler for .unload() called.');
      diff --git a/entries/val.xml b/entries/val.xml
      index 97efe196..67e8eba3 100644
      --- a/entries/val.xml
      +++ b/entries/val.xml
      @@ -17,9 +17,9 @@
       $('select.foo').val();                    // get the value from a dropdown select even easier
       $('input:checkbox:checked').val();        // get the value from a checked checkbox
       $('input:radio[name=bar]:checked').val(); // get the value from a set of radio buttons
      -
      +

      Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

      -
      +
      
       $.valHooks.textarea = {
         get: function( elem ) {
      
      From 3142c443e06857761f856f8a7ae3299dd01798a7 Mon Sep 17 00:00:00 2001
      From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
      Date: Wed, 1 May 2013 08:55:43 -0400
      Subject: [PATCH 166/998] 1.9.1-11
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index f010ced8..9a165d91 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": "1.9.1-10",
      +  "version": "1.9.1-11",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (http://jquery.org/)"
      
      From 9b988ff9394b7f91e0b673c9c1abcac0717b8b9d Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Mon, 6 May 2013 11:11:53 -0400
      Subject: [PATCH 167/998] .get(): Split into 2 signatures and update content.
      
      ---
       entries/get.xml | 48 ++++++++++++++++++++++++++----------------------
       1 file changed, 26 insertions(+), 22 deletions(-)
      
      diff --git a/entries/get.xml b/entries/get.xml
      index 65194020..babf4bab 100644
      --- a/entries/get.xml
      +++ b/entries/get.xml
      @@ -5,51 +5,55 @@
         .get()
         
           1.0
      -    
      +    
             A zero-based integer indicating which element to retrieve.
           
         
      +  
      +    1.0
      +  
         Retrieve the DOM elements matched by the jQuery object.
         
      -    

      The .get() method grants us access to the DOM nodes underlying each jQuery object. Suppose we had a simple unordered list on the page:

      +

      The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

      
       <ul>
         <li id="foo">foo</li>
         <li id="bar">bar</li>
       </ul>
           
      -

      Without a parameter, .get() returns all of the elements:

      -
      alert($('li').get());
      -

      All of the matched DOM nodes are returned by this call, contained in a standard array:

      -

      - [<li id="foo">, <li id="bar">] -

      -

      With an index specified, .get() will retrieve a single element:

      -
      ($('li').get(0));
      +

      With an index specified, .get(index) retrieves a single element:

      +
      console.log( $( "li" ).get( 0 ) );

      Since the index is zero-based, the first list item is returned:

      <li id="foo">

      +

      Without a parameter, .get() returns an array of all of the elements:

      +
      console.log( $( "li" ).get() );
      +

      All of the matched DOM nodes are returned by this call, contained in a standard array:

      +

      + [<li id="foo">, <li id="bar">] +

      +

      Each jQuery object also masquerades as an array, so we can use the array dereferencing operator to get at the list item instead:

      -
      alert($('li')[0]);
      +
      console.log( $( "li" )[0] );

      However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:

      -
      alert($('li').get(-1));
      -

      A negative index is counted from the end of the matched set, so this example will return the last item in the list:

      +
      console.log( $( "li" ).get(-1) );
      +

      A negative index is counted from the end of the matched set, so this example returns the last item in the list:

      <li id="bar">

      - Selects all divs in the document and returns the DOM Elements as an Array, then uses the built-in reverse-method to reverse that array. + Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. - Gives the tag name of the element clicked on. + Display the tag name of the click element. - Remove the two white spaces at the start and at the end of the string. + Remove the white spaces at the start and at the end of the string. - \ No newline at end of file + From 13192d0992e2ed45414ff240bea1250e2b99d605 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Wed, 8 May 2013 19:04:12 -0700 Subject: [PATCH 169/998] Another quick change, catching the other "two" spaces --- entries/jQuery.trim.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.trim.xml b/entries/jQuery.trim.xml index 6e448e72..6481c9f6 100644 --- a/entries/jQuery.trim.xml +++ b/entries/jQuery.trim.xml @@ -12,7 +12,7 @@

      The $.trim() function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.

      - Remove the two white spaces at the start and at the end of the string. + Remove the white spaces at the start and at the end of the string. An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. - When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it'll always be sent to the server (even if no data is sent). If no charset is specified, data will be transmitted to the server using the server's default charset; you must decode this appropriately on the server side. + When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
      $.ajax({
      
      From 5230f85be51a4336860c9ffedf3edc4ab689705e Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Wed, 15 May 2013 22:37:59 -0400
      Subject: [PATCH 171/998] Document X-Requested-With header, close gh-303.
      
      ---
       entries/jQuery.ajax.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
      index 7435b2be..53c02466 100644
      --- a/entries/jQuery.ajax.xml
      +++ b/entries/jQuery.ajax.xml
      @@ -80,7 +80,7 @@
               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.
             
             
      -        An object of additional header key/value pairs to send along with the request. This setting is set before the beforeSend function is called; therefore, any values in the headers setting can be overwritten from within the beforeSend function.
      +        An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here.  Values in the headers setting can also be overwritten from within the beforeSend function.
             
             
               Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
      
      From 79cd93079dd5c25153f53e6e8f6eabcd31ce6215 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Wed, 15 May 2013 22:47:39 -0400
      Subject: [PATCH 172/998] .length and .size() are Integer, close gh-302. Thanks
       @andyli!
      
      ---
       entries/length.xml | 2 +-
       entries/size.xml   | 2 +-
       2 files changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/length.xml b/entries/length.xml
      index 2d67f782..d6d27b59 100644
      --- a/entries/length.xml
      +++ b/entries/length.xml
      @@ -1,5 +1,5 @@
       
      -
      +
         .length
         
           1.0
      diff --git a/entries/size.xml b/entries/size.xml
      index d1177068..da4f1094 100644
      --- a/entries/size.xml
      +++ b/entries/size.xml
      @@ -1,5 +1,5 @@
       
      -
      +
         .size()
         
           1.0
      
      From f5c13ca1dff29241cf837ee26eadfccd63ac6c84 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Wed, 15 May 2013 23:02:37 -0400
      Subject: [PATCH 173/998] Note that $(window).trigger() is special, close
       gh-298.
      
      ---
       entries/trigger.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/trigger.xml b/entries/trigger.xml
      index 67039fd0..88a70757 100644
      --- a/entries/trigger.xml
      +++ b/entries/trigger.xml
      @@ -41,7 +41,7 @@ $('#foo').trigger('custom', ['Custom', 'Event']);
           

      The event object is always passed as the first parameter to an event handler. An array of arguments can also be passed to the .trigger() call, and these parameters will be passed along to the handler as well following the event object. As of jQuery 1.6.2, single string or numeric argument can be passed without being wrapped in an array.

      Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

      The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

      -
      Note: For both plain objects and DOM objects, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      +
      Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      Clicks to button #2 also trigger a click for button #1. From 8f055c0a18bf336efda77449dbed595d6d29765c Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Wed, 15 May 2013 23:10:27 -0400 Subject: [PATCH 174/998] Remove unused myValue parameter, close gh-290. --- entries/on.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/on.xml b/entries/on.xml index 5ea14423..f54f0927 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -119,7 +119,7 @@ $("p").on("click", {foo: "bar"}, myHandler)]]>
      Attach and trigger custom (non-browser) events. - - - - .get() - - 1.0 - - A zero-based integer indicating which element to retrieve. - - - - 1.0 - + Retrieve the DOM elements matched by the jQuery object. - -

      The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

      -
      
      -<ul>
      -  <li id="foo">foo</li>
      -  <li id="bar">bar</li>
      -</ul>
      -    
      -

      With an index specified, .get(index) retrieves a single element:

      -
      console.log( $( "li" ).get( 0 ) );
      -

      Since the index is zero-based, the first list item is returned:

      -

      - <li id="foo"> -

      -

      Without a parameter, .get() returns an array of all of the elements:

      -
      console.log( $( "li" ).get() );
      -

      All of the matched DOM nodes are returned by this call, contained in a standard array:

      -

      - [<li id="foo">, <li id="bar">] -

      + + .get() + + 1.0 + + A zero-based integer indicating which element to retrieve. + + + Retrieve one of the DOM elements matched by the jQuery object. + +

      The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

      +
      
      +  <ul>
      +    <li id="foo">foo</li>
      +    <li id="bar">bar</li>
      +  </ul>
      +      
      +

      With an index specified, .get(index) retrieves a single element:

      +
      console.log( $( "li" ).get( 0 ) );
      +

      Since the index is zero-based, the first list item is returned:

      +

      + <li id="foo"> +

      -

      Each jQuery object also masquerades as an array, so we can use the array dereferencing operator to get at the list item instead:

      -
      console.log( $( "li" )[0] );
      -

      However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:

      -
      console.log( $( "li" ).get(-1) );
      -

      A negative index is counted from the end of the matched set, so this example returns the last item in the list:

      -

      - <li id="bar"> -

      -
      - - Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. - - -
      +

      However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:

      +
      console.log( $( "li" ).get(-1) );
      +

      A negative index is counted from the end of the matched set, so this example returns the last item in the list:

      +

      + <li id="bar"> +

      + + + Display the tag name of the click element. + + + - - - Display the tag name of the click element. - - - + + + + + + .get() + + 1.0 + + Retrieve the DOM elements matched by the jQuery object. + +

      Consider a simple unordered list:

      +
      
      +  <ul>
      +    <li id="foo">foo</li>
      +    <li id="bar">bar</li>
      +  </ul>
      +      
      +

      Without a parameter, .get() returns an array of all of the elements:

      +
      console.log( $( "li" ).get() );
      +

      All of the matched DOM nodes are returned by this call, contained in a standard array:

      +

      + [<li id="foo">, <li id="bar">] +

      +
      + + Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. + + + - - - -
      +
      One
      +
      Two
      +
      Three
      ]]> +
      + + + + \ No newline at end of file From 4678411e899e57c7372fecb10ced12ef45aab72a Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 16 May 2013 08:41:26 -0400 Subject: [PATCH 176/998] 1.9.1-12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a165d91..f25db53c 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": "1.9.1-11", + "version": "1.9.1-12", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 7ac4819380f250c628099a8834be2a256ab0ecb6 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Thu, 16 May 2013 08:53:27 -0400 Subject: [PATCH 177/998] options-argument.xml: Update queue property to indicate both types it accepts. Resolves #294 --- includes/options-argument.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/options-argument.xml b/includes/options-argument.xml index 99bbf34c..9a76b828 100644 --- a/includes/options-argument.xml +++ b/includes/options-argument.xml @@ -9,8 +9,10 @@ A string indicating which easing function to use for the transition. - + A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. + + A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. @@ -29,7 +31,7 @@ A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. - An enhanced Promise oject with additional properties for the animation + An enhanced Promise object with additional properties for the animation A number from 0 to 1 indicating the progress of the animation @@ -45,7 +47,7 @@ A function to be called when the animation completes (its Promise object is resolved). - An enhanced Promise oject with additional properties for the animation + An enhanced Promise object with additional properties for the animation Indicates whether the animation jumped to the end @@ -54,7 +56,7 @@ A function to be called when the animation fails to complete (its Promise object is rejected). - An enhanced Promise oject with additional properties for the animation + An enhanced Promise object with additional properties for the animation Indicates whether the animation jumped to the end @@ -63,7 +65,7 @@ A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). - An enhanced Promise oject with additional properties for the animation + An enhanced Promise object with additional properties for the animation Indicates whether the animation jumped to the end From ce33dba0d4ed8d1bd40d9f3e232c64cd7ecd7f9d Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Thu, 16 May 2013 12:27:28 -0700 Subject: [PATCH 178/998] Add removed slug to removed elements, close gh-301 --- entries/die.xml | 1 + entries/jQuery.sub.xml | 1 + entries/live.xml | 1 + entries/toggle-event.xml | 1 + 4 files changed, 4 insertions(+) diff --git a/entries/die.xml b/entries/die.xml index dfbdbeb7..f3d0706a 100644 --- a/entries/die.xml +++ b/entries/die.xml @@ -50,5 +50,6 @@ $("p").die("click", foo); // ... foo will no longer be called.]]> + diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index c300d963..ccb4c0d0 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -95,4 +95,5 @@ $(document).ready(function() { + diff --git a/entries/live.xml b/entries/live.xml index 822db0fc..5c77f041 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -105,4 +105,5 @@ $("p").live({ + diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index 50588c12..413a6b34 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -58,4 +58,5 @@ + From 0678938d808dca50dbf45faba1f8d1a63bc4a6bf Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 19 May 2013 11:31:34 -0400 Subject: [PATCH 179/998] essage=Update checked-selector.xml: selected options retrieved, too --- entries/checked-selector.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/checked-selector.xml b/entries/checked-selector.xml index 2e1870b6..614e54e0 100644 --- a/entries/checked-selector.xml +++ b/entries/checked-selector.xml @@ -5,9 +5,9 @@ 1.0 - Matches all elements that are checked. + Matches all elements that are checked or selected. -

      The :checked selector works for checkboxes and radio buttons. For select elements, use the :selected selector.

      +

      The :checked selector works for checkboxes, radio buttons, and select elements. For select elements only, use the :selected selector.

      Determine how many input elements are checked. From 1a24f772a408fec0d20358e674bee37bb2e168d8 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 11:03:01 -0400 Subject: [PATCH 180/998] Clarify difference in .parent() vs .parents(). Close gh-293. --- entries/parent.xml | 3 ++- entries/parents.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/entries/parent.xml b/entries/parent.xml index fea18d6e..8bbbbd80 100644 --- a/entries/parent.xml +++ b/entries/parent.xml @@ -9,7 +9,8 @@ Get the parent of each element in the current set of matched elements, optionally filtered by a selector. -

      Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree.

      +

      Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.

      +

      The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

      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.

      Consider a page with a basic nested list on it:

      
      diff --git a/entries/parents.xml b/entries/parents.xml
      index 34aa0d33..e81bffe9 100644
      --- a/entries/parents.xml
      +++ b/entries/parents.xml
      @@ -9,7 +9,8 @@
         
         Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
         
      -    

      Given a jQuery object that represents a set of DOM elements, the .parents() method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones. The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree.

      +

      Given a jQuery object that represents a set of DOM elements, the .parents() method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones.

      +

      The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

      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.

      Consider a page with a basic nested list on it:

      
      
      From c1c9fc9af2637ec7120ac16351a43a6cce6268ea Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 19 May 2013 11:15:39 -0400
      Subject: [PATCH 181/998] Clarify return of .parents() for non-unary sets.
       Close gh-4.
      
      ---
       entries/parents.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/parents.xml b/entries/parents.xml
      index e81bffe9..a0ee8944 100644
      --- a/entries/parents.xml
      +++ b/entries/parents.xml
      @@ -9,7 +9,7 @@
         
         Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
         
      -    

      Given a jQuery object that represents a set of DOM elements, the .parents() method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones.

      +

      Given a jQuery object that represents a set of DOM elements, the .parents() method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones. When multiple DOM elements are in the original set, the resulting set will be in reverse order of the original elements as well, with duplicates removed.

      The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

      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.

      Consider a page with a basic nested list on it:

      From c56923646e6f76e5712eac405abc1f8bf02e8bbb Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 11:22:25 -0400 Subject: [PATCH 182/998] Add a pointer to .parent() in :parent, close gh-43. --- entries/parent-selector.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml index 34ff7732..2a09380f 100644 --- a/entries/parent-selector.xml +++ b/entries/parent-selector.xml @@ -10,6 +10,7 @@

      This is the inverse of :empty.

      One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

      The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

      +

      To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

      From bb9cc59bad555616340aea0890456b1ec8c85951 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 11:30:24 -0400 Subject: [PATCH 183/998] Note that username/password only work on XHR. Close gh-18. --- entries/jQuery.ajax.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 53c02466..23e91222 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -100,7 +100,7 @@ A mime type to override the XHR mime type. - A password to be used in response to an HTTP access authentication request. + A password to be used with XMLHttpRequest in response to an HTTP access authentication request. 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. @@ -140,7 +140,7 @@ A string containing the URL to which the request is sent. - A username to be used in response to an HTTP access authentication request. + A username to be used with XMLHttpRequest in response to an HTTP access authentication request. Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. From 6afe4ddb9de7a47d5397c50a84482c41f983ca29 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 11:40:31 -0400 Subject: [PATCH 184/998] Note that custom queues do not auto-start. Close gh-13. --- includes/options-argument.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/options-argument.xml b/includes/options-argument.xml index 9a76b828..4f0a7d34 100644 --- a/includes/options-argument.xml +++ b/includes/options-argument.xml @@ -10,7 +10,7 @@ A string indicating which easing function to use for the transition. - A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. + A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. From 3246030386ec48251a9dfad337b257204e96595b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 11:50:37 -0400 Subject: [PATCH 185/998] Fix tag typo in .parent() --- entries/parent.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/parent.xml b/entries/parent.xml index 8bbbbd80..2d29c99b 100644 --- a/entries/parent.xml +++ b/entries/parent.xml @@ -10,7 +10,7 @@ Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

      Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.

      -

      The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

      +

      The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

      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.

      Consider a page with a basic nested list on it:

      
      
      From 9fed43bae581b3c0c849cd3ade07635a2aca5cca Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 19 May 2013 12:03:36 -0400
      Subject: [PATCH 186/998] Clarify .extend() behavior for multiple-merge case.
       Close gh-62.
      
      ---
       entries/jQuery.extend.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml
      index 2007fa65..46688051 100644
      --- a/entries/jQuery.extend.xml
      +++ b/entries/jQuery.extend.xml
      @@ -34,7 +34,7 @@
           

      If only one argument is supplied to $.extend(), this means the target argument was omitted. In this case, the jQuery object itself is assumed to be the target. By doing this, you can add new functions to the jQuery namespace. This can be useful for plugin authors wishing to add new methods to JQuery.

      Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, you want to preserve both of the original objects, you can do so by passing an empty object as the target:

      var object = $.extend({}, object1, object2);
      -

      The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

      +

      The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second or subsequent object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

      Warning: Passing false for the first argument is not supported.

      Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

      On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.

      From 3d4b0f3012b2016360d1d1558c75986ab78b4412 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 12:20:26 -0400 Subject: [PATCH 187/998] Document null/undef args to $.extend(), close gh-97. --- entries/jQuery.extend.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 46688051..06e28224 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -30,7 +30,7 @@ Merge the contents of two or more objects together into the first object. -

      When two or more objects are supplied to $.extend(), properties from all of the objects are added to the target object.

      +

      When two or more object arguments are supplied to $.extend(), properties from all of the objects are added to the target object. Arguments that are null or undefined are ignored.

      If only one argument is supplied to $.extend(), this means the target argument was omitted. In this case, the jQuery object itself is assumed to be the target. By doing this, you can add new functions to the jQuery namespace. This can be useful for plugin authors wishing to add new methods to JQuery.

      Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, you want to preserve both of the original objects, you can do so by passing an empty object as the target:

      var object = $.extend({}, object1, object2);
      From 765fd6992c0b28f690735b38fff342d8a552530c Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 12:31:40 -0400 Subject: [PATCH 188/998] .clone() ignores dynamic state on purpose. Close gh-90. --- entries/clone.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/clone.xml b/entries/clone.xml index df9227f6..f8d1fa49 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -18,7 +18,8 @@ Create a deep copy of the set of matched elements. -

      The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. When used in conjunction with one of the insertion methods, .clone() is a convenient way to duplicate elements on a page. Consider the following HTML:

      +

      The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied to the cloned elemements. The clone operation sets these fields to their default values as specified in the HTML.

      +

      When used in conjunction with one of the insertion methods, .clone() is a convenient way to duplicate elements on a page. Consider the following HTML:

      <div class="container">
         <div class="hello">Hello</div>
         <div class="goodbye">Goodbye</div>
      
      From 6bd59cba58e95c91d764ea329403dbcd9e6e0c95 Mon Sep 17 00:00:00 2001
      From: Dave Methvin 
      Date: Sun, 19 May 2013 13:07:30 -0400
      Subject: [PATCH 189/998] Clarify valid chars in event names, close gh-125.
      
      ---
       entries/on.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/on.xml b/entries/on.xml
      index f54f0927..1a059240 100644
      --- a/entries/on.xml
      +++ b/entries/on.xml
      @@ -32,7 +32,7 @@
         
           

      The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()

      Event names and namespaces

      -

      Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers.

      +

      Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon chraracters.

      An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces beginning with an underscore are reserved for jQuery's use.

      In the second form of .on(), the events argument is a plain object. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

      Direct and delegated events

      From 030a3a34fc15e262a7ed76f8e1b56cf8584f7bb3 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 13:16:46 -0400 Subject: [PATCH 190/998] Deprecate use of .traditional in jQuery.param, close gh-123. --- entries/jQuery.param.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 2b077390..a87e003a 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -25,6 +25,7 @@

      This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

      As of jQuery 1.3, the return value of a function is used instead of the function as a String.

      As of jQuery 1.4, the $.param() method serializes deep objects recursively to accommodate modern scripting languages and frameworks such as PHP and Ruby on Rails. You can disable this functionality globally by setting jQuery.ajaxSettings.traditional = true;.

      +

      As of jQuery 1.8, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

      If the object passed is in an Array, it must be an array of objects in the format returned by .serializeArray()

      [{name:"first",value:"Rick"},
       {name:"last",value:"Astley"},
      @@ -33,7 +34,7 @@
             

      Note: Because some frameworks have limited ability to parse serialized arrays, developers should exercise caution when passing an obj argument that contains objects or arrays nested within another array.

      -

      Note: Because there is no universally agreed-upon specification for param strings, it is not possible to encode complex data structures using this method in a manner that works ideally across all languages supporting such input. Until such time that there is, the $.param method will remain in its current form.

      +

      Note: Because there is no universally agreed-upon specification for param strings, it is not possible to encode complex data structures using this method in a manner that works ideally across all languages supporting such input. Use JSON format as an alternative for encoding complex data instead.

      In jQuery 1.4, HTML5 input elements are also serialized.

      We can display a query string representation of an object and a URI-decoded version of the same as follows:

      From 4664f1ba316fb477915c8aea99ef0e2fdba88472 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 13:22:11 -0400 Subject: [PATCH 191/998] Note required callback arg in jQuery.post, close gh-124. --- entries/jQuery.post.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index f6c6dfdd..1f647841 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -12,7 +12,7 @@ A plain object or string that is sent to the server with the request. - A callback function that is executed if the request succeeds. + A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). From 0fbabfe0b4b4974322dc4c4139c4a484464406e0 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 13:59:46 -0400 Subject: [PATCH 192/998] Clarify meaning of jQuery(html, ownerDocument). Close gh-151. --- entries/jQuery.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 1b09927e..132581ac 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -144,7 +144,7 @@ $( "div > p").css("border", "1px solid gray"); A string of HTML to create on the fly. Note that this parses HTML, not XML. - A document in which the new elements will be created + A document in which the new elements will be created. @@ -162,6 +162,7 @@ $( "div > p").css("border", "1px solid gray");

      If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with <tag ... >). If not, the string is interpreted as a selector expression, as explained above. But if the string appears to be an HTML snippet, jQuery attempts to create new DOM elements as described by the HTML. Then a jQuery object is created and returned that refers to these elements. You can perform any of the usual jQuery methods on this object:

      $( "<p id='test'>My <em>new</em> text</p>" ).appendTo( "body" );

      For explicit parsing of a string to HTML, use the $.parseHTML() method.

      +

      By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript createElement() function.

      When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser"s .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

      Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

      From 9c2c2ffec23d9a907e262cd588908862f58d4143 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 14:21:55 -0400 Subject: [PATCH 193/998] Correct the equivalent :submit selector, close gh-292. Technically the equivalent CSS-standard selector for :submit is more complex if you want to handle the case of buttons with no type attribute, but the text makes it clear this is a bad idea. You could always use a .filter() instead. --- entries/submit-selector.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/submit-selector.xml b/entries/submit-selector.xml index 6b39224f..bda79001 100644 --- a/entries/submit-selector.xml +++ b/entries/submit-selector.xml @@ -7,9 +7,9 @@
      Selects all elements of type submit. -

      The :submit selector typically applies to button or input elements. Note that some browsers treat <button> element as type="default" implicitly while others (such as Internet Explorer) do not.

      +

      The :submit selector typically applies to button or input elements. Note that some browsers treat <button> element as type="submit" implicitly while others (such as Internet Explorer) do not. To ensure that markup works consistently across all browsers and guarantee that it is possible to consistently select buttons that will submit a form, always specify a type property.

      - + Finds all submit elements that are descendants of a td element. + + jQuery.fn.extend() + + 1.0 + + An object to merge onto the jQuery prototype. + + + Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. + + The jQuery.fn.extend() method extends the jQuery prototype ($.fn) object to provide new methods that can be chained to the jQuery() function. + + + Add two methods to the jQuery prototype ($.fn) object and then use one of them. + + +label { display: block; margin: .5em; } + + + + + + From 707583f215fbcaad18ec058ed6a2b9c245d7f420 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 17:49:25 -0400 Subject: [PATCH 195/998] Detached nodes are not visible. Close gh-91. --- entries/hidden-selector.xml | 4 +++- entries/visible-selector.xml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index a47a5216..786662d2 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -14,7 +14,9 @@
    • Their width and height are explicitly set to 0.
    • An ancestor element is hidden, so the element is not shown on the page.
    -

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start of the animation.

    +

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

    +

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    +

    During animations to show an element, the element is considered to be visible at the start of the animation.

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $(elem).css('visibility','hidden').is(':hidden') == false). The release notes outline the changes in more detail.

    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index 6d205f86..34c14f2e 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -8,7 +8,9 @@ Selects all elements that are visible.

    Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.

    -

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    +

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

    +

    Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    +

    During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    From 797fe6bd24a0ee36ee9fe42aceaa595e11157694 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 17:57:10 -0400 Subject: [PATCH 196/998] For $.ajax statusCode, a 3xx takes error args. Close gh-70. --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 23e91222..1e4fd9dd 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -118,7 +118,7 @@ } } });
    -

    If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error, they take the same parameters as the error callback.

    +

    If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback.

    From 30cece8b321457ba4140ef36ccf26ba9de193b86 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 18:13:39 -0400 Subject: [PATCH 197/998] Warn about perf with .width() and .height(). Close gh-101. --- entries/height.xml | 2 +- entries/width.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/height.xml b/entries/height.xml index 7ecbc047..228fac4d 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -15,7 +15,7 @@

    This method is also able to find the height of the window and document.

    $(window).height();   // returns height of browser viewport
     $(document).height(); // returns height of HTML document
    -

    Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property.

    +

    Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS height plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css("height") rather than .height().

    Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

    diff --git a/entries/width.xml b/entries/width.xml index 648bee5b..707452d7 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -15,7 +15,7 @@

    This method is also able to find the width of the window and document.

    $(window).width();   // returns width of browser viewport
           $(document).width(); // returns width of HTML document
    -

    Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property.

    +

    Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS width plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css("width") rather than .width().

    Show various widths. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. From 81de7ca98f492275e5a42c2efc6b772a7991983c Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 18:25:08 -0400 Subject: [PATCH 198/998] Expand on the definition of the htmlString type. --- pages/Types.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 1d73fa4e..4f270341 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -137,7 +137,8 @@

    Boolean Default

    htmlString

    -

    A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed as such until the final > character.

    +

    A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it contained <tag ... > anywhere within the string.

    +

    When a string as passed as an argument to a manipulation method such as .append(), it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.

    For explicit parsing of a string to HTML, the $.parseHTML() method is available as of jQuery 1.8.

    // Appends hello:
     $( "hello" ).appendTo( "body" );
    
    From 6b5a3350e3ac3c26a9656cea379240fd723e062a Mon Sep 17 00:00:00 2001
    From: Dave Methvin 
    Date: Sun, 19 May 2013 18:26:36 -0400
    Subject: [PATCH 199/998] Use htmlString type for the .add() signature. Close
     gh-68.
    
    ---
     entries/add.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/add.xml b/entries/add.xml
    index 2bd66b3e..f48bf870 100644
    --- a/entries/add.xml
    +++ b/entries/add.xml
    @@ -15,7 +15,7 @@
       
       
         1.0
    -    
    +    
           An HTML fragment to add to the set of matched elements.
         
       
    
    From 6d639a50a643a67670c8a6520fe83ef5800ac956 Mon Sep 17 00:00:00 2001
    From: Dave Methvin 
    Date: Sun, 19 May 2013 18:46:17 -0400
    Subject: [PATCH 200/998] Nothing is dumber than 1E02 as a number. Close
     gh-119.
    
    ---
     entries/data.xml | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/entries/data.xml b/entries/data.xml
    index 056b66f6..52c4fa58 100644
    --- a/entries/data.xml
    +++ b/entries/data.xml
    @@ -93,7 +93,10 @@ alert( $("body").data("bar")); //foobar
     $("div").data("lastValue") === 43;
     $("div").data("hidden") === true;
     $("div").data("options").name === "John";
    -

    Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null) otherwise it is left as a string. To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method. When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

    +

    Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

    +

    When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

    +

    To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

    +

    The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

    Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

    
     var mydata = $("#mydiv").data();
    
    From 5aafc0f7c4925d5f85150e5cb8ee57e18e831924 Mon Sep 17 00:00:00 2001
    From: Dave Methvin 
    Date: Sun, 19 May 2013 18:56:53 -0400
    Subject: [PATCH 201/998] Describe .closest() behavior for non-unary sets.
     Close gh-141.
    
    ---
     entries/closest.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/closest.xml b/entries/closest.xml
    index da43786b..24fbd851 100644
    --- a/entries/closest.xml
    +++ b/entries/closest.xml
    @@ -55,8 +55,8 @@
                 
    Travels up the DOM tree to the document's root element, adding each ancestor element to a temporary collection; it then filters that collection based on a selector if one is supplied
    The returned jQuery object contains zero or one element for each element in the original setThe returned jQuery object contains zero or more elements for each element in the original setThe returned jQuery object contains zero or one element for each element in the original set, in document orderThe returned jQuery object contains zero or more elements for each element in the original set, in reverse document order
    From fb813f0b5f2578532af0065b8be36177fd9327d6 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 19:03:22 -0400 Subject: [PATCH 202/998] Second arg of $.parseHTML can only be a document. Close gh-281. --- entries/jQuery.parseHTML.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index c78dd53c..400d7dc4 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -8,7 +8,7 @@ HTML string to be parsed - DOM element to serve as the context in which the HTML fragment will be created + Document element to serve as the context in which the HTML fragment will be created A Boolean indicating whether to include scripts passed in the HTML string @@ -16,6 +16,7 @@

    jQuery.parseHTML uses a native DOM element creation function to convert the string to a set of DOM elements, which can then be inserted into the document.

    +

    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.

    Create an array of Dom nodes using an HTML string and insert it into a div. From 25d497d1297cf76d52b69a9261ff69c87594b333 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 19 May 2013 19:13:54 -0400 Subject: [PATCH 203/998] 1.9.1-13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f25db53c..5f4ba7a7 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": "1.9.1-12", + "version": "1.9.1-13", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 10648bbc54bf3b79d6efd49f5bbf23253d2df087 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 19:16:24 -0400 Subject: [PATCH 204/998] Add note about toggle tracking. Close gh-110. --- entries/animate.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/animate.xml b/entries/animate.xml index 4c4ec428..6c84aefb 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -25,7 +25,7 @@

    All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used). Property values are treated as a number of pixels unless otherwise specified. The units em and % can be specified where applicable.

    In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated.

    Shorthand CSS properties (e.g. font, background, border) are not fully supported. For example, if you want to animate the rendered border width, at least a border style and border width other than "auto" must be set in advance. Or, if you want to animate font size, you would use fontSize or the CSS equivalent 'font-size' rather than simply 'font'.

    -

    In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element.

    +

    In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element. In order to use jQuery's built-in toggle state tracking, the 'toggle' keyword must be consistently given as the value of the property being animated.

    Animated properties can also be relative. If a value is supplied with a leading += or -= sequence of characters, then the target value is computed by adding or subtracting the given number from the current value of the property.

    Note: Unlike shorthand animation methods such as .slideDown() and .fadeIn(), the .animate() method does not make hidden elements visible as part of the effect. For example, given $('someElement').hide().animate({height:'20px'}, 500), the animation will run, but the element will remain hidden.

    From 075cb6a6d7d10475ba055d8ae95cc4a714897d0a Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 19:24:51 -0400 Subject: [PATCH 205/998] Stop abusing .serialize() please! Close gh-108. --- entries/serialize.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entries/serialize.xml b/entries/serialize.xml index db6e075a..a6fd91ca 100644 --- a/entries/serialize.xml +++ b/entries/serialize.xml @@ -12,8 +12,7 @@ event.preventDefault(); console.log( $(this).serialize() ); }); -

    In this case, jQuery serializes the successful controls within the form.

    -

    Warning: selecting both the form and its children will cause duplicates in the serialized string.

    +

    In this case, jQuery serializes the successful controls within the form. Only form elements are examined for inputs they contain, in all other cases the input elements to be serialized should be part of the set passed to the .serialize() method. Selecting both the form and its children in a set will cause duplicates in the serialized string.

    Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

    From 8125dbbd8c4ad84346ba5a13542b5a58ffeb73c0 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 May 2013 19:40:34 -0400 Subject: [PATCH 206/998] Add note about .outerWidth() on border-collapse tables. Close gh-143. --- entries/outerWidth.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index dcd035fa..834f6a6a 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -11,7 +11,7 @@

    Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.

    If includeMargin is omitted or false, the padding and border are included in the calculation; if true, the margin is also included.

    -

    This method is not applicable to window and document objects; for these, use .width() instead.

    +

    This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

    From ca266fbdb89a494bd98311ba753945c04b838970 Mon Sep 17 00:00:00 2001 From: poloniculmov Date: Tue, 23 Apr 2013 12:29:41 +0300 Subject: [PATCH 207/998] Ref gh-240; jQuery 1.9 wants document for ajax events. Close gh-285. Updated the example to reflect the change in jQuery 1.9. dmethvin: changed "broadcast" to "trigger" event terminology. --- pages/Ajax_Events.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html index 272fdf42..9ba25ff7 100644 --- a/pages/Ajax_Events.html +++ b/pages/Ajax_Events.html @@ -3,7 +3,7 @@ "title": "Ajax Events" } -

    Ajax requests produce a number of different events that you can subscribe to. Here's a full list of the events and in what order they are broadcast.

    +

    Ajax requests produce a number of different events that you can subscribe to. Here's a full list of the events and in what order they are triggered.

    There are two types of events:

    Local Events

    These are callbacks that you can subscribe to within the Ajax request object, like so:

    @@ -18,11 +18,11 @@

    Local Events

    });

    Global Events

    -

    These events are broadcast to all elements in the DOM, triggering any handlers which may be listening. You can listen for these events like so:

    -
     $("#loading").bind("ajaxSend", function(){
    -   $(this).show();
    +

    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(){
    +   $("#loading").show();
      }).bind("ajaxComplete", function(){
    -   $(this).hide();
    +   $("#loading").hide();
      });
     

    Global events can be disabled for a particular Ajax request by passing in the global option, like so:

    @@ -33,10 +33,10 @@

    Global Events

    });

    Events

    -

    This is the full list of Ajax events that are broadcast, and in the order in which they are broadcast. The indented events are broadcast for each and every Ajax request (unless a global option has been set). The ajaxStart and ajaxStop events are events that relate to all Ajax requests together. +

    This is the full list of Ajax events , and in the order in which they are triggered. The indented events are triggered for each and every Ajax request (unless a global option has been set). The ajaxStart and ajaxStop events are events that relate to all Ajax requests together.

      -
    • ajaxStart (Global Event)
      This event is broadcast if an Ajax request is started and no other Ajax requests are currently running. +
    • ajaxStart (Global Event)
      This event is triggered if an Ajax request is started and no other Ajax requests are currently running.
      • beforeSend (Local Event)
        This event, which is triggered before an Ajax request is started, allows you to modify the XMLHttpRequest object (setting additional headers, if need be.)
      • ajaxSend (Global Event)
        This global event is also triggered before the request is run.
      • From 2cd0cd04a4aa08983daf8009b5879ee56d90ec6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 21 May 2013 12:37:09 -0400 Subject: [PATCH 208/998] Types: Fixed usage of . --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 4f270341..dd4a478b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -561,7 +561,7 @@

        Event

        Those properties are all documented, and accompanied by examples, on the Event object page.

        -

        The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any. +

        The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

        Element

        An element in the Document Object Model (DOM) has attributes, text and children. It provides methods to traverse the parent and children and to get access to its attributes. Due to a lot of flaws in DOM API specifications and implementations, those methods are no fun to use. jQuery provides a wrapper around those elements to help interacting with the DOM. But often enough you will be working directly with DOM elements, or see methods that (also) accept DOM elements as arguments. From 77d264cea2ce469647251c7ce24f158fe638492f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 21 May 2013 12:37:21 -0400 Subject: [PATCH 209/998] 1.9.1-14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f4ba7a7..a3140f03 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": "1.9.1-13", + "version": "1.9.1-14", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From b261842171a142fd747639839bfb717b650b4676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 22 May 2013 10:22:28 -0400 Subject: [PATCH 210/998] jQuery(): Fixed reference to Selector type. --- entries/jQuery.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 132581ac..dc2970ae 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -5,7 +5,7 @@ jQuery() 1.0 - + A string containing a selector expression From a02656532c9ecc4aeb7ad97526267939d4385ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Sat, 25 May 2013 14:32:34 -0400 Subject: [PATCH 211/998] Deprecate context property. Fixes: http://bugs.jquery.com/ticket/13801. Resolves #308 --- categories.xml | 5 +++++ entries/context.xml | 4 +++- entries/selector.xml | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/categories.xml b/categories.xml index 00f9c0a7..8ac824d5 100644 --- a/categories.xml +++ b/categories.xml @@ -56,6 +56,11 @@

        For more information, see the Release Notes/Changelog at http://blog.jquery.com/2012/08/09/jquery-1-8-released/

        ]]> + + + diff --git a/entries/context.xml b/entries/context.xml index bbebdb1b..450e2b8b 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -1,11 +1,12 @@ - + .context 1.3 The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. +

        The .context property was deprecated in jQuery 1.10 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version.

        The .live() method for binding event handlers uses this property to determine the root element to use for its event delegation needs.

        The value of this property is typically equal to document, as this is the default context for jQuery objects if none is supplied. The context may differ if, for example, the object was created by searching within an <iframe> or XML document.

        Note that the context property may only apply to the elements originally selected by jQuery(), as it is possible for the user to add elements to the collection via methods such as .add() and these may have a different context.

        @@ -28,4 +29,5 @@ +
        diff --git a/entries/selector.xml b/entries/selector.xml index aad20b1e..de6090ec 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -6,9 +6,10 @@ A selector representing selector passed to jQuery(), if any, when creating the original set. -

        The .selector property was deprecated in jQuery 1.7 and is only maintained in jQuery 1.9 to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector should have the caller pass in the selector as part of the plugin's arguments during initialization.

        +

        The .selector property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector should have the caller pass in the selector as part of the plugin's arguments during initialization.

        +
        From d92912f83a8879c7080c7292d5cb474031c8e24d Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 28 May 2013 09:01:58 -0400 Subject: [PATCH 212/998] 1.10.0-1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3140f03..3a38fde3 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": "1.9.1-14", + "version": "1.10.0-1", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 32a3ee66e33a778422c84d802e6f4e757e0c0d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 31 May 2013 10:10:35 -0400 Subject: [PATCH 213/998] Upgrade to grunt-jquery-content 0.10.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a38fde3..84cc534e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.9.0", + "grunt-jquery-content": "0.10.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 826bb6ae24ed2c9d2ad0875c17e89f853a46f5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 31 May 2013 10:15:20 -0400 Subject: [PATCH 214/998] Event Object category: Fixed spacing in code blocks. --- categories.xml | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/categories.xml b/categories.xml index 8ac824d5..5a94e236 100644 --- a/categories.xml +++ b/categories.xml @@ -99,24 +99,22 @@

        The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional.

        Check trigger's documentation to see how to combine it with your own event object.

        Example:

        -
        -            //Create a new jQuery.Event object without the "new" operator.
        -  var e = jQuery.Event("click");
        +          
        
        +//Create a new jQuery.Event object without the "new" operator.
        +var e = jQuery.Event( "click" );
         
        -  // trigger an artificial click event
        -  jQuery("body").trigger( e );
        -
        -          
        +// trigger an artificial click event +jQuery( "body" ).trigger( e ); +

        As of jQuery 1.6, you can also pass an object to jQuery.Event() and its properties will be set on the newly created Event object.

        Example:

        -
        -              // Create a new jQuery.Event object with specified event properties.
        -  var e = jQuery.Event("keydown", { keyCode: 64 });
        +          
        
        +// Create a new jQuery.Event object with specified event properties.
        +var e = jQuery.Event( "keydown", { keyCode: 64 } );
         
        -  // trigger an artificial keydown event with keyCode 64
        -  jQuery("body").trigger( e );
        -
        -          
        +// trigger an artificial keydown event with keyCode 64 +jQuery( "body" ).trigger( e ); +

        Event Properties

        jQuery normalizes the following properties for cross-browser consistency:

          @@ -144,13 +142,11 @@

          OtherProperties

          Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

          Example:

          -
          -            
          -  // add the dataTransfer property for use with the native `drop` event
          -  // to capture information about files dropped into the browser window
          -  jQuery.event.props.push("dataTransfer");
          -
          -          
          +
          
          +// add the dataTransfer property for use with the native `drop` event
          +// to capture information about files dropped into the browser window
          +jQuery.event.props.push( "dataTransfer" );
          +
    ]]> From b0ebb2e83280d3dbb1929261e06af60a37e5fc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 31 May 2013 10:15:26 -0400 Subject: [PATCH 215/998] 1.10.0-2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84cc534e..6a0aa848 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": "1.10.0-1", + "version": "1.10.0-2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From a18b7f1608034b59bd98cec76cdd3e49c194e0dd Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Tue, 11 Jun 2013 10:32:54 -0700 Subject: [PATCH 216/998] Fix broken link in jQuery.get.xml --- entries/jQuery.get.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 0ebe6bca..d29cccfe 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -29,7 +29,7 @@ });

    The success callback function is passed the returned data, which will be an XML root element, text string, JavaScript file, or JSON object, depending on the MIME type of the response. It is also passed the text status of the response.

    -

    As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

    +

    As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

    Most implementations will specify a success handler:

    $.get('ajax/test.html', function(data) {
       $('.result').html(data);
    
    From e61975a58debd53901c954ffba7e0a75a3736b68 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Tue, 11 Jun 2013 11:30:22 -0700
    Subject: [PATCH 217/998] lang-selector.xml The :lang filter should have
     parentheses
    
    ---
     entries/lang-selector.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/lang-selector.xml b/entries/lang-selector.xml
    index e7431c64..8858e598 100644
    --- a/entries/lang-selector.xml
    +++ b/entries/lang-selector.xml
    @@ -1,6 +1,6 @@
     
     
    -  :lang Selector
    +  :lang() Selector
       :lang(language)
       
         1.9
    @@ -10,7 +10,7 @@
       
       Selects all elements of the specified language.
       
    -    

    The :lang selector matches elements that have a language value equal to the supplied language code or that start with the supplied language code immediately followed by "-". For example, the selector $("div:lang(en)")will match <div lang="en"> and <div lang="en-us"> (and any of their descendant <div>s), but not <div lang="fr">

    +

    The :lang() selector matches elements that have a language value equal to the supplied language code or that start with the supplied language code immediately followed by "-". For example, the selector $("div:lang(en)")will match <div lang="en"> and <div lang="en-us"> (and any of their descendant <div>s), but not <div lang="fr">

    For HTML elements, the language value is determined by the lang attribute and possibly information from meta elements or HTTP headers.

    Further discussion of this usage can be found in the W3C CSS specification.

    From 28486950c4d2064692047966fc836837ceda6f2b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 11 Jun 2013 11:36:25 -0700 Subject: [PATCH 218/998] parent-selector: reomove extra 'that' --- entries/parent-selector.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml index 2a09380f..66c6f1e6 100644 --- a/entries/parent-selector.xml +++ b/entries/parent-selector.xml @@ -5,7 +5,7 @@ 1.0 - Select all elements that that have at least one child node (either an element or text). + Select all elements that have at least one child node (either an element or text).

    This is the inverse of :empty.

    One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

    @@ -27,4 +27,4 @@ -
    \ No newline at end of file + From b704894ab7888e41b6c66e4132a8c71276944179 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Wed, 26 Jun 2013 14:49:41 +0100 Subject: [PATCH 219/998] fixed a small typo in the clone entry --- entries/clone.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/clone.xml b/entries/clone.xml index f8d1fa49..4c8b0945 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -18,7 +18,7 @@ Create a deep copy of the set of matched elements. -

    The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied to the cloned elemements. The clone operation sets these fields to their default values as specified in the HTML.

    +

    The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied to the cloned elements. The clone operation sets these fields to their default values as specified in the HTML.

    When used in conjunction with one of the insertion methods, .clone() is a convenient way to duplicate elements on a page. Consider the following HTML:

    <div class="container">
       <div class="hello">Hello</div>
    @@ -106,4 +106,4 @@ $('#copy-correct')
       
       
       
    -
    \ No newline at end of file
    +
    
    From 6df983d070000d5239ec4929a62158b8a4f62b85 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Fri, 28 Jun 2013 08:26:16 -0400
    Subject: [PATCH 220/998] README: Remove note about indentation. Code should be
     indented with tabs, the build process converts them to spaces for
     readability.
    
    ---
     README.md | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/README.md b/README.md
    index d5dfc651..57da9629 100644
    --- a/README.md
    +++ b/README.md
    @@ -46,10 +46,9 @@ To build and deploy your changes for previewing in a [jquery-wp-content](https:/
       * **Passive**: Click handlers are bound to elements in the collection when `.click()` is called
     
     ### Code Style
    -Code in the API documentation should follow the [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines) with the following addition and exception:
    +Code in the API documentation should follow the [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelines) with the following addition:
     
     * **Document ready syntax**: Use `$( document ).ready(function() {` instead of `$(function() {` as it's harder for new users to distinguish the difference between the latter and an IIFE.
    -* **Indentation**: Core guidelines say to use tabs. In API documentation, *use 2 spaces instead*. This helps keep the line width manageable and avoid horizontal scrollbars.
     
     #### Code within prose content (paragraphs and the like):
     * Methods: use a dot, followed by the method name, followed by parentheses: e.g. The `.focus()` method is a shortcut for `.bind('focus', handler)` in the first and second variations, and `.trigger('focus')` in the third.
    
    From 0cb661e4b28ac53c47bd1e2e6b8c168273c50d28 Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Fri, 28 Jun 2013 09:18:17 -0400
    Subject: [PATCH 221/998] .clone(): Remove last example because it deals with
     rare edge case and can be confusing
    
    ---
     entries/clone.xml | 37 -------------------------------------
     1 file changed, 37 deletions(-)
    
    diff --git a/entries/clone.xml b/entries/clone.xml
    index 4c8b0945..79f2cd97 100644
    --- a/entries/clone.xml
    +++ b/entries/clone.xml
    @@ -64,43 +64,6 @@
     ]]>
         
    -  
    -  
    -    When using .clone() to clone a collection of elements that are not attached to the DOM, their order when inserted into the DOM is not guaranteed. However, it may be possible to preserve sort order with a workaround, as demonstrated:
    -    
    -    
    -    
       
       
    
    From ef36c894cfcefff519261b58f41b50ce27fd717e Mon Sep 17 00:00:00 2001
    From: Richard Gibson 
    Date: Fri, 5 Jul 2013 09:38:18 -0400
    Subject: [PATCH 222/998] jQuery #13421 et al.: add detail to CSS shorthand
     properties note
    
    ---
     entries/css.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 79f874d4..81d1d7f7 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -19,7 +19,7 @@
         
           

    The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css('background-color') and .css('backgroundColor'). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    -

    Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on.

    +

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $(elem).css('borderTopWidth'), $(elem).css('borderBottomWidth'), and so on.

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs.

    @@ -111,7 +111,7 @@ div { height: 50px; margin: 5px; padding: 5px; float: left; }

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({'background-color': '#ffe', 'border-left': '5px solid #ccc'}) and .css({backgroundColor: '#ffe', borderLeft: '5px solid #ccc'}). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    -

    When using .css() as a setter, jQuery modifies the element's style property. For example, $('#mydiv').css('color', 'green') is equivalent to document.getElementById('mydiv').style.color = 'green'. Setting the value of a style property to an empty string — e.g. $('#mydiv').css('color', '') — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background> will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    +

    When using .css() as a setter, jQuery modifies the element's style property. For example, $('#mydiv').css('color', 'green') is equivalent to document.getElementById('mydiv').style.color = 'green'. Setting the value of a style property to an empty string — e.g. $('#mydiv').css('color', '') — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    $('div.example').css('width', function(index) {
    
    From 701567cba4524ac8f604cf91a1ea813f03c2b916 Mon Sep 17 00:00:00 2001
    From: Anne-Gaelle Colom 
    Date: Mon, 1 Jul 2013 18:13:48 +0100
    Subject: [PATCH 223/998] Code indentation and formatting (a entries).
    
    ---
     entries/add.xml                               | 133 ++++++++++-------
     entries/addBack.xml                           |  46 +++---
     entries/addClass.xml                          |  92 +++++++-----
     entries/after.xml                             |  89 ++++++++----
     entries/ajaxComplete.xml                      |   2 +-
     entries/ajaxStart.xml                         |  20 ++-
     entries/ajaxStop.xml                          |  25 ++--
     entries/ajaxSuccess.xml                       |  31 ++--
     entries/all-selector.xml                      |  42 ++++--
     entries/andSelf.xml                           |  48 ++++---
     entries/animated-selector.xml                 |  38 +++--
     entries/append.xml                            |  74 ++++++----
     entries/appendTo.xml                          |  41 ++++--
     entries/attr.xml                              | 134 +++++++++++-------
     .../attribute-contains-prefix-selector.xml    |  16 +--
     entries/attribute-contains-selector.xml       |  15 +-
     entries/attribute-contains-word-selector.xml  |  17 ++-
     entries/attribute-ends-with-selector.xml      |  15 +-
     entries/attribute-equals-selector.xml         |  44 +++---
     entries/attribute-not-equal-selector.xml      |  40 +++---
     entries/attribute-starts-with-selector.xml    |  15 +-
     entries/clone.xml                             |  12 +-
     22 files changed, 608 insertions(+), 381 deletions(-)
    
    diff --git a/entries/add.xml b/entries/add.xml
    index f48bf870..b17d39f8 100644
    --- a/entries/add.xml
    +++ b/entries/add.xml
    @@ -36,46 +36,40 @@
       
       Add elements to the set of matched elements.
       
    -    

    Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

    +

    Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

    Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order, use the $(array_of_DOM_elements) signature.

    The updated set of elements can be used in a following (chained) method, or assigned to a variable for later use. For example:

    -
    -      
    -$("p").add("div").addClass("widget");
    -var pdiv = $("p").add("div");
    -
    -    
    +
    
    +$( "p" ).add( "div" ).addClass( "widget" );
    +var pdiv = $( "p" ).add( "div" );
    +      

    The following will not save the added elements, because the .add() method creates a new set and leaves the original set in pdiv unchanged:

    -
    -      
    -var pdiv = $("p");
    -pdiv.add("div");  // WRONG, pdiv will not change
    -
    -    
    +
    
    +var pdiv = $( "p" );
    +pdiv.add( "div" ); // WRONG, pdiv will not change
    +      

    Consider a page with a simple list and a paragraph following it:

    -
    -      <ul>
    +    
    
    +<ul>
       <li>list item 1</li>
       <li>list item 2</li>
       <li>list item 3</li>
     </ul>
    -<p>a paragraph</p>
    -    
    +<p>a paragraph</p> +

    We can select the list items and then the paragraph by using either a selector or a reference to the DOM element itself as the .add() method's argument:

    -
    -      $('li').add('p').css('background-color', 'red');
    -    
    +
    $( "li" ).add( "p" ).css( "background-color", "red" );

    Or:

    -
    -      $('li').add(document.getElementsByTagName('p')[0])
    -  .css('background-color', 'red');
    -    
    +
    
    +$( "li" ).add( document.getElementsByTagName( "p" )[ 0 ] )
    +  .css( "background-color", "red" );
    +    

    The result of this call is a red background behind all four elements. Using an HTML snippet as the .add() method's argument (as in the third version), we can create additional elements on the fly and add those elements to the matched set of elements. Let's say, for example, that we want to alter the background of the list items along with a newly created paragraph:

    -
    -      $('li').add('<p id="new">new paragraph</p>')
    -  .css('background-color', 'red');
    -    
    +
    
    +$( "li" ).add( "<p id='new'>new paragraph</p>" )
    +  .css( "background-color", "red" );
    +    

    Although the new paragraph has been created and its background color changed, it still does not appear on the page. To place it on the page, we could add one of the insertion methods to the chain.

    As of jQuery 1.4 the results from .add() will always be returned in document order (rather than a simple concatenation).

    Note: To reverse the .add() you can use .not( elements | selector ) to remove elements from the jQuery results, or .end() to return to the selection before you added.

    @@ -83,50 +77,81 @@ Using an HTML snippet as the .add() method's argument (as in the th Finds all divs and makes a border. Then adds all paragraphs to the jQuery object to set their backgrounds yellow. - + +

    Added this... (notice no border)

    +]]>
    Adds more elements, matched by the given expression, to the set of matched elements. - - + + Adds more elements, created on the fly, to the set of matched elements. - - + + Adds one or more Elements to the set of matched elements. - - + + Demonstrates how to add (or push) elements to an existing collection - - +collection = collection.add( document.getElementById( "a" ) ); +collection.css( "background", "yellow" ); +]]>
    + - \ No newline at end of file + diff --git a/entries/addBack.xml b/entries/addBack.xml index 05056ac6..83f04f8a 100644 --- a/entries/addBack.xml +++ b/entries/addBack.xml @@ -13,37 +13,49 @@

    Consider a page with a simple list on it:

    
     <ul>
    -   <li>list item 1</li>
    -   <li>list item 2</li>
    -   <li class="third-item">list item 3</li>
    -   <li>list item 4</li>
    -   <li>list item 5</li>
    +  <li>list item 1</li>
    +  <li>list item 2</li>
    +  <li class="third-item">list item 3</li>
    +  <li>list item 4</li>
    +  <li>list item 5</li>
     </ul>
    -
    +

    The result of the following code is a red background behind items 3, 4 and 5:

    -
    $('li.third-item').nextAll().addBack()
    -  .css('background-color', 'red');
    +    
    $( "li.third-item" ).nextAll().addBack()
    +  .css( "background-color", "red" );
     

    First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .addBack() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

    The .addBack() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .addBack() adds the previous set of elements on the stack — in this case $("div.after-addback") — to the current set, selecting both the div and its enclosed paragraphs. + p, div { + margin: 5px; + padding: 5px; + } + .border { + border: 2px solid red; + } + .background { + background: yellow; + } + .left, .right { + width: 45%; + float: left; + } + .right { + margin-left: 3%; + } + ]]>
    +$( "p" ).last().addClass( "selected" ); +]]> +

    Hello

    +

    and

    +

    Goodbye

    +]]> Add the classes "selected" and "highlight" to the matched elements. +$( "p:last" ).addClass( "selected highlight" ); +]]> - + Pass in a function to .addClass() to add the "green" class to a div that already has a "red" class.
    -

    Since .after() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('p').first().after($newdiv1, newdiv2, existingdiv1). The type and number of arguments will largely depend on the elements that are collected in the code.

    +

    Since .after() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().after( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on the elements that are collected in the code.

    Inserts some HTML after all paragraphs. - - - + + + Inserts a DOM element after all paragraphs. - - - + + + Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs. - - - + + + diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index ba1d5700..0ebeccaa 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -30,7 +30,7 @@
    $(document).ajaxComplete(function(event, xhr, settings) {
       if ( settings.url === "ajax/test.html" ) {
         $( ".log" ).text( "Triggered ajaxComplete handler. The result is " +
    -                     xhr.responseHTML );
    +                       xhr.responseHTML );
       }
     });

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

    diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index 7b01bf30..7a458c8a 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -11,17 +11,23 @@

    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.

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

    -
    <div class="trigger">Trigger</div>
    +    
    
    +<div class="trigger">Trigger</div>
     <div class="result"></div>
    -<div class="log"></div>
    +<div class="log"></div> +

    Attach the event handler to any element:

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

    Now, make an Ajax request using any jQuery method:

    -
    $( ".trigger" ).click(function() {
    -  $( ".result" ).load("ajax/test.html");
    -});
    +
    
    +$( ".trigger" ).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.

    As of jQuery 1.8, the .ajaxStart() method should only be attached to document.

    diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 833b39c0..436d37f4 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -11,26 +11,33 @@

    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.

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

    -
    <div class="trigger">Trigger</div>
    +    
    
    +<div class="trigger">Trigger</div>
     <div class="result"></div>
     <div class="log"></div>

    Attach the event handler to the document:

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

    Now, make an Ajax request using any jQuery method:

    -
    $( ".trigger" ).click(function() {
    +    
    
    +$( ".trigger" ).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.

    As of jQuery 1.8, the .ajaxStop() method should only be attached to document.

    Hide a loading message after all the Ajax requests have stopped. - + diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 1ced68dd..211aef0a 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -11,34 +11,43 @@

    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.

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

    -
    <div class="trigger">Trigger</div>
    +    
    
    +<div class="trigger">Trigger</div>
     <div class="result"></div>
     <div class="log"></div>

    Attach the event handler to any element:

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

    Now, make an Ajax request using any jQuery method:

    -
    $( ".trigger" ).on("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 successfully, the log message is displayed.

    As of jQuery 1.8, the .ajaxSuccess() method should only be attached to document.

    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 ).ajaxSuccess(function( event, xhr, settings ) {
       if ( settings.url == "ajax/test.html" ) {
         $( ".log" ).text( "Triggered ajaxSuccess handler. The ajax response was: " +
    -                      xhr.responseText );
    +                       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/all-selector.xml b/entries/all-selector.xml index 3f549950..bc3d6f8d 100644 --- a/entries/all-selector.xml +++ b/entries/all-selector.xml @@ -11,18 +11,23 @@ Find every element (including head, body, etc) in the document. Note that if your browser has an extension/add-on enabled that inserts a <script> or <link> element into the DOM, that element will be counted as well. - - + +
    Find all elements within document.body so elements like head, script, etc. are excluded. - + + +]]> diff --git a/entries/andSelf.xml b/entries/andSelf.xml index 450c0ef6..edf90ed0 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -11,37 +11,49 @@

    Consider a page with a simple list on it:

    
     <ul>
    -   <li>list item 1</li>
    -   <li>list item 2</li>
    -   <li class="third-item">list item 3</li>
    -   <li>list item 4</li>
    -   <li>list item 5</li>
    +  <li>list item 1</li>
    +  <li>list item 2</li>
    +  <li class="third-item">list item 3</li>
    +  <li>list item 4</li>
    +  <li>list item 5</li>
     </ul>
    -
    +

    The result of the following code is a red background behind items 3, 4 and 5:

    -
    $('li.third-item').nextAll().andSelf()
    -  .css('background-color', 'red');
    +    
    $( "li.third-item" ).nextAll().andSelf()
    +  .css( "background-color", "red" );
     

    First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[<li.third-item>,<li>,<li> ]}.

    - The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $("div.after-andself") — to the current set, selecting both the div and its enclosed paragraphs. + The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $( "div.after-andself" ) — to the current set, selecting both the div and its enclosed paragraphs. + p, div { + margin: 5px; + padding: 5px; + } + .border { + border: 2px solid red; + } + .background { + background: yellow; + } + .left, .right { + width: 45%; + float: left; + } + .right { + margin-left: 3%; + } + ]]>
    - +
    +
    +
    +]]> diff --git a/entries/append.xml b/entries/append.xml index 5f5aa08b..3e8efe7e 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -27,19 +27,22 @@ Insert content, specified by the parameter, to the end of each element in the set of matched elements.

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    -

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    +

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
     </div>
    -
    +

    You can create content and insert it into several elements at once:

    -
    $('.inner').append('<p>Test</p>');
    -
    +
    
    +$( ".inner" ).append( "<p>Test</p>" );
    +    

    Each inner <div> element gets this new content:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">
         Hello
    @@ -50,59 +53,74 @@
         <p>Test</p>
       </div>
     </div>
    -
    +

    You can also select an element on the page and insert it into another:

    -
    $('.container').append($('h2'));
    -
    +
    
    +$( ".container" ).append( $( "h2" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
       <h2>Greetings</h2>
     </div>
    -
    +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    Additional Arguments

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

    -
    var $newdiv1 = $('<div id="object1"/>'),
    -    newdiv2 = document.createElement('div'),
    -    existingdiv1 = document.getElementById('foo');
    +    
    
    +var $newdiv1 = $( "<div id='object1'/>" ),
    +    newdiv2 = document.createElement( "div" ),
    +    existingdiv1 = document.getElementById( "foo" );
     
    -$('body').append($newdiv1, [newdiv2, existingdiv1]);
    +$( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
     
    -

    Since .append() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').append($newdiv1, newdiv2, existingdiv1). The type and number of arguments will largely depend on how you collect the elements in your code.

    +

    Since .append() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').append( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    Appends some HTML to all paragraphs. - + p { + background: yellow; + } + ]]> + Appends an Element to all paragraphs. - + Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. - + p { + background: yellow; + } + ]]> + diff --git a/entries/appendTo.xml b/entries/appendTo.xml index 67d6b3eb..2443133f 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -13,19 +13,22 @@ Insert every element in the set of matched elements to the end of the target. -

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    +

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
     </div>
    -
    +

    We can create content and insert it into several elements at once:

    -
    $('<p>Test</p>').appendTo('.inner');
    -
    +
    
    +$( "<p>Test</p>" ).appendTo( ".inner" );
    +    

    Each inner <div> element gets this new content:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">
         Hello
    @@ -36,29 +39,37 @@
         <p>Test</p>
       </div>
     </div>
    -
    +

    We can also select an element on the page and insert it into another:

    -
    $('h2').appendTo($('.container'));
    -
    +
    
    +$( "h2" ).appendTo( $( ".container" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned) and a new set consisting of the inserted element is returned:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
       <h2>Greetings</h2>
     </div>
    -
    +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

    Append all spans to the element with the ID "foo" (Check append() documentation for more examples) - - + +
    FOO!
    +]]>
    diff --git a/entries/attr.xml b/entries/attr.xml index d53f6637..1ce77944 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -38,33 +38,33 @@
    - $(elem).prop("checked") + $( elem ).prop( "checked" ) true (Boolean) Will change with checkbox state
    - elem.getAttribute("checked") + elem.getAttribute( "checked" ) "checked" (String) Initial state of the checkbox; does not change
    - $(elem).attr("checked") + $( elem ).attr( "checked" ) (1.6) "checked" (String) Initial state of the checkbox; does not change
    - $(elem).attr("checked") + $( elem ).attr( "checked" ) (1.6.1+) "checked" (String) Will change with checkbox state
    - $(elem).attr("checked") + $( elem ).attr( "checked" ) (pre-1.6) true (Boolean) Changed with checkbox state
    +]]> 160 Apply three different styles to list items to demonstrate that :eq() is designed to select a single element while :nth-child() or :eq() within a looping construct such as .each() can select multiple elements. - - + - + div { + width: 60px; + height: 60px; + margin: 10px; + float: left; + border: 2px solid blue; + } + .blue { + background: blue; + } +]]> + - \ No newline at end of file + diff --git a/entries/error.xml b/entries/error.xml index ab3dd595..e5c0c07d 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -18,16 +18,19 @@ -

    This method is a shortcut for .on('error', handler).

    +

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

    The error event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly.

    For example, consider a page with a simple image element:

    -
    <img alt="Book" id="book" />
    +
    
    +<img alt="Book" id="book">
    +    

    The event handler can be bound to the image:

    -
    $('#book')
    +    
    
    +$( "#book" )
       .error(function() {
    -    alert('Handler for .error() called.')
    +    alert( "Handler for .error() called." )
       })
    -  .attr("src", "missing.png");
    +  .attr( "src", "missing.png" );
         

    If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed:

    @@ -40,11 +43,13 @@ To hide the "broken image" icons for IE users, you can try: - + .attr( "src", "missing.png" ); +]]> diff --git a/entries/even-selector.xml b/entries/even-selector.xml index 42210e41..01b1c88d 100644 --- a/entries/even-selector.xml +++ b/entries/even-selector.xml @@ -13,19 +13,22 @@ Finds even table rows, matching the first, third and so on (index 0, 2, 4 etc.). - + - +]]> + diff --git a/entries/event.currentTarget.xml b/entries/event.currentTarget.xml index d25c6f7b..92114c8f 100644 --- a/entries/event.currentTarget.xml +++ b/entries/event.currentTarget.xml @@ -13,9 +13,11 @@ Alert that currentTarget matches the `this` keyword. - +}); +]]> diff --git a/entries/event.data.xml b/entries/event.data.xml index 93155fef..551e8162 100644 --- a/entries/event.data.xml +++ b/entries/event.data.xml @@ -18,13 +18,13 @@

    ]]> When a button in any box class is clicked, change the box's background color to red. - + diff --git a/entries/event.isDefaultPrevented.xml b/entries/event.isDefaultPrevented.xml index 0b660e1e..53bea851 100644 --- a/entries/event.isDefaultPrevented.xml +++ b/entries/event.isDefaultPrevented.xml @@ -8,11 +8,13 @@ Checks whether event.preventDefault() was called. - +}); +]]> diff --git a/entries/event.isImmediatePropagationStopped.xml b/entries/event.isImmediatePropagationStopped.xml index 8f6e63d5..241881bc 100644 --- a/entries/event.isImmediatePropagationStopped.xml +++ b/entries/event.isImmediatePropagationStopped.xml @@ -11,26 +11,25 @@ Checks whether event.stopImmediatePropagation() was called. diff --git a/entries/event.isPropagationStopped.xml b/entries/event.isPropagationStopped.xml index dbf08286..ed73ecc0 100644 --- a/entries/event.isPropagationStopped.xml +++ b/entries/event.isPropagationStopped.xml @@ -11,26 +11,25 @@ Checks whether event.stopPropagation() was called diff --git a/entries/event.metaKey.xml b/entries/event.metaKey.xml index a35597ac..8d1ca7b8 100644 --- a/entries/event.metaKey.xml +++ b/entries/event.metaKey.xml @@ -4,21 +4,28 @@ 1.0.4 - Indicates whether the META key was pressed when the event fired. - + Indicates whether the META key was pressed when the event fired. +

    Returns a boolean value (true or false) that indicates whether or not the META key was pressed at the time the event fired. This key might map to an alternative key name on some platforms.

    -
    +
    Determine whether the META key was pressed when the event fired. - body {background-color: #eef; } - div { padding: 20px; } - + - + diff --git a/entries/event.namespace.xml b/entries/event.namespace.xml index 096fd57a..ed661c92 100644 --- a/entries/event.namespace.xml +++ b/entries/event.namespace.xml @@ -11,11 +11,11 @@ Determine the event namespace used. - + Show the mouse position relative to the left and top edges of the document (within this iframe). + + + - \ No newline at end of file + diff --git a/entries/event.pageY.xml b/entries/event.pageY.xml index a1aaf7b2..baf7def6 100644 --- a/entries/event.pageY.xml +++ b/entries/event.pageY.xml @@ -8,16 +8,23 @@ Show the mouse position relative to the left and top edges of the document (within this iframe). - body {background-color: #eef; } - div { padding: 20px; } - - + + +]]> - \ No newline at end of file + diff --git a/entries/event.preventDefault.xml b/entries/event.preventDefault.xml index 397b066c..3622102b 100644 --- a/entries/event.preventDefault.xml +++ b/entries/event.preventDefault.xml @@ -6,16 +6,16 @@ If this method is called, the default action of the event will not be triggered. -

    For example, clicked anchors will not take the browser to a new URL. We can use event.isDefaultPrevented() to determine if this method has been called by an event handler that was triggered by this event.

    +

    For example, clicked anchors will not take the browser to a new URL. We can use event.isDefaultPrevented() to determine if this method has been called by an event handler that was triggered by this event.

    Cancel the default action (navigation) of the click. + - \ No newline at end of file + diff --git a/entries/event.result.xml b/entries/event.result.xml index e6823b2c..fa5cd9ad 100644 --- a/entries/event.result.xml +++ b/entries/event.result.xml @@ -11,11 +11,11 @@ Display previous handler's return value - + $( this ).css( "background-color", "#f00" ); +}); +]]> + - \ No newline at end of file + diff --git a/entries/event.stopPropagation.xml b/entries/event.stopPropagation.xml index 69c5ee72..b3e67a76 100644 --- a/entries/event.stopPropagation.xml +++ b/entries/event.stopPropagation.xml @@ -13,11 +13,13 @@ Kill the bubbling on the click event. - +}); +]]> - \ No newline at end of file + diff --git a/entries/event.target.xml b/entries/event.target.xml index cd134624..eef599a1 100644 --- a/entries/event.target.xml +++ b/entries/event.target.xml @@ -10,30 +10,38 @@ Display the tag's name on click - - -span, strong, p { - padding: 8px; display: block; border: 1px solid #999; } - + + + +]]> Implements a simple event delegation: The click handler is added to an unordered list, and the children of its li children are hidden. Clicking one of the li children toggles (see toggle()) their children. - +$( "ul" ).click( handler ).find( "ul" ).hide(); +]]>
  • sub item 2-b
  • -]]> + +]]>
    - \ No newline at end of file + diff --git a/entries/event.timeStamp.xml b/entries/event.timeStamp.xml index e3d34993..f63b62ce 100644 --- a/entries/event.timeStamp.xml +++ b/entries/event.timeStamp.xml @@ -12,24 +12,30 @@ Display the time since the click handler last executed. +
    Click.
    +]]>
    - \ No newline at end of file + diff --git a/entries/event.type.xml b/entries/event.type.xml index 17193dcf..356f22b4 100644 --- a/entries/event.type.xml +++ b/entries/event.type.xml @@ -8,10 +8,12 @@ On all anchor clicks, alert the event type. - + - \ No newline at end of file + diff --git a/entries/event.which.xml b/entries/event.which.xml index 3926be56..128e70b1 100644 --- a/entries/event.which.xml +++ b/entries/event.which.xml @@ -11,24 +11,28 @@ Log which key was depressed. - + +
    +]]>
    Log which mouse button was depressed. +
    +]]>
    - \ No newline at end of file + From f6d7c044dd439436f361356d0f81d68ea3a21558 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Fri, 12 Jul 2013 16:45:04 +0100 Subject: [PATCH 239/998] Changed all URLs to the recommended rooted relative URLs with trailing slash (a - e entries) --- entries/add.xml | 2 +- entries/after.xml | 4 ++-- entries/ajaxComplete.xml | 2 +- entries/ajaxError.xml | 2 +- entries/ajaxSend.xml | 4 ++-- entries/ajaxStart.xml | 2 +- entries/ajaxStop.xml | 2 +- entries/ajaxSuccess.xml | 2 +- entries/andSelf.xml | 2 +- entries/append.xml | 6 +++--- entries/appendTo.xml | 2 +- entries/attr.xml | 4 ++-- entries/before.xml | 4 ++-- entries/bind.xml | 10 +++++----- entries/blur.xml | 2 +- entries/children.xml | 2 +- entries/clone.xml | 2 +- entries/deferred.done.xml | 2 +- entries/deferred.fail.xml | 4 ++-- entries/deferred.isRejected.xml | 6 +++--- entries/deferred.isResolved.xml | 6 +++--- entries/deferred.notify.xml | 2 +- entries/deferred.notifyWith.xml | 2 +- entries/deferred.reject.xml | 4 ++-- entries/deferred.rejectWith.xml | 2 +- entries/deferred.resolveWith.xml | 2 +- entries/deferred.state.xml | 4 ++-- entries/deferred.then.xml | 2 +- entries/delegate.xml | 4 ++-- entries/detach.xml | 2 +- entries/die.xml | 2 +- entries/end.xml | 2 +- entries/even-selector.xml | 2 +- entries/event.currentTarget.xml | 2 +- entries/event.delegateTarget.xml | 2 +- entries/event.isDefaultPrevented.xml | 2 +- entries/event.isPropagationStopped.xml | 2 +- entries/event.preventDefault.xml | 2 +- entries/event.stopImmediatePropagation.xml | 4 ++-- entries/event.stopPropagation.xml | 4 ++-- 40 files changed, 60 insertions(+), 60 deletions(-) diff --git a/entries/add.xml b/entries/add.xml index 6c2d3acf..ba7bd723 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -74,7 +74,7 @@ $( "li" ).add( "<p id='new'>new paragraph</p>" )

    Although the new paragraph has been created and its background color changed, it still does not appear on the page. To place it on the page, we could add one of the insertion methods to the chain.

    As of jQuery 1.4 the results from .add() will always be returned in document order (rather than a simple concatenation).

    -

    Note: To reverse the .add() you can use .not( elements | selector ) to remove elements from the jQuery results, or .end() to return to the selection before you added.

    +

    Note: To reverse the .add() you can use .not( elements | selector ) to remove elements from the jQuery results, or .end() to return to the selection before you added.

    Finds all divs and makes a border. Then adds all paragraphs to the jQuery object to set their backgrounds yellow. diff --git a/entries/after.xml b/entries/after.xml index 96e0edc4..03324a88 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -26,7 +26,7 @@ Insert content, specified by the parameter, after each element in the set of matched elements. -

    The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

    +

    The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

    Using the following HTML:

    
     <div class="container">
    @@ -89,7 +89,7 @@ $( "p" ).after(function() {
         

    This example inserts a <div> after each paragraph, with each new <div> containing the class name(s) of its preceding paragraph.

    Additional Arguments

    -

    Similar to other content-adding methods such as .prepend() and .before(), .after() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    +

    Similar to other content-adding methods such as .prepend() and .before(), .after() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> after the first paragraph:

    
     var $newdiv1 = $( "<div id='object1'/>" ),
    diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml
    index a1f7e52d..3b3fc93e 100644
    --- a/entries/ajaxComplete.xml
    +++ b/entries/ajaxComplete.xml
    @@ -7,7 +7,7 @@
           The function to be invoked.
         
       
    -  Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
    +  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.

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

    diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 21a03466..801fef62 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -7,7 +7,7 @@ The function to be invoked. - Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + 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.

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

    diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index e3660d9f..aafc943b 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -7,7 +7,7 @@ The function to be invoked. - Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + 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.

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

    @@ -30,7 +30,7 @@ $( ".trigger" ).click(function() {

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

    As of jQuery 1.8, the .ajaxSend() method should only be attached to document.

    -

    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:

    +

    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 ) {
       if ( settings.url == "ajax/test.html" ) {
    diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml
    index 0e502a19..854ad019 100644
    --- a/entries/ajaxStart.xml
    +++ b/entries/ajaxStart.xml
    @@ -7,7 +7,7 @@
           The function to be invoked.
         
       
    -  Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
    +  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.

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

    diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 80600f00..88d318e5 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -1,7 +1,7 @@ .ajaxStop() - Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 1.0 diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index a0c25aae..968350d8 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -7,7 +7,7 @@ The function to be invoked. - Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + 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.

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

    diff --git a/entries/andSelf.xml b/entries/andSelf.xml index a3f4c1b5..6870b479 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -7,7 +7,7 @@ Add the previous set of elements on the stack to the current set.

    Note: This function has been deprecated and is now an alias for .addBack(), which should be used with jQuery 1.8 and later.

    -

    As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

    +

    As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

    Consider a page with a simple list on it:

    
     <ul>
    diff --git a/entries/append.xml b/entries/append.xml
    index ef6c0988..9eb836ba 100644
    --- a/entries/append.xml
    +++ b/entries/append.xml
    @@ -26,8 +26,8 @@
       
       Insert content, specified by the parameter, to the end of each element in the set of matched elements.
       
    -    

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    -

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    +

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    +

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    
     <h2>Greetings</h2>
    @@ -68,7 +68,7 @@ $( ".container" ).append( $( "h2" ) );
         

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    Additional Arguments

    -

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    +

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

    
     var $newdiv1 = $( "<div id='object1'/>" ),
    diff --git a/entries/appendTo.xml b/entries/appendTo.xml
    index e63419e4..919fcbe1 100644
    --- a/entries/appendTo.xml
    +++ b/entries/appendTo.xml
    @@ -14,7 +14,7 @@
       
       Insert every element in the set of matched elements to the end of the target.
       
    -    

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    +

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    
     <h2>Greetings</h2>
    diff --git a/entries/attr.xml b/entries/attr.xml
    index f41fea75..5e9dd89c 100644
    --- a/entries/attr.xml
    +++ b/entries/attr.xml
    @@ -23,11 +23,11 @@
           

    Note: Attempting to change the type attribute (or property) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

    -

    As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

    +

    As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

    Attributes vs. Properties

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    -

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    +

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    Concerning boolean attributes, consider a DOM element defined by the HTML markup <input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:

    diff --git a/entries/before.xml b/entries/before.xml index 355dbf88..377b5df2 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -27,7 +27,7 @@ Insert content, specified by the parameter, before each element in the set of matched elements. -

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    +

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    Consider the following HTML:

    
     <div class="container">
    @@ -69,7 +69,7 @@ $( "<div>" ).before( "<p></p>" );
         

    The result is a jQuery set that contains a paragraph and a div (in that order).

    Additional Arguments

    -

    Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    +

    Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> before the first paragraph:

    
     var newdiv1 = $( "<div id='object1'/>" ),
    diff --git a/entries/bind.xml b/entries/bind.xml
    index 145ce6b8..8daadb80 100644
    --- a/entries/bind.xml
    +++ b/entries/bind.xml
    @@ -33,10 +33,10 @@
       
       Attach a handler to an event for the elements.
       
    -    

    As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

    +

    As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

    Any string is legal for eventType; if the string is not the name of a native DOM event, then the handler is bound to a custom event. These events are never called by the browser, but may be triggered manually from other JavaScript code using .trigger() or .triggerHandler().

    If the eventType string contains a period (.) character, then the event is namespaced. The period character separates the event from its namespace. For example, in the call .bind( "click.name", handler ), the string click is the event type, and the string name is the namespace. Namespacing allows us to unbind or trigger some events of a type without affecting others. See the discussion of .unbind() for more information.

    -

    There are shorthand methods for some standard browser events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

    +

    There are shorthand methods for some standard browser events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

    When an event reaches an element, all handlers bound to that event type for the element are fired. If there are multiple handlers registered, they will always execute in the order in which they were bound. After all handlers have executed, the event continues along the normal event propagation path.

    A basic usage of .bind() is:

    
    @@ -76,10 +76,10 @@ $( "#foo" ).bind( "click", function() {
         

    As of jQuery 1.4.2 duplicate event handlers can be bound to an element instead of being discarded. This is useful when the event data feature is being used, or when other unique data resides in a closure around the event handler function.

    In jQuery 1.4.3 you can now pass in false in place of an event handler. This will bind an event handler equivalent to: function(){ return false; }. This function can be removed at a later time by calling: .unbind( eventName, false ).

    - The Event object + The Event object

    The handler callback function can also take parameters. When the function is called, the event object will be passed to the first parameter.

    -

    The event object is often unnecessary and the parameter omitted, as sufficient context is usually available when the handler is bound to know exactly what needs to be done when the handler is triggered. However, at times it becomes necessary to gather more information about the user's environment at the time the event was initiated. View the full Event Object.

    +

    The event object is often unnecessary and the parameter omitted, as sufficient context is usually available when the handler is bound to know exactly what needs to be done when the handler is triggered. However, at times it becomes necessary to gather more information about the user's environment at the time the event was initiated. View the full Event Object.

    Returning false from a handler is equivalent to calling both .preventDefault() and .stopPropagation() on the event object.

    Using the event object in a handler looks like this:

    
    @@ -231,7 +231,7 @@ $( "button" ).click(function() {
       span {
         color: blue;
       }
    -  ]]>
    +]]>
         The function to be invoked.
         
       
    -  Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
    +  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.

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

    From 2f54b03ad716b8470d6f014865bc269e06c33ae1 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Fri, 12 Jul 2013 21:59:45 +0100 Subject: [PATCH 241/998] Code indentation and formatting (f - j entries) --- entries/each.xml | 4 +- entries/empty.xml | 2 +- entries/fadeIn.xml | 122 +++++++++++------- entries/fadeOut.xml | 122 ++++++++++-------- entries/fadeTo.xml | 132 +++++++++++++------- entries/fadeToggle.xml | 15 ++- entries/file-selector.xml | 60 +++++---- entries/filter.xml | 137 +++++++++++--------- entries/find.xml | 96 ++++++++------ entries/finish.xml | 62 ++++----- entries/first-child-selector.xml | 53 ++++---- entries/first-of-type-selector.xml | 36 +++--- entries/first-selector.xml | 29 +++-- entries/first.xml | 36 ++++-- entries/focus-selector.xml | 22 ++-- entries/focus.xml | 63 ++++++---- entries/focusin.xml | 16 ++- entries/focusout.xml | 37 +++--- entries/get.xml | 71 ++++++----- entries/gt-selector.xml | 5 +- entries/has-attribute-selector.xml | 19 +-- entries/has-selector.xml | 23 ++-- entries/has.xml | 14 ++- entries/hasClass.xml | 43 ++++--- entries/header-selector.xml | 26 ++-- entries/height.xml | 110 +++++++++------- entries/hidden-selector.xml | 59 +++++---- entries/hide.xml | 107 +++++++++------- entries/hover.xml | 137 ++++++++++++-------- entries/html.xml | 130 ++++++++++++------- entries/id-selector.xml | 30 ++--- entries/image-selector.xml | 57 +++++---- entries/index.xml | 145 ++++++++++++++------- entries/innerHeight.xml | 23 +++- entries/innerWidth.xml | 23 +++- entries/input-selector.xml | 60 ++++----- entries/insertAfter.xml | 45 ++++--- entries/insertBefore.xml | 42 +++++-- entries/is.xml | 194 ++++++++++++++++++----------- entries/jQuery.Callbacks.xml | 109 ++++++++-------- entries/jQuery.Deferred.xml | 8 +- entries/jQuery.ajax.xml | 166 ++++++++++++++---------- entries/jQuery.ajaxPrefilter.xml | 10 +- entries/jQuery.ajaxSetup.xml | 39 +++--- entries/jQuery.ajaxTransport.xml | 37 ++---- entries/jQuery.boxModel.xml | 29 +++-- entries/jQuery.browser.xml | 17 +-- entries/jQuery.contains.xml | 6 +- entries/jQuery.cssHooks.xml | 121 ++++++++---------- entries/jQuery.data.xml | 96 ++++++++------ entries/jQuery.dequeue.xml | 49 +++++--- entries/jQuery.each.xml | 68 +++++----- entries/jQuery.error.xml | 4 +- entries/jQuery.extend.xml | 44 ++++--- entries/jQuery.fn.extend.xml | 15 ++- entries/jQuery.fx.interval.xml | 24 ++-- entries/jQuery.fx.off.xml | 30 +++-- entries/jQuery.get.xml | 84 ++++++++----- entries/jQuery.getJSON.xml | 102 ++++++++------- entries/jQuery.getScript.xml | 76 +++++------ entries/jQuery.globalEval.xml | 15 +-- entries/jQuery.grep.xml | 62 +++++---- entries/jQuery.hasData.xml | 29 ++--- entries/jQuery.holdReady.xml | 10 +- entries/jQuery.inArray.xml | 24 ++-- entries/jQuery.isArray.xml | 10 +- entries/jQuery.isEmptyObject.xml | 9 +- entries/jQuery.isFunction.xml | 54 ++++---- entries/jQuery.isNumeric.xml | 30 ++--- entries/jQuery.isPlainObject.xml | 10 +- entries/jQuery.isWindow.xml | 10 +- entries/jQuery.isXMLDoc.xml | 8 +- entries/jQuery.makeArray.xml | 37 +++--- entries/jQuery.map.xml | 135 ++++++++++++-------- entries/jQuery.merge.xml | 33 +++-- entries/jQuery.noConflict.xml | 71 ++++++----- entries/jQuery.param.xml | 62 +++++---- entries/jQuery.parseHTML.xml | 11 +- entries/jQuery.parseJSON.xml | 14 ++- entries/jQuery.parseXML.xml | 8 +- entries/jQuery.post.xml | 111 ++++++++++------- entries/jQuery.proxy.xml | 92 +++++++------- entries/jQuery.queue.xml | 179 +++++++++++++++----------- entries/jQuery.removeData.xml | 40 +++--- entries/jQuery.sub.xml | 38 +++--- entries/jQuery.support.xml | 30 +++-- entries/jQuery.trim.xml | 18 +-- entries/jQuery.type.xml | 8 +- entries/jQuery.unique.xml | 38 +++--- entries/jQuery.when.xml | 40 +++--- entries/jQuery.xml | 114 ++++++++++------- entries/jquery-2.xml | 14 +-- 92 files changed, 2896 insertions(+), 2009 deletions(-) diff --git a/entries/each.xml b/entries/each.xml index 081dd545..0f21947e 100644 --- a/entries/each.xml +++ b/entries/each.xml @@ -44,8 +44,8 @@ $( "li" ).addClass( "bar" ); Iterate over three divs and sets their color property. diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml index 92b98b8f..76f1a7fe 100644 --- a/entries/fadeIn.xml +++ b/entries/fadeIn.xml @@ -22,16 +22,18 @@

    The .fadeIn() method animates the opacity of the matched elements. It is similar to the .fadeTo() method but that method does not unhide the element and can specify the final opacity level.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    -      Click here
    -    </div>
    -    <img id="book" src="book.png" alt="" width="100" height="123" />
    -    With the element initially hidden, we can show it slowly:
    -    $('#clickme').click(function() {
    -      $('#book').fadeIn('slow', function() {
    -        // Animation complete
    -      });
    -    });
    +
    
    +<div id="clickme">
    +  Click here
    +</div>
    +<img id="book" src="book.png" alt="" width="100" height="123">
    +With the element initially hidden, we can show it slowly:
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).fadeIn( "slow", function() {
    +    // Animation complete
    +  });
    +});
    +    

    @@ -42,59 +44,89 @@

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds. +]]>
    - + Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top. - + p { + position: relative; + width: 400px; + height: 90px; + } + div { + position: absolute; + width: 400px; + height: 65px; + font-size: 36px; + text-align: center; + color: yellow; + background: red; + padding-top: 25px; + top: 0; + left: 0; + display: none; + } + span { + display: none; + } +]]> + - \ No newline at end of file + diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index 5f972aa1..b7b3cc46 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -22,16 +22,20 @@

    The .fadeOut() method animates the opacity of the matched elements. Once the opacity reaches 0, the display style property is set to none, so the element no longer affects the layout of the page.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123"> +

    With the element initially shown, we can hide it slowly:

    -
    $('#clickme').click(function() {
    -  $('#book').fadeOut('slow', function() {
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).fadeOut( "slow", function() {
         // Animation complete.
       });
    -});
    +}); +

    @@ -39,84 +43,102 @@

    -

    Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

    +

    Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Animates all paragraphs to fade out, completing the animation within 600 milliseconds. +$( "p" ).click(function() { + $( "p" ).fadeOut( "slow" ); +}); +]]>
    - + +

    +]]> Fades out spans in one section that you click on. +}); +$( "span" ).hover(function() { + $( this ).addClass( "hilite" ); +}, function() { + $( this ).removeClass( "hilite" ); +}); +]]> - + +

    +]]>
    Fades out two divs, one with a "linear" easing and one with the default, "swing," easing. - +

    +]]>
    Fade div to a random opacity on each click, completing the animation within 200 milliseconds. - +
    +]]>
    Find the right answer! The fade will take 250 milliseconds and change various styles when it completes. - +
    +]]>
    diff --git a/entries/fadeToggle.xml b/entries/fadeToggle.xml index 34141424..93bac084 100644 --- a/entries/fadeToggle.xml +++ b/entries/fadeToggle.xml @@ -20,18 +20,18 @@

    The string representing an easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion. @@ -39,7 +39,6 @@ $("button:last").click(function () {

    This paragraph has a slow, linear fade.

    -

    This paragraph has a fast animation.

    ]]> @@ -47,4 +46,4 @@ $("button:last").click(function () { - \ No newline at end of file + diff --git a/entries/file-selector.xml b/entries/file-selector.xml index 18ce5e36..7fb01843 100644 --- a/entries/file-selector.xml +++ b/entries/file-selector.xml @@ -7,45 +7,43 @@ Selects all elements of type file. -

    :file is equivalent to [type="file"]. As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':file') is equivalent to $('*:file'), so $('input:file') should be used instead.

    +

    :file is equivalent to [type="file"]. As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $( ":file" ) is equivalent to $("*:file" ), so $( "input:file" ) should be used instead.

    Finds all file inputs. - + textarea { + height: 45px; + } +]]> + - \ No newline at end of file + diff --git a/entries/filter.xml b/entries/filter.xml index 889e3d59..fd890e0f 100644 --- a/entries/filter.xml +++ b/entries/filter.xml @@ -27,7 +27,7 @@ Reduce the set of matched elements to those that match the selector or pass the function's test.

    Given a jQuery object that represents a set of DOM elements, the .filter() method constructs a new jQuery object from a subset of the matching elements. The supplied selector is tested against each element; all elements matching the selector will be included in the result.

    Consider a page with a simple list on it:

    -
    
    +    
    
     <ul>
       <li>list item 1</li>
       <li>list item 2</li>
    @@ -36,15 +36,15 @@
       <li>list item 5</li>
       <li>list item 6</li>
     </ul>
    -
    -

    We can apply this method to the set of list items:

    -
    
    -  $('li').filter(':even').css('background-color', 'red');
    -
    -

    The result of this call is a red background for items 1, 3, and 5, as they match the selector (recall that :even and :odd use 0-based indexing).

    -

    Using a Filter Function

    -

    The second form of this method allows us to filter elements against a function rather than a selector. For each element, if the function returns true (or a "truthy" value), the element will be included in the filtered set; otherwise, it will be excluded. Suppose we have a somewhat more involved HTML snippet:

    -
    
    +    
    +

    We can apply this method to the set of list items:

    +
    
    +$( "li" ).filter( ":even" ).css( "background-color", "red" );
    +    
    +

    The result of this call is a red background for items 1, 3, and 5, as they match the selector (recall that :even and :odd use 0-based indexing).

    +

    Using a Filter Function

    +

    The second form of this method allows us to filter elements against a function rather than a selector. For each element, if the function returns true (or a "truthy" value), the element will be included in the filtered set; otherwise, it will be excluded. Suppose we have a somewhat more involved HTML snippet:

    +
    
     <ul>
       <li><strong>list</strong> item 1 -
         one strong tag</li>
    @@ -55,76 +55,93 @@
       <li>list item 5</li>
       <li>list item 6</li>
     </ul>
    -
    -

    We can select the list items, then filter them based on their contents:

    -
    
    -$('li').filter(function(index) {
    -  return $('strong', this).length == 1;
    -}).css('background-color', 'red');
    -
    -

    This code will alter the first list item only, as it contains exactly one <strong> tag. Within the filter function, this refers to each DOM element in turn. The parameter passed to the function tells us the index of that DOM element within the set matched by the jQuery object.

    -

    We can also take advantage of the index passed through the function, which indicates the 0-based position of the element within the unfiltered set of matched elements:

    -
    
    -$('li').filter(function(index) {
    -  return index % 3 == 2;
    -}).css('background-color', 'red');
    -
    -

    This alteration to the code will cause the third and sixth list items to be highlighted, as it uses the modulus operator (%) to select every item with an index value that, when divided by 3, has a remainder of 2.

    - +
    +

    We can select the list items, then filter them based on their contents:

    +
    
    +$( "li" )
    +  .filter(function( index ) {
    +    return $( "strong", this ).length == 1;
    +  })
    +  .css( "background-color", "red" );
    +    
    +

    This code will alter the first list item only, as it contains exactly one <strong> tag. Within the filter function, this refers to each DOM element in turn. The parameter passed to the function tells us the index of that DOM element within the set matched by the jQuery object.

    +

    We can also take advantage of the index passed through the function, which indicates the 0-based position of the element within the unfiltered set of matched elements:

    +
    
    +$( "li" )
    +  .filter(function( index ) {
    +    return index % 3 == 2;
    +  })
    +  .css( "background-color", "red" );
    +    
    +

    This alteration to the code will cause the third and sixth list items to be highlighted, as it uses the modulus operator (%) to select every item with an index value that, when divided by 3, has a remainder of 2.

    +
    Change the color of all divs; then add a border to those with a "middle" class. - + div { + width: 60px; + height: 60px; + margin: 5px; + float: left; + border: 2px white solid; + } +]]> + Change the color of all divs; then add a border to the second one (index == 1) and the div with an id of "fourth." + div { + width: 60px; + height: 60px; + margin: 5px; + float: left; + border: 3px white solid; + } +]]> +
    +
    +
    +
    +
    +
    +]]>
    Select all divs and filter the selection with a DOM element, keeping only the one with an id of "unique". - + Select all divs and filter the selection with a jQuery object, keeping only the one with an id of "unique". +$( "div" ).filter( $( "#unique" ) ); +]]> - \ No newline at end of file + diff --git a/entries/find.xml b/entries/find.xml index 14ddba90..40531105 100644 --- a/entries/find.xml +++ b/entries/find.xml @@ -42,77 +42,101 @@ </li> <li class="item-iii">III</li> </ul> -
    +

    If we begin at item II, we can find list items within it:

    -
    $('li.item-ii').find('li').css('background-color', 'red');
    +
    
    +$( "li.item-ii" ).find( "li" ).css( "background-color", "red" );
    +    

    The result of this call is a red background on items A, B, 1, 2, 3, and C. Even though item II matches the selector expression, it is not included in the results; only descendants are considered candidates for the match.

    Unlike in the rest of the tree traversal methods, the selector expression is required in a call to .find(). If we need to retrieve all of the descendant elements, we can pass in the universal selector '*' to accomplish this.

    -

    Selector context is implemented with the .find() method; therefore, $('li.item-ii').find('li') is equivalent to $('li', 'li.item-ii').

    +

    Selector context is implemented with the .find() method; therefore, $( "li.item-ii" ).find( "li" ) is equivalent to $( "li", "li.item-ii" ).

    As of jQuery 1.6, we can also filter the selection with a given jQuery collection or element. With the same nested list as above, if we start with:

    -
    var $allListElements = $('li');
    +
    
    +var $allListElements = $( "li" );
    +    

    And then pass this jQuery object to find:

    -
    $('li.item-ii').find( $allListElements );
    +
    
    +$( "li.item-ii" ).find( $allListElements );
    +    

    This will return a jQuery collection which contains only the list elements that are descendants of item II.

    Similarly, an element may also be passed to find:

    
    -var item1 = $('li.item-1')[0];
    -$('li.item-ii').find( item1 ).css('background-color', 'red');
    -
    +var item1 = $( "li.item-1" )[ 0 ]; +$( "li.item-ii" ).find( item1 ).css( "background-color", "red" ); +

    The result of this call would be a red background on item 1.

    Starts with all paragraphs and searches for descendant span elements, same as $("p span") - + A selection using a jQuery collection of all span tags. Only spans within p tags are changed to red while others are left blue. + span { + color: blue; + } +]]> - + Add spans around each word then add a hover and italicize words with the letter t. - + +

    +]]>
    - \ No newline at end of file + diff --git a/entries/finish.xml b/entries/finish.xml index 3c143118..3fbdca9c 100644 --- a/entries/finish.xml +++ b/entries/finish.xml @@ -19,43 +19,42 @@ Click the Go button once to start the animation, and then click the other buttons to see how they affect the current and queued animations. - - + span { + color: #008; + } + span.sogreen { + color: green; + font-weight: bolder; + } +]]> + - \ No newline at end of file + diff --git a/entries/first-of-type-selector.xml b/entries/first-of-type-selector.xml index 08220642..e63d0501 100644 --- a/entries/first-of-type-selector.xml +++ b/entries/first-of-type-selector.xml @@ -12,23 +12,29 @@ Find the first span in each matched div and add a class to it. - + span.fot { + color: red; + font-size: 120%; + font-style: italic; + } +]]> + diff --git a/entries/first-selector.xml b/entries/first-selector.xml index bd6bee03..a0371809 100644 --- a/entries/first-selector.xml +++ b/entries/first-selector.xml @@ -7,25 +7,30 @@ Selects the first matched element. -

    The :first pseudo-class is equivalent to :eq(0). It could also be written as :lt(1). While this matches only a single element, :first-child can match more than one: One for each parent.

    +

    The :first pseudo-class is equivalent to :eq( 0 ). It could also be written as :lt( 1 ). While this matches only a single element, :first-child can match more than one: One for each parent.

    Finds the first table row. - + - + td { + color: blue; + font-weight: bold; + } +]]> + - \ No newline at end of file + diff --git a/entries/first.xml b/entries/first.xml index 1921362b..f73f8f10 100644 --- a/entries/first.xml +++ b/entries/first.xml @@ -5,9 +5,10 @@ 1.4 Reduce the set of matched elements to the first in the set. -

    Given a jQuery object that represents a set of DOM elements, the .first() method constructs a new jQuery object from the first element in that set.

    -

    Consider a page with a simple list on it:

    -
    
    +  
    +    

    Given a jQuery object that represents a set of DOM elements, the .first() method constructs a new jQuery object from the first element in that set.

    +

    Consider a page with a simple list on it:

    +
    
     <ul>
       <li>list item 1</li>
       <li>list item 2</li>
    @@ -15,15 +16,30 @@
       <li>list item 4</li>
       <li>list item 5</li>
     </ul>
    -
    -

    We can apply this method to the set of list items:

    -
    $('li').first().css('background-color', 'red');
    -

    The result of this call is a red background for the first item.

    +
    +

    We can apply this method to the set of list items:

    +
    
    +$( "li" ).first().css( "background-color", "red" );
    +    
    +

    The result of this call is a red background for the first item.

    +
    Highlight the first span in a paragraph. - - - + + + diff --git a/entries/focus-selector.xml b/entries/focus-selector.xml index eb12615f..d672df28 100644 --- a/entries/focus-selector.xml +++ b/entries/focus-selector.xml @@ -7,7 +7,7 @@ Selects element if it is currently focused. -

    As with other pseudo-class selectors (those that begin with a ":"), it is recommended to precede :focus with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':focus') is equivalent to $('*:focus'). If you are looking for the currently focused element, $( document.activeElement ) will retrieve it without having to search the whole DOM tree.

    +

    As with other pseudo-class selectors (those that begin with a ":"), it is recommended to precede :focus with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":focus" ) is equivalent to $( "*:focus" ). If you are looking for the currently focused element, $( document.activeElement ) will retrieve it without having to search the whole DOM tree.

    Adds the focused class to whatever element has focus @@ -16,7 +16,7 @@ $( "#content" ).delegate( "*", "focus blur", function( event ) { var elem = $( this ); setTimeout(function() { elem.toggleClass( "focused", elem.is( ":focus" ) ); - }, 0); + }, 0 ); }); ]]> - \ No newline at end of file + diff --git a/entries/focus.xml b/entries/focus.xml index 67b2a097..b8398786 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -22,59 +22,74 @@
      -
    • This method is a shortcut for .on('focus', handler) in the first and second variations, and .trigger('focus') in the third.
    • +
    • This method is a shortcut for .on( "focus", handler ) in the first and second variations, and .trigger( "focus" ) in the third.
    • The focus event is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
    • Elements with focus are usually highlighted in some way by the browser, for example with a dotted line surrounding the element. The focus is used to determine which element is the first to receive keyboard-related events.
    -

    Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use .focus() on elements that are visible. To run an element's focus event handlers without setting focus to the element, use .triggerHandler("focus") instead of .focus().

    +

    Attempting to set focus to a hidden element causes an error in Internet Explorer. Take care to only use .focus() on elements that are visible. To run an element's focus event handlers without setting focus to the element, use .triggerHandler( "focus" ) instead of .focus().

    For example, consider the HTML:

    -
    <form>
    -  <input id="target" type="text" value="Field 1" />
    -  <input type="text" value="Field 2" />
    +    
    
    +<form>
    +  <input id="target" type="text" value="Field 1">
    +  <input type="text" value="Field 2">
     </form>
     <div id="other">
       Trigger the handler
     </div>
    -
    +

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

    -
    $('#target').focus(function() {
    -  alert('Handler for .focus() called.');
    -});
    +
    
    +$( "#target" ).focus(function() {
    +  alert( "Handler for .focus() called." );
    +});
    +    

    Now clicking on the first field, or tabbing to it from another field, displays the alert:

    Handler for .focus() called.

    We can trigger the event when another element is clicked:

    -
    $('#other').click(function() {
    -  $('#target').focus();
    -});
    +
    
    +$( "#other" ).click(function() {
    +  $( "#target" ).focus();
    +});
    +    

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

    -

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

    +

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

    Fire focus. - + - + To stop people from writing in text input boxes, try: - + To focus on a login input box with id 'login' on page startup, try: - + diff --git a/entries/focusin.xml b/entries/focusin.xml index db621ebf..dca9e850 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -24,14 +24,20 @@ Watch for a focus to occur within the paragraphs on the page. - + - + diff --git a/entries/focusout.xml b/entries/focusout.xml index 47d08d77..ecd6c6fd 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -18,37 +18,42 @@ -

    This method is a shortcut for .on('focusout', handler) when passed arguments, and .trigger('focusout') when no arguments are passed.

    -

    The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

    -

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

    +

    This method is a shortcut for .on( "focusout", handler ) when passed arguments, and .trigger( "focusout" ) when no arguments are passed.

    +

    The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

    +

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

    Watch for a loss of focus to occur inside paragraphs and note the difference between the focusout count and the blur count. (The blur count does not change because those events do not bubble.) +
    console.log( $( "li" )[ 0 ] );

    However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:

    -
    console.log( $( "li" ).get(-1) );
    +
    console.log( $( "li" ).get( -1 ) );

    A negative index is counted from the end of the matched set, so this example returns the last item in the list:

    <li id="bar"> @@ -37,20 +37,25 @@ Display the tag name of the click element. +]]> - + span { + color: red; + } + div { + background: yellow; + } +]]> + @@ -64,10 +69,10 @@

    Consider a simple unordered list:

    
    -  <ul>
    -    <li id="foo">foo</li>
    -    <li id="bar">bar</li>
    -  </ul>
    +<ul>
    +  <li id="foo">foo</li>
    +  <li id="bar">bar</li>
    +</ul>
           

    Without a parameter, .get() returns an array of all of the elements:

    console.log( $( "li" ).get() );
    @@ -79,25 +84,29 @@ Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. + $( "span" ).text( a.join(" ") ); +} +disp( $( "div" ).get().reverse() ); +]]> - + +
    One
    +
    Two
    +
    Three
    +]]>
    - \ No newline at end of file + diff --git a/entries/gt-selector.xml b/entries/gt-selector.xml index 628c48f7..b4a44f50 100644 --- a/entries/gt-selector.xml +++ b/entries/gt-selector.xml @@ -21,7 +21,7 @@ index-related selectors

    The index-related selector expressions (including this "greater than" selector) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

    -

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:gt(1)') selects elements after the second element in the document with the class myclass, rather than after the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    +

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:gt(1)" ) selects elements after the second element in the document with the class myclass, rather than after the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    Prior to jQuery 1.8, the :gt(index) selector did not accept a negative value for index

    @@ -36,7 +36,8 @@ $( "td:gt(-2)" ).css( "color", "red" );
    -
    TD #0TD #1TD #2
    TD #3TD #4TD #5
    TD #6TD #7TD #8
    ]]> + +]]> diff --git a/entries/has-attribute-selector.xml b/entries/has-attribute-selector.xml index 8c6a5bba..facceca4 100644 --- a/entries/has-attribute-selector.xml +++ b/entries/has-attribute-selector.xml @@ -13,17 +13,18 @@ Bind a single click that adds the div id to its text. - + - \ No newline at end of file + diff --git a/entries/has-selector.xml b/entries/has-selector.xml index 73b8557a..5d514b95 100644 --- a/entries/has-selector.xml +++ b/entries/has-selector.xml @@ -10,20 +10,25 @@ Selects elements which contain at least one element that matches the specified selector. -

    The expression $('div:has(p)') matches a <div> if a <p> exists anywhere among its descendants, not just as a direct child.

    +

    The expression $( "div:has(p)" ) matches a <div> if a <p> exists anywhere among its descendants, not just as a direct child.

    - + Adds the class "test" to all divs that have a paragraph inside of them. - - + + + .test { + border: 3px inset red; + } +]]> - \ No newline at end of file + diff --git a/entries/has.xml b/entries/has.xml index ed31dbcc..072bc92a 100644 --- a/entries/has.xml +++ b/entries/has.xml @@ -31,17 +31,21 @@ </ul>

    We can apply this method to the set of list items as follows:

    -
    $('li').has('ul').css('background-color', 'red');
    +
    
    +$( "li" ).has( "ul" ).css( "background-color", "red" );
    +    

    The result of this call is a red background for item 2, as it is the only <li> that has a <ul> among its descendants.

    Check if an element is inside another. + p { + margin: 8px; + font-size:16px; + } + .selected { + color:red; + } +]]> +

    This paragraph is black and is the first paragraph.

    +

    This paragraph is red and is the second paragraph.

    +
    First paragraph has selected class:
    +
    Second paragraph has selected class:
    +
    At least one paragraph has selected class:
    +]]>
    - \ No newline at end of file + diff --git a/entries/header-selector.xml b/entries/header-selector.xml index d8db55d9..f3b6da8b 100644 --- a/entries/header-selector.xml +++ b/entries/header-selector.xml @@ -10,18 +10,26 @@ Adds a background and text color to all the headers on the page. - - + + - \ No newline at end of file + diff --git a/entries/height.xml b/entries/height.xml index 228fac4d..70cdf5b9 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -8,14 +8,16 @@ Get the current computed height for the first element in the set of matched elements. -

    The difference between .css('height') and .height() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .height() method is recommended when an element's height needs to be used in a mathematical calculation.

    +

    The difference between .css( "height" ) and .height() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .height() method is recommended when an element's height needs to be used in a mathematical calculation.

    This method is also able to find the height of the window and document.

    -
    $(window).height();   // returns height of browser viewport
    -$(document).height(); // returns height of HTML document
    -

    Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS height plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css("height") rather than .height().

    +
    
    +$( window ).height();   // returns height of browser viewport
    +$( document ).height(); // returns height of HTML document
    +      
    +

    Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS height plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "height" ) rather than .height().

    Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

    @@ -23,35 +25,46 @@ $(document).height(); // returns height of HTML document
    Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. - + +
     
    +

    + Sample paragraph to test height +

    +]]>
    @@ -82,18 +95,31 @@ $(document).height(); // returns height of HTML document
    To set the height of each div on click to 30px plus a color change. - - - + + + diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index 786662d2..44f9fb61 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -17,42 +17,55 @@

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    -

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $(elem).css('visibility','hidden').is(':hidden') == false). The release notes outline the changes in more detail.

    +

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    Shows all hidden divs and counts hidden inputs. - + + +]]> -
    \ No newline at end of file + diff --git a/entries/hide.xml b/entries/hide.xml index 10e03189..0369af71 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -30,23 +30,25 @@

    With no parameters, the .hide() method is the simplest way to hide an element:

    $('.target').hide();
         
    -

    The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css('display', 'none'), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline and is hidden then shown, it will once again be displayed inline.

    +

    The matched elements will be hidden immediately, with no animation. This is roughly equivalent to calling .css( "display", "none" ), except that the value of the display property is saved in jQuery's data cache so that display can later be restored to its initial value. If an element has a display value of inline and is hidden then shown, it will once again be displayed inline.

    When a duration, a plain object, or a "complete" function is provided, .hide() becomes an animation method. The .hide() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0, the display style property is set to none to ensure that the element no longer affects the layout of the page.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    Note that .hide() is fired immediately and will override the animation queue if no duration or a duration of 0 is specified.

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123">
     With the element initially shown, we can hide it slowly:
    -$('#clickme').click(function() {
    -  $('#book').hide('slow', function() {
    -    alert('Animation complete.');
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).hide( "slow", function() {
    +    alert( "Animation complete." );
       });
    -});
    +}); +

    @@ -58,74 +60,91 @@ $('#clickme').click(function() { Hides all paragraphs then the link on click. - + Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds. - + p { + background: #dad; + font-weight:bold; + } +]]> + 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. - + + +]]> Hides the divs when clicked over 2 seconds, then removes the div element when its hidden. Try clicking on more than one box at a time. - + div { + background: #ece023; + width: 30px; + height: 40px; + margin: 2px; + float: left; + } +]]> + diff --git a/entries/hover.xml b/entries/hover.xml index 13e81c7e..cbe7449a 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -15,53 +15,67 @@

    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);
    -

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

    +

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

    +
    
    +$( selector ).mouseenter( handlerIn ).mouseleave( handlerOut );
    +      
    +

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

    To add a special style to list items that are being hovered over, try: - + To add a special style to table cells that are being hovered over, try: - +); +]]> To unbind the above example use: - + @@ -77,38 +91,51 @@ $("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});

    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.

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

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

    Slide the next sibling LI up or down on hover, and toggle a class. - + ul { + margin-left: 20px; + color: blue; + } + li { + cursor: default; + } + li.active { + background: black; + color: white; + } + span { + color:red; + } +]]> + diff --git a/entries/html.xml b/entries/html.xml index 43b68a3e..fa8ce0b5 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -10,38 +10,54 @@

    This method is not available on XML documents.

    In an HTML document, .html() can be used to get the contents of any element. If the selector expression matches more than one element, only the first match will have its HTML content returned. Consider this code:

    -
    $('div.demo-container').html();
    +
    
    +$( "div.demo-container" ).html();
    +      

    In order for the following <div>'s content to be retrieved, it would have to be the first one with class="demo-container" in the document:

    -
    <div class="demo-container">
    +      
    
    +<div class="demo-container">
       <div class="demo-box">Demonstration Box</div>
    -  </div>
    +</div> +

    The result would look like this:

    -
    <div class="demo-box">Demonstration Box</div>
    +
    
    +<div class="demo-box">Demonstration Box</div>
    +      

    This method uses the browser's innerHTML property. Some browsers may not return HTML that exactly replicates the HTML source in an original document. For example, Internet Explorer sometimes leaves off the quotes around attribute values if they contain only alphanumeric characters.

    Click a paragraph to convert it from html to text. - + p { + margin: 8px; + font-size: 20px; + color: blue; + cursor: pointer; + } + b { + text-decoration: underline; + } + button { + cursor: pointer; + } +]]> + @@ -74,49 +90,69 @@ $("p").click(function () { handlers from child elements before replacing those elements with the new content.

    Consider the following HTML:

    -
    <div class="demo-container">
    +      
    
    +<div class="demo-container">
       <div class="demo-box">Demonstration Box</div>
    -</div>
    +</div> +

    The content of <div class="demo-container"> can be set like this:

    -
    $('div.demo-container')
    -  .html('<p>All new content. <em>You bet!</em></p>');
    +
    
    +$( "div.demo-container" )
    +  .html( "<p>All new content. <em>You bet!</em></p>" );
    +      

    That line of code will replace everything inside <div class="demo-container">:

    -
    <div class="demo-container">
    +      
    
    +<div class="demo-container">
       <p>All new content. <em>You bet!</em></p>
    -</div>
    +</div> +

    As of jQuery 1.4, the .html() method allows the HTML content to be set by passing in a function.

    -
    $('div.demo-container').html(function() {
    -  var emph = '<em>' + $('p').length + ' paragraphs!</em>';
    -  return '<p>All new content for ' + emph + '</p>';
    -});
    +
    
    +$( "div.demo-container" ).html(function() {
    +  var emph = "<em>" + $( "p" ).length + " paragraphs!</em>";
    +  return "<p>All new content for " + emph + "</p>";
    +});
    +      

    Given a document with six paragraphs, this example will set the HTML of <div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.

    This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

    -

    Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html(string) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

    +

    Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

    Add some html to each div. - + - + .red { + color: red; + } +]]> + Add some html to each div then immediately do further manipulations to the inserted html. - + div { + color: blue; + font-size: 18px; + } +]]> + diff --git a/entries/id-selector.xml b/entries/id-selector.xml index b42cd76a..0bff7166 100644 --- a/entries/id-selector.xml +++ b/entries/id-selector.xml @@ -18,40 +18,42 @@ Select the element with the id "myDiv" and give it a red border. - + +]]> Select the element with the id "myID.entry[1]" and give it a red border. Note how certain characters must be escaped with backslashes. - id="myID.entry[0]" - -
    id="myID.entry[1]"
    -
    id="myID.entry[2]"
    ]]> + id="myID.entry[0]" +
    id="myID.entry[1]"
    +
    id="myID.entry[2]"
    +]]> +]]>
    diff --git a/entries/image-selector.xml b/entries/image-selector.xml index 28dc1e47..03036c31 100644 --- a/entries/image-selector.xml +++ b/entries/image-selector.xml @@ -13,37 +13,44 @@ Finds all image inputs. - + +
    +]]>
    - \ No newline at end of file + diff --git a/entries/index.xml b/entries/index.xml index 74fff3ac..c099e9b7 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -32,45 +32,47 @@ <li id="bar">bar</li> <li id="baz">baz</li> </ul> -
    +

    If we retrieve one of the three list items (for example, through a DOM function or as the context to an event handler), .index() can search for this list item within the set of matched elements:

    
    -var listItem = document.getElementById('bar');
    -alert('Index: ' + $('li').index(listItem));
    -We get back the zero-based position of the list item:
    -
    +var listItem = document.getElementById( "bar" ); +alert( "Index: " + $( "li" ).index( listItem ) ); +
    +

    We get back the zero-based position of the list item:

    Index: 1

    Similarly, if we retrieve a jQuery object consisting of one of the three list items, .index() will search for that list item:

    
    -var listItem = $('#bar');
    -alert('Index: ' + $('li').index(listItem));
    -
    +var listItem = $( "#bar" ); +alert( "Index: " + $( "li" ).index( listItem ) ); +

    We get back the zero-based position of the list item:

    Index: 1

    Note that if the jQuery collection used as the .index() method's argument contains more than one element, the first element within the matched set of elements will be used.

    
    -var listItems = $('li:gt(0)');
    -alert('Index: ' + $('li').index(listItems));
    -
    +var listItems = $( "li:gt(0)" ); +alert( "Index: " + $( "li" ).index( listItems ) ); +

    We get back the zero-based position of the first list item within the matched set:

    Index: 1

    If we use a string as the .index() method's argument, it is interpreted as a jQuery selector string. The first element among the object's matched elements which also matches this selector is located.

    
    -var listItem = $('#bar');
    -alert('Index: ' + listItem.index('li'));
    -
    +var listItem = $( "#bar" ); +alert( "Index: " + listItem.index( "li" ) ); +

    We get back the zero-based position of the list item:

    Index: 1

    If we omit the argument, .index() will return the position of the first element within the set of matched elements in relation to its siblings:

    -
    alert('Index: ' + $('#bar').index());
    +
    
    +alert( "Index: " + $( "#bar" ).index() );
    +    

    Again, we get back the zero-based position of the list item:

    Index: 1 @@ -79,80 +81,131 @@ alert('Index: ' + listItem.index('li')); On click, returns the index (based zero) of that div in the page. - +

    Third div
    +]]> Returns the index for the element with ID bar. - div { font-weight: bold; color: #090; } - - + + +
    +]]>
    Returns the index for the first item in the jQuery collection. - div { font-weight: bold; color: #090; } - + - +
    +]]>
    Returns the index for the element with ID bar in relation to all <li> elements. - div { font-weight: bold; color: #090; } - - + + +
    +]]>
    Returns the index for the element with ID bar in relation to its siblings. - div { font-weight: bold; color: #090; } - - + + +
    +]]>
    Returns -1, as there is no element with ID foobar. - div { font-weight: bold; color: #090; } - - + + +
    +]]>
    diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index 497015f0..f3596f4b 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -7,20 +7,31 @@ Get the current computed height for the first element in the set of matched elements, including padding but not border.

    This method returns the height of the element, including top and bottom padding, in pixels.

    -

    This method is not applicable to window and document objects; for these, use .height() instead.

    +

    This method is not applicable to window and document objects; for these, use .height() instead.

    Get the innerHeight of a paragraph. - - - + + + - \ No newline at end of file + diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index c2561360..0a438e80 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -7,20 +7,31 @@ Get the current computed width for the first element in the set of matched elements, including padding but not border.

    This method returns the width of the element, including left and right padding, in pixels.

    -

    This method is not applicable to window and document objects; for these, use .width() instead.

    +

    This method is not applicable to window and document objects; for these, use .width() instead.

    Get the innerWidth of a paragraph. - - - + + + - \ No newline at end of file + diff --git a/entries/input-selector.xml b/entries/input-selector.xml index 069949e9..281242b4 100644 --- a/entries/input-selector.xml +++ b/entries/input-selector.xml @@ -13,41 +13,43 @@ Finds all input elements. - + - \ No newline at end of file + diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml index b453e844..b5f23ac0 100644 --- a/entries/insertAfter.xml +++ b/entries/insertAfter.xml @@ -14,41 +14,58 @@ Insert every element in the set of matched elements after the target. -

    The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

    +

    The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    We can create content and insert it after several elements at once:

    -
    $('<p>Test</p>').insertAfter('.inner');
    +
    
    +$( "<p>Test</p>" ).insertAfter( ".inner" );
    +    

    Each inner <div> element gets this new content:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <div class="inner">Hello</div>
       <p>Test</p>
       <div class="inner">Goodbye</div>
       <p>Test</p>
    -</div>
    +</div> +

    We can also select an element on the page and insert it after another:

    -
    $('h2').insertAfter($('.container'));
    +
    
    +$( "h2" ).insertAfter( $( ".container" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved after the target (not cloned) and a new set consisting of the inserted element is returned:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
     </div>
    -<h2>Greetings</h2>
    +<h2>Greetings</h2> +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

    - Insert all paragraphs after an element with id of "foo". Same as $("#foo").after("p") + Insert all paragraphs after an element with id of "foo". Same as $( "#foo" ).after( "p" ) - - + + diff --git a/entries/insertBefore.xml b/entries/insertBefore.xml index be992727..8ecd0b81 100644 --- a/entries/insertBefore.xml +++ b/entries/insertBefore.xml @@ -14,41 +14,57 @@ Insert every element in the set of matched elements before the target. -

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    +

    The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    We can create content and insert it before several elements at once:

    -
    $('<p>Test</p>').insertBefore('.inner');
    +
    
    +$( "<p>Test</p>" ).insertBefore( ".inner" );
    +    

    Each inner <div> element gets this new content:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <p>Test</p>
       <div class="inner">Hello</div>
       <p>Test</p>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    We can also select an element on the page and insert it before another:

    -
    $('h2').insertBefore($('.container'));
    +
    
    +$( "h2" ).insertBefore( $( ".container" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved before the target (not cloned) and a new set consisting of the inserted element is returned:

    <h2>Greetings</h2>
     <div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, 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.

    - Insert all paragraphs before an element with id of "foo". Same as $("#foo").before("p") + Insert all paragraphs before an element with id of "foo". Same as $( "#foo" ).before( "p" ) - - + + diff --git a/entries/is.xml b/entries/is.xml index f502f00d..1848b87f 100644 --- a/entries/is.xml +++ b/entries/is.xml @@ -35,18 +35,19 @@ <li><span>list item 2</span></li> <li>list item 3</li> </ul> -
    +

    You can attach a click handler to the <ul> element, and then limit the code to be triggered only when a list item itself, not one of its children, is clicked:

    -
    $("ul").click(function(event) {
    -  var $target = $(event.target);
    -  if ( $target.is("li") ) {
    -    $target.css("background-color", "red");
    +    
    
    +$( "ul" ).click(function( event ) {
    +  var $target = $( event.target );
    +  if ( $target.is( "li" ) ) {
    +    $target.css( "background-color", "red" );
       }
    -});
    -

    Now, when the user clicks on the word "list" in the first item or anywhere in the third item, the clicked list item will be given a red background. However, when the user clicks on item 1 in the first item or anywhere in the second item, nothing will occur, because in those cases the target of the event would be <strong> or <span>, respectively. -

    -

    Prior to jQuery 1.7, in selector strings with positional selectors such as :first, :gt(), or :even, the positional filtering is done against the jQuery object passed to .is(), not against the containing document. So for the HTML shown above, an expression such as $("li:first").is("li:last") returns true, but $("li:first-child").is("li:last-child") returns false. In addition, a bug in Sizzle prevented many positional selectors from working properly. These two factors made positional selectors almost unusable in filters.

    -

    Starting with jQuery 1.7, selector strings with positional selectors apply the selector against the document, and then determine whether the first element of the current jQuery set matches any of the resulting elements. So for the HTML shown above, an expression such as $("li:first").is("li:last") returns false. Note that since positional selectors are jQuery additions and not W3C standard, we recommend using the W3C selectors whenever feasible.

    +}); +
    +

    Now, when the user clicks on the word "list" in the first item or anywhere in the third item, the clicked list item will be given a red background. However, when the user clicks on item 1 in the first item or anywhere in the second item, nothing will occur, because in those cases the target of the event would be <strong> or <span>, respectively.

    +

    Prior to jQuery 1.7, in selector strings with positional selectors such as :first, :gt(), or :even, the positional filtering is done against the jQuery object passed to .is(), not against the containing document. So for the HTML shown above, an expression such as $( "li:first" ).is( "li:last" ) returns true, but $( "li:first-child" ).is( "li:last-child" ) returns false. In addition, a bug in Sizzle prevented many positional selectors from working properly. These two factors made positional selectors almost unusable in filters.

    +

    Starting with jQuery 1.7, selector strings with positional selectors apply the selector against the document, and then determine whether the first element of the current jQuery set matches any of the resulting elements. So for the HTML shown above, an expression such as $( "li:first" ).is( "li:last" ) returns false. Note that since positional selectors are jQuery additions and not W3C standard, we recommend using the W3C selectors whenever feasible.

    Using a Function

    The second form of this method evaluates expressions related to elements based on a function rather than a selector. For each element, if the function returns true, .is() returns true as well. For example, given a somewhat more involved HTML snippet:

    
    @@ -58,120 +59,171 @@
       <li>list item 4</li>
       <li>list item 5</li>
     </ul>
    -
    +

    You can attach a click handler to every <li> that evaluates the number of <strong> elements within the clicked <li> at that time like so:

    
    -$("li").click(function() {
    -  var $li = $(this),
    +$( "li" ).click(function() {
    +  var $li = $( this ),
         isWithTwo = $li.is(function() {
    -      return $('strong', this).length === 2;
    +      return $( "strong", this ).length === 2;
         });
       if ( isWithTwo ) {
    -    $li.css("background-color", "green");
    +    $li.css( "background-color", "green" );
       } else {
    -    $li.css("background-color", "red");
    +    $li.css( "background-color", "red" );
       }
     });
    -
    +
    Shows a few ways is() can be used inside an event handler. - +

     

    +]]>
    Returns true, because the parent of the input is a form element. - - + + Returns false, because the parent of the input is a p element. - - + + Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. - + + +]]> An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. - + + +]]> diff --git a/entries/jQuery.Callbacks.xml b/entries/jQuery.Callbacks.xml index 84142ba2..4185b962 100644 --- a/entries/jQuery.Callbacks.xml +++ b/entries/jQuery.Callbacks.xml @@ -15,27 +15,27 @@

    The following are two sample methods named fn1 and fn2:

    
     function fn1( value ) {
    -    console.log( value );
    +  console.log( value );
     }
     
     function fn2( value ) {
    -    console.log("fn2 says: " + value);
    -    return false;
    +  console.log( "fn2 says: " + value );
    +  return false;
     }
    -
    +

    These can be added as callbacks to a $.Callbacks list and invoked as follows:

    
     var callbacks = $.Callbacks();
     callbacks.add( fn1 );
     
    -// outputs: foo!
    +// Outputs: foo!
     callbacks.fire( "foo!" );
     
     callbacks.add( fn2 );
     
    -// outputs: bar!, fn2 says: bar!
    +// Outputs: bar!, fn2 says: bar!
     callbacks.fire( "bar!" );
    -
    +

    The result of this is that it becomes simple to construct complex lists of callbacks where input values can be passed through to as many functions as needed with ease.

    Two specific methods were being used above: .add() and .fire(). The .add() method supports adding new callbacks to the callback list, while the .fire() method executes the added functions and provides a way to pass arguments to be processed by the callbacks in the same list.

    Another method supported by $.Callbacks is .remove(), which has the ability to remove a particular callback from the callback list. Here"s a practical example of .remove() being used:

    @@ -43,19 +43,19 @@ callbacks.fire( "bar!" ); var callbacks = $.Callbacks(); callbacks.add( fn1 ); -// outputs: foo! +// Outputs: foo! callbacks.fire( "foo!" ); callbacks.add( fn2 ); -// outputs: bar!, fn2 says: bar! +// Outputs: bar!, fn2 says: bar! callbacks.fire( "bar!" ); callbacks.remove( fn2 ); -// only outputs foobar, as fn2 has been removed. +// Only outputs foobar, as fn2 has been removed. callbacks.fire( "foobar" ); -
    +

    Supported Flags

    The flags argument is an optional argument to $.Callbacks(), structured as a list of space-separated strings that change how the callback list behaves (eg. $.Callbacks( "unique stopOnFalse" )).

    Possible flags:

    @@ -81,9 +81,10 @@ callbacks.fire( "foobar" ); output: foo */ -
    +

    $.Callbacks( "memory" ):

    -
    var callbacks = $.Callbacks( "memory" );
    +    
    
    +var callbacks = $.Callbacks( "memory" );
     callbacks.add( fn1 );
     callbacks.fire( "foo" );
     callbacks.add( fn2 );
    @@ -99,9 +100,10 @@ bar
     fn2 says:bar
     foobar
     */
    -
    +

    $.Callbacks( "unique" ):

    -
    var callbacks = $.Callbacks( "unique" );
    +    
    
    +var callbacks = $.Callbacks( "unique" );
     callbacks.add( fn1 );
     callbacks.fire( "foo" );
     callbacks.add( fn1 ); // repeat addition
    @@ -117,17 +119,17 @@ bar
     fn2 says:bar
     foobar
     */
    -
    +

    $.Callbacks( "stopOnFalse" ):

    
     function fn1( value ){
    -    console.log( value );
    -    return false;
    +  console.log( value );
    +  return false;
     }
     
     function fn2( value ){
    -    fn1( "fn2 says: " + value );
    -    return false;
    +  fn1( "fn2 says: " + value );
    +  return false;
     }
     
     var callbacks = $.Callbacks( "stopOnFalse" );
    @@ -144,18 +146,18 @@ foo
     bar
     foobar
     */
    -
    +

    Because $.Callbacks() supports a list of flags rather than just one, setting several flags has a cumulative effect similar to "&&". This means it's possible to combine flags to create callback lists that, say, both are unique and ensure if list was already fired, adding more callbacks will have it called with the latest fired value (i.e. $.Callbacks("unique memory")).

    $.Callbacks( 'unique memory' ):

    
     function fn1( value ) {
    -    console.log( value );
    -    return false;
    +  console.log( value );
    +  return false;
     }
     
     function fn2( value ) {
    -    fn1( "fn2 says: " + value );
    -    return false;
    +  fn1( "fn2 says: " + value );
    +  return false;
     }
     
     var callbacks = $.Callbacks( "unique memory" );
    @@ -184,40 +186,42 @@ foobar
         

    The methods of $.Callbacks can also be detached, should there be a need to define short-hand versions for convenience:

    
     var callbacks = $.Callbacks(),
    -    add = callbacks.add,
    -    remove = callbacks.remove,
    -    fire = callbacks.fire;
    +  add = callbacks.add,
    +  remove = callbacks.remove,
    +  fire = callbacks.fire;
     
     add( fn1 );
     fire( "hello world" );
     remove( fn1 );
    -
    +

    $.Callbacks, $.Deferred and Pub/Sub

    The general idea behind pub/sub (Publish/Subscribe, or, the Observer pattern) is the promotion of loose coupling in applications. Rather than single objects calling on the methods of other objects, an object instead subscribes to a specific task or activity of another object and is notified when it occurs. Observers are also called Subscribers, and we refer to the object being observed as the Publisher (or the subject). Publishers notify subscribers when events occur.

    To demonstrate the component-creation capabilities of $.Callbacks(), it's possible to implement a Pub/Sub system using only callback lists. Using $.Callbacks as a topics queue, a system for publishing and subscribing to topics can be implemented as follows:

    -
    var topics = {};
    +    
    
    +var topics = {};
     
     jQuery.Topic = function( id ) {
    -    var callbacks,
    -        method,
    -        topic = id && topics[ id ];
    +  var callbacks,
    +    method,
    +    topic = id && topics[ id ];
     
    -    if ( !topic ) {
    -        callbacks = jQuery.Callbacks();
    -        topic = {
    -            publish: callbacks.fire,
    -            subscribe: callbacks.add,
    -            unsubscribe: callbacks.remove
    -        };
    -        if ( id ) {
    -            topics[ id ] = topic;
    -        }
    +  if ( !topic ) {
    +    callbacks = jQuery.Callbacks();
    +    topic = {
    +      publish: callbacks.fire,
    +      subscribe: callbacks.add,
    +      unsubscribe: callbacks.remove
    +    };
    +    if ( id ) {
    +      topics[ id ] = topic;
         }
    -    return topic;
    +  }
    +  return topic;
     };
    -
    +

    This can then be used by parts of your application to publish and subscribe to events of interest quite easily:

    -
    // Subscribers
    +    
    
    +// Subscribers
     $.Topic( "mailArrived" ).subscribe( fn1 );
     $.Topic( "mailArrived" ).subscribe( fn2 );
     $.Topic( "mailSent" ).subscribe( fn1 );
    @@ -237,18 +241,19 @@ hello world!
     fn2 says: hello world!
     woo! mail!
     */
    -
    +

    While this is useful, the implementation can be taken further. Using $.Deferreds, it's possible to ensure publishers only publish notifications for subscribers once particular tasks have been completed (resolved). See the below code sample for some further comments on how this could be used in practice:

    -
    // subscribe to the mailArrived notification
    +    
    
    +// Subscribe to the mailArrived notification
     $.Topic( "mailArrived" ).subscribe( fn1 );
     
    -// create a new instance of Deferreds
    +// Create a new instance of Deferreds
     var dfd = $.Deferred();
     
    -// define a new topic (without directly publishing)
    +// Define a new topic (without directly publishing)
     var topic = $.Topic( "mailArrived" );
     
    -// when the deferred has been resolved, publish a
    +// When the deferred has been resolved, publish a
     // notification to subscribers
     dfd.done( topic.publish );
     
    @@ -259,7 +264,7 @@ dfd.done( topic.publish );
     // messages are only published once the task has actually
     // finished.
     dfd.resolve( "it's been published!" );
    -
    +
    diff --git a/entries/jQuery.Deferred.xml b/entries/jQuery.Deferred.xml index 3b888503..5bf4ca60 100644 --- a/entries/jQuery.Deferred.xml +++ b/entries/jQuery.Deferred.xml @@ -17,15 +17,15 @@ A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.

    The jQuery.Deferred() constructor creates a new Deferred object. The new operator is optional.

    -

    The jQuery.Deferred method can be passed an optional function, which is called just before the constructor returns and is passed the constructed deferred object as both the this object and as the first argument to the function. The called function can attach callbacks using deferred.then(), for example.

    -

    A Deferred object starts in the pending state. Any callbacks added to the object with deferred.then(), deferred.always(), deferred.done(), or deferred.fail() are queued to be executed later. Calling deferred.resolve() or deferred.resolveWith() transitions the Deferred into the resolved state and immediately executes any doneCallbacks that are set. Calling deferred.reject() or deferred.rejectWith() transitions the Deferred into the rejected state and immediately executes any failCallbacks that are set. Once the object has entered the resolved or rejected state, it stays in that state. Callbacks can still be added to the resolved or rejected Deferred — they will execute immediately.

    +

    The jQuery.Deferred method can be passed an optional function, which is called just before the constructor returns and is passed the constructed deferred object as both the this object and as the first argument to the function. The called function can attach callbacks using deferred.then(), for example.

    +

    A Deferred object starts in the pending state. Any callbacks added to the object with deferred.then(), deferred.always(), deferred.done(), or deferred.fail() are queued to be executed later. Calling deferred.resolve() or deferred.resolveWith() transitions the Deferred into the resolved state and immediately executes any doneCallbacks that are set. Calling deferred.reject() or deferred.rejectWith() transitions the Deferred into the rejected state and immediately executes any failCallbacks that are set. Once the object has entered the resolved or rejected state, it stays in that state. Callbacks can still be added to the resolved or rejected Deferred — they will execute immediately.

    Enhanced Callbacks with jQuery Deferred

    In JavaScript it is common to invoke functions that optionally accept callbacks that are called within that function. For example, in versions prior to jQuery 1.5, asynchronous processes such as jQuery.ajax() accept callbacks to be invoked some time in the near-future upon success, error, and completion of the ajax request.

    jQuery.Deferred() introduces several enhancements to the way callbacks are managed and invoked. In particular, jQuery.Deferred() provides flexible ways to provide multiple callbacks, and these callbacks can be invoked regardless of whether the original callback dispatch has already occurred. jQuery Deferred is based on the CommonJS Promises/A design.

    -

    One model for understanding Deferred is to think of it as a chain-aware function wrapper. The deferred.then(), deferred.always(), deferred.done(), and deferred.fail() methods specify the functions to be called and the deferred.resolve(args) or deferred.reject(args) methods "call" the functions with the arguments you supply. Once the Deferred has been resolved or rejected it stays in that state; a second call to deferred.resolve(), for example, is ignored. If more functions are added by deferred.then(), for example, after the Deferred is resolved, they are called immediately with the arguments previously provided.

    -

    In most cases where a jQuery API call returns a Deferred or Deferred-compatible object, such as jQuery.ajax() or jQuery.when(), you will only want to use the deferred.then(), deferred.done(), and deferred.fail() methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke deferred.resolve() or deferred.reject() on the deferred at some point, causing the appropriate callbacks to run.

    +

    One model for understanding Deferred is to think of it as a chain-aware function wrapper. The deferred.then(), deferred.always(), deferred.done(), and deferred.fail() methods specify the functions to be called and the deferred.resolve(args) or deferred.reject(args) methods "call" the functions with the arguments you supply. Once the Deferred has been resolved or rejected it stays in that state; a second call to deferred.resolve(), for example, is ignored. If more functions are added by deferred.then(), for example, after the Deferred is resolved, they are called immediately with the arguments previously provided.

    +

    In most cases where a jQuery API call returns a Deferred or Deferred-compatible object, such as jQuery.ajax() or jQuery.when(), you will only want to use the deferred.then(), deferred.done(), and deferred.fail() methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke deferred.resolve() or deferred.reject() on the deferred at some point, causing the appropriate callbacks to run.

    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 1e4fd9dd..fe1f8939 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -8,7 +8,7 @@ A string containing the URL to which the request is sent. - A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. @@ -19,12 +19,12 @@ The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. - By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). - A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. @@ -32,7 +32,7 @@ - A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. @@ -41,12 +41,16 @@ When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. - This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
    $.ajax({
    +        This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example,  specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
    +          
    
    +$.ajax({
       url: "test.html",
       context: document.body
     }).done(function() {
    -  $(this).addClass("done");
    -});
    + $( this ).addClass( "done" ); +}); +
    +
    An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. @@ -68,7 +72,8 @@ The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are:
    • "xml": Returns a XML document that can be processed via jQuery.
    • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
    • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • "text": A plain text string.
    • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. -
    + +
    @@ -111,13 +116,15 @@

    An object of numeric HTTP codes and functions to be called when the response has the corresponding code. For example, the following will alert when the response status is a 404:

    -
    $.ajax({
    +          
    
    +$.ajax({
       statusCode: {
         404: function() {
    -      alert("page not found");
    +      alert( "page not found" );
         }
       }
    -});
    +}); +

    If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback.

    @@ -125,13 +132,13 @@ - A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
    - Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. - Set this to true if you wish to use the traditional style of param serialization. + Set this to true if you wish to use the traditional style of param serialization. The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. @@ -148,25 +155,29 @@

    An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. -

    $.ajax({
    +            
    
    +$.ajax({
        url: a_cross_domain_url,
        xhrFields: {
           withCredentials: true
        }
    -});
    -

    In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. -

    -

    +}); +
    +

    In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. +

    +

    Perform an asynchronous HTTP (Ajax) request. -

    The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available and are easier to use. If less common options are required, though, $.ajax() can be used more flexibly.

    +

    The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available and are easier to use. If less common options are required, though, $.ajax() can be used more flexibly.

    At its simplest, the $.ajax() function can be called with no arguments:

    -
    $.ajax();
    -

    Note: Default settings can be set globally by using the $.ajaxSetup() function.

    +
    
    +$.ajax();
    +    
    +

    Note: Default settings can be set globally by using the $.ajaxSetup() function.

    This example, using no options, loads the contents of the current page, but does nothing with the result. To use the result, you can implement one of the callback functions.

    The jqXHR Object

    The jQuery XMLHttpRequest (jqXHR) object returned by $.ajax() as of jQuery 1.5 is a superset of the browser's native XMLHttpRequest object. For example, it contains responseText and responseXML properties, as well as a getResponseHeader() method. When the transport mechanism is something other than XMLHttpRequest (for example, a script tag for a JSONP request) the jqXHR object simulates native XHR functionality where possible.

    @@ -174,33 +185,34 @@
    
     $.ajax({
       url: "http://fiddle.jshell.net/favicon.png",
    -  beforeSend: function ( xhr ) {
    -    xhr.overrideMimeType("text/plain; charset=x-user-defined");
    -  }
    -}).done(function ( data ) {
    -  if( console && console.log ) {
    -    console.log("Sample of data:", data.slice(0, 100));
    +  beforeSend: function( xhr ) {
    +    xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
       }
    -});
    +})
    +  .done(function( data ) {
    +    if( console && console.log ) {
    +      console.log( "Sample of data:", data.slice( 0, 100 ) );
    +    }
    +  });
     
    -

    The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). These methods take one or more function arguments that are called when the $.ajax() request terminates. This allows you to assign multiple callbacks on a single request, and even to assign callbacks after the request may have completed. (If the request is already complete, the callback is fired immediately.) Available Promise methods of the jqXHR object include:

    +

    The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). These methods take one or more function arguments that are called when the $.ajax() request terminates. This allows you to assign multiple callbacks on a single request, and even to assign callbacks after the request may have completed. (If the request is already complete, the callback is fired immediately.) Available Promise methods of the jqXHR object include:

    • - jqXHR.done(function(data, textStatus, jqXHR) {}); + jqXHR.done(function( data, textStatus, jqXHR ) {});

      An alternative construct to the success callback option, the .done() method replaces the deprecated jqXHR.success() method. Refer to deferred.done() for implementation details.

    • - jqXHR.fail(function(jqXHR, textStatus, errorThrown) {}); + jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {});

      An alternative construct to the error callback option, the .fail() method replaces the deprecated .error() method. Refer to deferred.fail() for implementation details.

    • - jqXHR.always(function(data|jqXHR, textStatus, jqXHR|errorThrown) { }); + jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown ) { });

      An alternative construct to the complete callback option, the .always() method replaces the deprecated .complete() method.

      In response to a successful request, the function's arguments are the same as those of .done(): data, textStatus, and the jqXHR object. For failed requests the arguments are the same as those of .fail(): the jqXHR object, textStatus, and errorThrown. Refer to deferred.always() for implementation details.

    • - jqXHR.then(function(data, textStatus, jqXHR) {}, function(jqXHR, textStatus, errorThrown) {}); + jqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ) {});

      Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.

    • @@ -208,17 +220,27 @@ $.ajax({

      Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

      -
      // Assign handlers immediately after making the request,
      +    
      
      +// Assign handlers immediately after making the request,
       // and remember the jqxhr object for this request
       var jqxhr = $.ajax( "example.php" )
      -    .done(function() { alert("success"); })
      -    .fail(function() { alert("error"); })
      -    .always(function() { alert("complete"); });
      +  .done(function() {
      +    alert( "success" );
      +})
      +  .fail(function() {
      +    alert( "error" );
      +})
      +  .always(function() {
      +    alert( "complete" );
      +});
       
       // perform other work here ...
       
       // Set another completion function for the request above
      -jqxhr.always(function() { alert("second complete"); });
      + jqxhr.always(function() { + alert( "second complete" ); +}); +

      The this reference within all callbacks is the object in the context option passed to $.ajax in the settings; if context is not specified, this is a reference to the Ajax settings themselves.

      For backward compatibility with XMLHttpRequest, a jqXHR object will expose the following properties and methods:

        @@ -249,7 +271,7 @@ jqxhr.always(function() { alert("second complete"); });

    No onreadystatechange mechanism is provided, however, since done, fail, always, and statusCode cover all conceivable requirements.

    Callback Function Queues

    The beforeSend, error, dataFilter, success and complete options all accept callback functions that are invoked at the appropriate times.

    -

    As of jQuery 1.5, the fail and done, and, as of jQuery 1.6, always callback hooks are first-in, first-out managed queues, allowing for more than one callback for each hook. See Deferred object methods, which are implemented internally for these $.ajax() callback hooks.

    +

    As of jQuery 1.5, the fail and done, and, as of jQuery 1.6, always callback hooks are first-in, first-out managed queues, allowing for more than one callback for each hook. See Deferred object methods, which are implemented internally for these $.ajax() callback hooks.

    The callback hooks provided by $.ajax() are as follows:

    1. beforeSend callback option is invoked; it receives the jqXHR object and the settings object as parameters.
    2. @@ -272,11 +294,11 @@ jqxhr.always(function() { alert("second complete"); });

    When data is retrieved from remote servers (which is only possible using the script or jsonp data types), the error callbacks and global events will never be fired.

    Sending Data to the Server

    By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.

    -

    The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

    +

    The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

    Advanced Options

    -

    The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details. See the descriptions of these methods below for more details.

    +

    The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details. See the descriptions of these methods below for more details.

    If the server performs HTTP authentication before providing a response, the user name and password pair can be sent via the username and password options.

    -

    Ajax requests are time-limited, so errors can be caught and handled to provide a better user experience. Request timeouts are usually either left at their default or set as a global default using $.ajaxSetup() rather than being overridden for specific requests with the timeout option.

    +

    Ajax requests are time-limited, so errors can be caught and handled to provide a better user experience. Request timeouts are usually either left at their default or set as a global default using $.ajaxSetup() rather than being overridden for specific requests with the timeout option.

    By default, requests are always issued, but the browser may serve results out of its cache. To disallow use of the cached results, set cache to false. To cause the request to report failure if the asset has not been modified since the last request, set ifModified to true.

    The scriptCharset allows the character set to be explicitly specified for requests that use a <script> tag (that is, a type of script or jsonp). This is useful if the script and host page have differing character sets.

    The first letter in Ajax stands for "asynchronous," meaning that the operation occurs in parallel and the order of completion is not guaranteed. The async option to $.ajax() defaults to true, indicating that code execution can continue after the request is made. Setting this option to false (and thus making the call no longer asynchronous) is strongly discouraged, as it can cause the browser to become unresponsive.

    @@ -284,15 +306,15 @@ jqxhr.always(function() { alert("second complete"); });

    At present, due to a bug in Firefox where .getAllResponseHeaders() returns the empty string although .getResponseHeader('Content-Type') returns a non-empty string, automatically decoding JSON CORS responses in Firefox with jQuery is not supported.

    A workaround to this is possible by overriding jQuery.ajaxSettings.xhr as follows:

    
    -(function () {
    +(function() {
       var _super = jQuery.ajaxSettings.xhr,
         xhrCorsHeaders = [ "Cache-Control", "Content-Language", "Content-Type", "Expires", "Last-Modified", "Pragma" ];
     
    -  jQuery.ajaxSettings.xhr = function () {
    +  jQuery.ajaxSettings.xhr = function() {
         var xhr = _super(),
           getAllResponseHeaders = xhr.getAllResponseHeaders;
     
    -    xhr.getAllResponseHeaders = function () {
    +    xhr.getAllResponseHeaders = function() {
           var allHeaders = "";
           try {
             allHeaders = getAllResponseHeaders.apply( xhr );
    @@ -302,7 +324,7 @@ jqxhr.always(function() { alert("second complete"); });
    } catch ( e ) { } - $.each( xhrCorsHeaders, function ( i, headerName ) { + $.each( xhrCorsHeaders, function( i, headerName ) { if ( xhr.getResponseHeader( headerName ) ) { allHeaders += headerName + ": " + xhr.getResponseHeader( headerName ) + "\n"; } @@ -313,7 +335,7 @@ jqxhr.always(function() { alert("second complete"); });
    return xhr; }; })(); -
    +

    Extending Ajax

    As of jQuery 1.5, jQuery's Ajax implementation includes prefilters, transports, and converters that allow you to extend Ajax with a great deal of flexibility.

    @@ -326,13 +348,13 @@ $.ajaxSetup({ mycustomtype: /mycustomtype/ }, converters: { - "mycustomtype json": function ( result ) { + "mycustomtype json": function( result ) { // do stuff return newresult; } } }); -
    +

    This extra object is necessary because the response Content-Types and data types never have a strict one-to-one correspondance (hence the regular expression).

    To convert from a supported type (e.g text, json) to a custom data type and back again, use another pass-through converter:

    
    @@ -342,73 +364,83 @@ $.ajaxSetup({
       },
       converters: {
         "text mycustomtype": true,
    -    "mycustomtype json": function ( result ) {
    +    "mycustomtype json": function( result ) {
           // do stuff
           return newresult;
         }
       }
     });
    -
    +

    The above now allows passing from text to mycustomtype and then mycustomtype to json.

    Save some data to the server and notify the user once it's complete. - +}); +]]> Retrieve the latest version of an HTML page. - + $( "#results" ).append( html ); +}); +]]> Send an xml document as data to the server. By setting the processData option to false, the automatic conversion of data to strings is prevented. - +xmlRequest.done(handleResponse); +]]> Send an id as data to the server, save some data to the server, and notify the user once it's complete. If the request fails, alert the user. - +}); +]]> Load and execute a JavaScript file. - +}); +]]> diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml index dbeef71c..02760c13 100644 --- a/entries/jQuery.ajaxPrefilter.xml +++ b/entries/jQuery.ajaxPrefilter.xml @@ -17,7 +17,7 @@ $.ajaxPrefilter( function( options, originalOptions, jqXHR ) { // Modify options, control originalOptions, store jqXHR, etc }); -
    +

    where:

    • options are the request options
    • @@ -36,7 +36,7 @@ $.ajaxPrefilter(function( options, originalOptions, jqXHR ) { currentRequests[ options.url ] = jqXHR; } }); -
    +

    Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through http://mydomain.net/proxy/:

    
     $.ajaxPrefilter( function( options ) {
    @@ -45,13 +45,13 @@ $.ajaxPrefilter( function( options ) {
         options.crossDomain = false;
       }
     });
    -
    +

    If the optional dataTypes argument is supplied, the prefilter will be only be applied to requests with the indicated dataTypes. For example, the following only applies the given prefilter to JSON and script requests:

    
     $.ajaxPrefilter( "json script", function( options, originalOptions, jqXHR ) {
       // Modify options, control originalOptions, store jqXHR, etc
     });
    -
    +

    The $.ajaxPrefilter() method can also redirect a request to another dataType by returning that dataType. For example, the following sets a request as "script" if the URL has some specific properties defined in a custom isActuallyScript() function:

    
     $.ajaxPrefilter(function( options ) {
    @@ -59,7 +59,7 @@ $.ajaxPrefilter(function( options ) {
         return "script";
       }
     });
    -
    +

    This would ensure not only that the request is considered "script" but also that all the prefilters specifically attached to the script dataType would be applied to it.

    diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml index a172687a..28e9802f 100644 --- a/entries/jQuery.ajaxSetup.xml +++ b/entries/jQuery.ajaxSetup.xml @@ -9,32 +9,37 @@ Set default values for future Ajax requests. Its use is not recommended. -

    For details on the settings available for $.ajaxSetup(), see $.ajax().

    +

    For details on the settings available for $.ajaxSetup(), see $.ajax().

    All subsequent Ajax calls using any function will use the new settings, unless overridden by the individual calls, until the next invocation of $.ajaxSetup().

    -

    Note: The settings specified here will affect all calls to $.ajax or AJAX-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

    +

    Note: The settings specified here will affect all calls to $.ajax or AJAX-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

    For example, the following sets a default for the url parameter before pinging the server repeatedly:

    -
    $.ajaxSetup({
    -  url: 'ping.php'
    -});
    +
    
    +$.ajaxSetup({
    +  url: "ping.php"
    +});
    +    

    Now each time an Ajax request is made, the "ping.php" URL will be used automatically:

    -
    $.ajax({
    +    
    
    +$.ajax({
       // url not set here; uses ping.php
    -  data: {'name': 'Dan'}
    -});
    + data: { "name": "Dan" } +}); +
    -

    Note: Global callback functions should be set with their respective global Ajax event handler methods—.ajaxStart(), .ajaxStop(), .ajaxComplete(), .ajaxError(), .ajaxSuccess(), .ajaxSend()—rather than within the options object for $.ajaxSetup().

    +

    Note: Global callback functions should be set with their respective global Ajax event handler methods—.ajaxStart(), .ajaxStop(), .ajaxComplete(), .ajaxError(), .ajaxSuccess(), .ajaxSend()—rather than within the options object for $.ajaxSetup().

    Sets the defaults for Ajax requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following Ajax requests then sends some data without having to set anything else. - + - \ No newline at end of file + diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml index bbcd2602..d0b5c9eb 100644 --- a/entries/jQuery.ajaxTransport.xml +++ b/entries/jQuery.ajaxTransport.xml @@ -20,15 +20,15 @@ $.ajaxTransport( function( options, originalOptions, jqXHR ) { if( /* transportCanHandleRequest */ ) { return { send: function( headers, completeCallback ) { - /* send code */ + // Send code }, abort: function() { - /* abort code */ + // Abort code } }; } }); - +

    where:

    +]]> - \ No newline at end of file + diff --git a/entries/password-selector.xml b/entries/password-selector.xml index 2ee175a2..8f441e4f 100644 --- a/entries/password-selector.xml +++ b/entries/password-selector.xml @@ -7,43 +7,51 @@ Selects all elements of type password. -

    $(':password') is equivalent to $('[type=password]'). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':password') is equivalent to $('*:password'), so $('input:password') should be used instead.

    +

    $( ":password" ) is equivalent to $( "[type=password]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $( ":password" ) is equivalent to $( "*:password" ), so $( "input:password" ) should be used instead.

    Finds all password inputs. - + textarea { + height: 45px; + } +]]> + - \ No newline at end of file + diff --git a/entries/position.xml b/entries/position.xml index 4b314139..129a6d19 100644 --- a/entries/position.xml +++ b/entries/position.xml @@ -15,15 +15,18 @@ Access the position of the second paragraph: + div { + padding: 15px; + } + p { + margin-left: 10px; + } +]]> -

    Since .prepend() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').prepend($newdiv1, newdiv2, existingdiv1). The type and number of arguments will largely depend on how you collect the elements in your code.

    +$( "body" ).prepend( $newdiv1, [ newdiv2, existingdiv1 ] ); + +

    Since .prepend() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "body" ).prepend( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    Prepends some HTML to all paragraphs. - - - + + + Prepends a DOM Element to all paragraphs. - - - + + + Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs. - - - + + + diff --git a/entries/prependTo.xml b/entries/prependTo.xml index b768914b..9ff9e0bc 100644 --- a/entries/prependTo.xml +++ b/entries/prependTo.xml @@ -14,17 +14,22 @@ Insert every element in the set of matched elements to the beginning of the target. -

    The .prepend() and .prependTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .prepend(), the selector expression preceding the method is the container into which the content is inserted. With .prependTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    +

    The .prepend() and .prependTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .prepend(), the selector expression preceding the method is the container into which the content is inserted. With .prependTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    We can create content and insert it into several elements at once:

    -
    $('<p>Test</p>').prependTo('.inner');
    +
    
    +$( "<p>Test</p>" ).prependTo( ".inner" );
    +    

    Each inner <div> element gets this new content:

    -
    <h2>Greetings</h2>
    +    
    
    +<h2>Greetings</h2>
     <div class="container">
       <div class="inner">
         <p>Test</p>
    @@ -34,26 +39,36 @@
         <p>Test</p>
         Goodbye
       </div>
    -</div>
    +</div> +

    We can also select an element on the page and insert it into another:

    -
    $('h2').prependTo($('.container'));
    +
    
    +$( "h2" ).prependTo( $( ".container" ) );
    +    

    If an element selected this way is inserted into a single location elsewhere in the DOM, it will be moved into the target (not cloned):

    -
    <div class="container">
    +    
    
    +<div class="container">
       <h2>Greetings</h2>
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    Prepend all spans to the element with the ID "foo" (Check .prepend() documentation for more examples) - + - + diff --git a/entries/prev.xml b/entries/prev.xml index 107e18d8..bfa4fa2f 100644 --- a/entries/prev.xml +++ b/entries/prev.xml @@ -14,58 +14,72 @@

    Consider a page with a simple list on it:

    
     <ul>
    -   <li>list item 1</li>
    -   <li>list item 2</li>
    -   <li class="third-item">list item 3</li>
    -   <li>list item 4</li>
    -   <li>list item 5</li>
    +  <li>list item 1</li>
    +  <li>list item 2</li>
    +  <li class="third-item">list item 3</li>
    +  <li>list item 4</li>
    +  <li>list item 5</li>
     </ul>
         

    To select the element that comes immediately before item three:

    -
    $('li.third-item').prev().css('background-color', 'red');
    +
    
    +$( "li.third-item" ).prev().css( "background-color", "red" );
    +    

    The result of this call is a red background behind item 2. Since no selector expression is supplied, this preceding element is unequivocally included as part of the object. If one had been supplied, the element would be tested for a match before it was included.

    If no previous sibling exists, or if the previous sibling element does not match a supplied selector, an empty jQuery object is returned.

    -

    To select all preceding sibling elements, rather than just the preceding adjacent sibling, use the .prevAll() method.

    +

    To select all preceding sibling elements, rather than just the preceding adjacent sibling, use the .prevAll() method.

    Find the very previous sibling of each div. - + div { + width: 40px; + height: 40px; + margin: 10px; + float: left; + border: 2px blue solid; + padding: 2px; + } + span { + font-size: 14px; + } + p { + clear: left; + margin: 10px; + } +]]> + For each paragraph, find the very previous sibling that has a class "selected". - - + + - \ No newline at end of file + diff --git a/entries/prevAll.xml b/entries/prevAll.xml index 0d49d912..e5453080 100644 --- a/entries/prevAll.xml +++ b/entries/prevAll.xml @@ -14,31 +14,44 @@

    Consider a page with a simple list on it:

    
     <ul>
    -   <li>list item 1</li>
    -   <li>list item 2</li>
    -   <li class="third-item">list item 3</li>
    -   <li>list item 4</li>
    -   <li>list item 5</li>
    +  <li>list item 1</li>
    +  <li>list item 2</li>
    +  <li class="third-item">list item 3</li>
    +  <li>list item 4</li>
    +  <li>list item 5</li>
     </ul>
    -
    +

    If we begin at the third item, we can find the elements which come before it:

    -
    $('li.third-item').prevAll().css('background-color', 'red');
    +
    
    +$( "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.

    Locate all the divs preceding the last div and give them a class. - + - + div { + width: 70px; + height: 70px; + background: #abc; + border: 2px solid black; + margin: 10px; + float: left; + } + div.before { + border-color: red; + } +]]> + - \ No newline at end of file + diff --git a/entries/prevUntil.xml b/entries/prevUntil.xml index 1fca21bf..14c468ca 100644 --- a/entries/prevUntil.xml +++ b/entries/prevUntil.xml @@ -22,7 +22,7 @@ Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.

    Given a selector expression that represents a set of DOM elements, the .prevUntil() method searches through the predecessors of these elements in the DOM tree, stopping when it reaches an element matched by the method's argument. The new jQuery object that is returned contains all previous siblings up to but not including the one matched by the .prevUntil() selector; the elements are returned in order from the closest sibling to the farthest.

    -

    If the selector is not matched or is not supplied, all previous siblings will be selected; in these cases it selects the same elements as the .prevAll() method does when no filter selector is provided.

    +

    If the selector is not matched or is not supplied, all previous siblings will be selected; in these cases it selects the same elements as the .prevAll() method does when no filter selector is provided.

    As of jQuery 1.6, A DOM node or jQuery object, instead of a selector, may be used for the first .prevUntil() argument.

    The method optionally accepts a selector expression for its second argument. If this argument is supplied, the elements will be filtered by testing whether they match it.

    @@ -30,14 +30,15 @@ 250px Find the siblings that precede <dt id="term-2"> up to the preceding <dt> and give them a red background color. Also, find previous <dd> siblings of <dt id="term-3"> up to <dt id="term-1"> and give them a green text color. - + +]]>
    - \ No newline at end of file + diff --git a/entries/promise.xml b/entries/promise.xml index 624c2f75..ad38f98d 100644 --- a/entries/promise.xml +++ b/entries/promise.xml @@ -26,7 +26,7 @@ var div = $( "
    " ); div.promise().done(function( arg1 ) { - // will fire right away and alert "true" + // Will fire right away and alert "true" alert( this === div && arg1 === div ); }); ]]> @@ -34,11 +34,14 @@ div.promise().done(function( arg1 ) { Resolve the returned Promise when all animations have ended (including those initiated in the animation callback or added later on): - \ No newline at end of file + diff --git a/entries/prop.xml b/entries/prop.xml index 8ee297f1..8727671f 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -14,11 +14,11 @@ Get the value of a property for the first element in the set of matched elements.

    The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery's .each() or .map() method.

    -
    +

    Note: Attempting to change the type property (or attribute) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

    Attributes vs. Properties

    -

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    +

    The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

    For example, selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.

    Concerning boolean attributes, consider a DOM element defined by the HTML markup <input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:

    @@ -30,33 +30,33 @@ @@ -70,10 +70,10 @@ if ( elem.checked )
  • - if ( $(elem).prop("checked") ) + if ( $( elem ).prop( "checked" ) )
  • - if ( $(elem).is(":checked") ) + if ( $( elem ).is( ":checked" ) )
  • The same is true for other dynamic attributes, such as selected and value.

    @@ -82,16 +82,20 @@ Display the checked property and attribute of a checkbox as it changes. +$( "input[type='checkbox']" ).prop( "checked", function( i, val ) { return !val; -}); -

    Note: If nothing is returned in the setter function (ie. function(index, prop){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

    +}); + +

    Note: If nothing is returned in the setter function (ie. function( index, prop ){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

    Disable all checkboxes on the page. + - \ No newline at end of file + From 8c3a3fae25b6b3bc9bc56803e00625a414fb6d00 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Wed, 17 Jul 2013 22:31:39 +0100 Subject: [PATCH 248/998] Code indentation and formatting (q and r entries plus password-selector) --- entries/password-selector.xml | 3 +- entries/queue.xml | 202 +++++++++++++++++++++------------- entries/radio-selector.xml | 69 ++++++------ entries/ready.xml | 48 +++++--- entries/remove.xml | 73 +++++++----- entries/removeAttr.xml | 25 +++-- entries/removeClass.xml | 127 ++++++++++++++------- entries/removeData.xml | 38 ++++--- entries/removeProp.xml | 24 ++-- entries/replaceAll.xml | 32 ++++-- entries/replaceWith.xml | 107 ++++++++++++------ entries/reset-selector.xml | 62 ++++++----- entries/resize.xml | 14 ++- entries/root-selector.xml | 16 ++- 14 files changed, 521 insertions(+), 319 deletions(-) diff --git a/entries/password-selector.xml b/entries/password-selector.xml index 8f441e4f..9cb84f79 100644 --- a/entries/password-selector.xml +++ b/entries/password-selector.xml @@ -7,7 +7,7 @@ Selects all elements of type password. -

    $( ":password" ) is equivalent to $( "[type=password]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $( ":password" ) is equivalent to $( "*:password" ), so $( "input:password" ) should be used instead.

    +

    $( ":password" ) is equivalent to $( "[type=password]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":password" ) is equivalent to $( "*:password" ), so $( "input:password" ) should be used instead.

    @@ -17,7 +17,6 @@ var input = $( "input:password" ).css({ background: "yellow", border: "3px red solid" }); - $( "div" ) .text( "For this type jQuery found " + input.length + "." ) .css( "color", "red" ); diff --git a/entries/queue.xml b/entries/queue.xml index 0cd3f514..a3e58c6a 100644 --- a/entries/queue.xml +++ b/entries/queue.xml @@ -14,36 +14,50 @@ Show the length of the queue. - + +

    The queue length is:

    +
    +]]>
    @@ -72,80 +86,114 @@ showIt(); Manipulate the queue of functions to be executed, once for each matched element.

    Every element can have one to many queues of functions attached to it by jQuery. In most applications, only one queue (called fx) is used. Queues allow a sequence of actions to be called on an element asynchronously, without halting program execution. The typical example of this is calling multiple animation methods on an element. For example:

    -
    $('#foo').slideUp().fadeIn();
    +
    
    +$( "#foo" ).slideUp().fadeIn();
    +      

    When this statement is executed, the element begins its sliding animation immediately, but the fading transition is placed on the fx queue to be called only once the sliding transition is complete.

    The .queue() method allows us to directly manipulate this queue of functions. Calling .queue() with a callback is particularly useful; it allows us to place a new function at the end of the queue. The callback function is executed once for each element in the jQuery set.

    This feature is similar to providing a callback function with an animation method, but does not require the callback to be given at the time the animation is performed.

    -
    $('#foo').slideUp();
    -$('#foo').queue(function() {
    -  alert('Animation complete.');
    -  $(this).dequeue();
    -});
    +
    
    +$( "#foo" ).slideUp();
    +$( "#foo" ).queue(function() {
    +  alert( "Animation complete." );
    +  $( this ).dequeue();
    +});
    +      

    This is equivalent to:

    -
    $('#foo').slideUp(function() {
    -  alert('Animation complete.');
    -});
    +
    
    +$( "#foo" ).slideUp(function() {
    +  alert( "Animation complete." );
    +});
    +      

    Note that when adding a function with .queue(), we should ensure that .dequeue() is eventually called so that the next function in line executes.

    As of jQuery 1.4, the function that's called is passed another function as the first argument. When called, this automatically dequeues the next item and keeps the queue moving. We use it as follows:

    -
    $("#test").queue(function(next) {
    +      
    
    +$( "#test" ).queue(function( next ) {
         // Do some stuff...
         next();
    -});
    +}); +
    Queue a custom function. - + - + div { + margin: 3px; + width: 40px; + height: 40px; + position: absolute; + left: 0px; + top: 30px; + background: green; + display: none; + } + div.newcolor { + background: blue; + } +]]> + Set a queue array to delete the queue. - + - + div { + margin: 3px; + width: 40px; + height: 40px; + position: absolute; + left: 0px; + top: 30px; + background: green; + display: none; + } + div.newcolor { + background: blue; + } +]]> + diff --git a/entries/radio-selector.xml b/entries/radio-selector.xml index 22f58673..0011386b 100644 --- a/entries/radio-selector.xml +++ b/entries/radio-selector.xml @@ -7,50 +7,55 @@ Selects all elements of type radio. -

    $(':radio') is equivalent to $('[type=radio]'). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':radio') is equivalent to $('*:radio'), so $('input:radio') should be used instead.

    -

    To select a set of associated radio buttons, you might use: $('input[name=gender]:radio')

    +

    $( ":radio" ) is equivalent to $( "[type=radio]" ). As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $( ":radio" ) is equivalent to $( "*:radio" ), so $( "input:radio" ) should be used instead.

    +

    To select a set of associated radio buttons, you might use: $( "input[name=gender]:radio" )

    Finds all radio inputs. - + +
    +]]>
    - \ No newline at end of file + diff --git a/entries/ready.xml b/entries/ready.xml index 8f329c38..989b7e18 100644 --- a/entries/ready.xml +++ b/entries/ready.xml @@ -18,38 +18,52 @@

    All three of the following syntaxes are equivalent:

    • - $(document).ready(handler) + $( document ).ready( handler )
    • -
    • $().ready(handler) (this is not recommended)
    • +
    • $().ready( handler ) (this is not recommended)
    • $(handler)
    -

    There is also $(document).on("ready", handler), deprecated as of jQuery 1.8. This behaves similarly to the ready method but if the ready event has already fired and you try to .on("ready") the bound handler will not be executed. Ready handlers bound this way are executed after any bound by the other three methods above.

    +

    There is also $(document).on( "ready", handler ), deprecated as of jQuery 1.8. This behaves similarly to the ready method but if the ready event has already fired and you try to .on( "ready" ) the bound handler will not be executed. Ready handlers bound this way are executed after any bound by the other three methods above.

    The .ready() method can only be called on a jQuery object matching the current document, so the selector can be omitted.

    The .ready() method is typically used with an anonymous function:

    -
    $(document).ready(function() {
    +    
    
    +$( document ).ready(function() {
       // Handler for .ready() called.
    -});
    +}); +

    Which is equivalent to calling:

    -
    $(function() {
    -     // Handler for .ready() called.
    -    });
    +
    
    +$(function() {
    +  // Handler for .ready() called.
    +});
    +    

    If .ready() is called after the DOM has been initialized, the new handler passed in will be executed immediately.

    Aliasing the jQuery Namespace

    -

    When using another JavaScript library, we may wish to call $.noConflict() to avoid namespace difficulties. When this function is called, the $ shortcut is no longer available, forcing us to write jQuery each time we would normally write $. However, the handler passed to the .ready() method can take an argument, which is passed the global jQuery object. This means we can rename the object within the context of our .ready() handler without affecting other code:

    -
    jQuery(document).ready(function($) {
    +    

    When using another JavaScript library, we may wish to call $.noConflict() to avoid namespace difficulties. When this function is called, the $ shortcut is no longer available, forcing us to write jQuery each time we would normally write $. However, the handler passed to the .ready() method can take an argument, which is passed the global jQuery object. This means we can rename the object within the context of our .ready() handler without affecting other code:

    +
    
    +jQuery( document ).ready(function( $ ) {
       // Code using $ as usual goes here.
    -});
    +}); +
    Display a message when the DOM is loaded. - - - + + + - \ No newline at end of file + diff --git a/entries/remove.xml b/entries/remove.xml index 2fa95924..6c85e9b4 100644 --- a/entries/remove.xml +++ b/entries/remove.xml @@ -9,53 +9,76 @@ Remove the set of matched elements from the DOM. -

    Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead.

    +

    Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="hello">Hello</div>
       <div class="goodbye">Goodbye</div>
    -</div>
    +</div> +

    We can target any element for removal:

    -
    $('.hello').remove();
    +
    
    +$( ".hello" ).remove();
    +    

    This will result in a DOM structure with the <div> element deleted:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="goodbye">Goodbye</div>
    -</div>
    +</div> +

    If we had any number of nested elements inside <div class="hello">, they would be removed, too. Other jQuery constructs such as data or event handlers are erased as well.

    We can also include a selector as an optional parameter. For example, we could rewrite the previous DOM removal code as follows:

    -
    $('div').remove('.hello');
    +
    
    +$( "div" ).remove( ".hello" );
    +    

    This would result in the same DOM structure:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="goodbye">Goodbye</div>
    -</div>
    +</div> +
    Removes all paragraphs from the DOM - - + + Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing $("p").filter(":contains('Hello')").remove(). - - + + - \ No newline at end of file + diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml index bf076bc0..2a037881 100644 --- a/entries/removeAttr.xml +++ b/entries/removeAttr.xml @@ -12,30 +12,31 @@

    The .removeAttr() method uses the JavaScript removeAttribute() function, but it has the advantage of being able to be called directly on a jQuery object and it accounts for different attribute naming across browsers.

    Note: Removing an inline onclick event handler using .removeAttr() doesn't achieve the desired effect in Internet Explorer 6, 7, or 8. To avoid potential problems, use .prop() instead:

    
    -$element.prop("onclick", null);
    -console.log("onclick property: ", $element[0].onclick);
    +$element.prop( "onclick", null );
    +console.log( "onclick property: ", $element[ 0 ].onclick );
         
    Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute. - @@ -44,4 +45,4 @@ console.log("onclick property: ", $element[0].onclick); - \ No newline at end of file + diff --git a/entries/removeClass.xml b/entries/removeClass.xml index 086cf5b9..d172f88e 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -17,67 +17,110 @@

    If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.

    More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

    -
    $('p').removeClass('myClass yourClass')
    +
    
    +$( "p" ).removeClass( "myClass yourClass" )
    +    

    This method is often used with .addClass() to switch elements' classes from one to another, like so:

    -
    $('p').removeClass('myClass noClass').addClass('yourClass');
    +
    
    +$( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );
    +    

    Here, the myClass and noClass classes are removed from all paragraphs, while yourClass is added.

    -

    To replace all existing classes with another class, we can use .attr('class', 'newClass') instead.

    +

    To replace all existing classes with another class, we can use .attr( "class", "newClass" ) instead.

    As of jQuery 1.4, the .removeClass() method allows us to indicate the class to be removed by passing in a function.

    -
    $('li:last').removeClass(function() {
    -  return $(this).prev().attr('class');
    -});
    +
    
    +$( "li:last" ).removeClass(function() {
    +  return $( this ).prev().attr( "class" );
    +});
    +    

    This example removes the class name of the penultimate <li> from the last <li>.

    Remove the class 'blue' from the matched elements. - + - + p { + margin: 4px; + font-size: 16px; + font-weight: bolder; + } + .blue { + color: blue; + } + .under { + text-decoration: underline; + } + .highlight { + background: yellow; + } +]]> + Remove the class 'blue' and 'under' from the matched elements. - + - + p { + margin: 4px; + font-size: 16px; + font-weight: bolder; + } + .blue { + color: blue; + } + .under { + text-decoration: underline; + } + .highlight { + background: yellow; + } +]]> + Remove all the classes from the matched elements. - + - + p { + margin: 4px; + font-size: 16px; + font-weight: bolder; + } + .blue { + color: blue; + } + .under { + text-decoration: underline; + } + .highlight { + background: yellow; + } +]]> + - \ No newline at end of file + diff --git a/entries/removeData.xml b/entries/removeData.xml index 2b9ca409..7286016d 100644 --- a/entries/removeData.xml +++ b/entries/removeData.xml @@ -25,25 +25,29 @@ Set a data store for 2 names then remove one of them. - + div { + margin: 2px; + color: blue; + } + span { + color: red; + } +]]> + diff --git a/entries/removeProp.xml b/entries/removeProp.xml index 2bfa478d..5a2b3d51 100644 --- a/entries/removeProp.xml +++ b/entries/removeProp.xml @@ -9,24 +9,28 @@ Remove a property for the set of matched elements. -

    The .removeProp() method removes properties set by the .prop() method.

    +

    The .removeProp() method removes properties set by the .prop() method.

    With some built-in properties of a DOM element or window object, browsers may generate an error if an attempt is made to remove the property. jQuery first assigns the value undefined to the property and ignores any error the browser generates. In general, it is only necessary to remove custom properties that have been set on an object, and not built-in (native) properties.

    -

    Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.

    +

    Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.

    Set a numeric property on a paragraph and then remove it. - + + diff --git a/entries/replaceWith.xml b/entries/replaceWith.xml index 7551ceba..17e81829 100644 --- a/entries/replaceWith.xml +++ b/entries/replaceWith.xml @@ -20,56 +20,83 @@ Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.

    The .replaceWith() method removes content from the DOM and inserts new content in its place with a single call. Consider this DOM structure:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner first">Hello</div>
       <div class="inner second">And</div>
       <div class="inner third">Goodbye</div>
    -</div>
    +</div> +

    The second inner <div> could be replaced with the specified HTML:

    -
    $('div.second').replaceWith('<h2>New heading</h2>');
    +
    
    +$( "div.second" ).replaceWith( "<h2>New heading</h2>" );
    +    

    This results in the structure:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner first">Hello</div>
       <h2>New heading</h2>
       <div class="inner third">Goodbye</div>
    -</div>
    +</div> +

    All inner <div> elements could be targeted at once:

    -
    $('div.inner').replaceWith('<h2>New heading</h2>');
    +
    
    +$( "div.inner" ).replaceWith( "<h2>New heading</h2>" );
    +    

    This causes all of them to be replaced:

    <div class="container">
       <h2>New heading</h2>
       <h2>New heading</h2>
       <h2>New heading</h2>
    -</div>
    +</div> +

    An element could also be selected as the replacement:

    -
    $('div.third').replaceWith($('.first'));
    +
    
    +$( "div.third" ).replaceWith( $( ".first" ) );
    +    

    This results in the DOM structure:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner second">And</div>
       <div class="inner first">Hello</div>
    -</div>
    +</div> +

    This example demonstrates that the selected element replaces the target by being moved from its old location, not by being cloned.

    The .replaceWith() method, like most jQuery methods, returns the jQuery object so that other methods can be chained onto it. However, it must be noted that the original jQuery object is returned. This object refers to the element that has been removed from the DOM, not the new element that has replaced it.

    As of jQuery 1.4, .replaceWith() can also work on disconnected DOM nodes. For example, with the following code, .replaceWith() returns a jQuery set containing only a paragraph.:

    -
    $("<div/>").replaceWith("<p></p>");
    +
    
    +$( "<div/>" ).replaceWith( "<p></p>" );
    +    

    The .replaceWith() method can also take a function as its argument:

    -
    $('div.container').replaceWith(function() {
    -  return $(this).contents();
    -});
    +
    
    +$( "div.container" ).replaceWith(function() {
    +  return $( this ).contents();
    +});
    +    

    This results in <div class="container"> being replaced by its three child <div>s. The return value of the function may be an HTML string, DOM element, or jQuery object.

    On click, replace the button with a div containing the same word. + button { + display: block; + margin: 3px; + color: red; + width: 200px; + } + div { + color: red; + border: 2px solid blue; + width: 200px; + margin: 3px; + text-align: center; + } +]]> + div { + border: 2px solid blue; + color: red; + margin: 3px; + } + p { + border: 2px solid red; + color: blue; + margin: 3px; + cursor: pointer; + } +]]> On button click, replace the containing div with its child divs and append the class name of the selected element to the paragraph. + .container { + background-color: #991; + } + .inner { + color: #911; + } +]]> - + textarea { + height: 45px; + } +]]> + - \ No newline at end of file + diff --git a/entries/resize.xml b/entries/resize.xml index c5d42494..f7c9c2dd 100644 --- a/entries/resize.xml +++ b/entries/resize.xml @@ -21,10 +21,11 @@ 1.0 -

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

    +

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

    The resize event is sent to the window element when the size of the browser window changes:

    -
    $(window).resize(function() {
    -  $('#log').append('<div>Handler for .resize() called.</div>');
    +    
    
    +$( window ).resize(function() {
    +  $( "#log" ).append( "<div>Handler for .resize() called.</div>" );
     });
         

    Now whenever the browser window's size is changed, the message is appended to <div id="log"> one or more times, depending on the browser.

    @@ -33,9 +34,10 @@ To see the window width while (or after) it is resized, try: +$( window ).resize(function() { + $( "body" ).prepend( "
    " + $( window ).width() + "
    " ); +}); +]]>
    diff --git a/entries/root-selector.xml b/entries/root-selector.xml index 76924b25..5ed93b2c 100644 --- a/entries/root-selector.xml +++ b/entries/root-selector.xml @@ -12,15 +12,19 @@ Display the tag name of the root element. " ).html( $( ":root" )[ 0 ].nodeName ).appendTo( "#log" ); ]]> - + span.fot { + color: red; + font-size: 120%; + font-style: italic; + } +]]> + - - From 27d5a4731b17cf0845009ea8dba20b2422a35563 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Thu, 18 Jul 2013 16:07:14 +0100 Subject: [PATCH 249/998] Code indentation and formatting (s entries) --- entries/scroll.xml | 55 ++++++++++------- entries/scrollLeft.xml | 48 ++++++++++----- entries/scrollTop.xml | 54 +++++++++++------ entries/select.xml | 53 ++++++++++------- entries/selected-selector.xml | 42 ++++++------- entries/selector.xml | 2 +- entries/serialize.xml | 65 ++++++++++++--------- entries/serializeArray.xml | 107 ++++++++++++++++++---------------- entries/show.xml | 104 ++++++++++++++++++++------------- entries/siblings.xml | 65 ++++++++++++++------- entries/size.xml | 46 +++++++++------ entries/slice.xml | 94 ++++++++++++++++++----------- entries/slideDown.xml | 98 +++++++++++++++++++------------ entries/slideToggle.xml | 88 +++++++++++++++++----------- entries/slideUp.xml | 89 +++++++++++++++------------- entries/stop.xml | 93 ++++++++++++++++------------- entries/submit-selector.xml | 57 +++++++++--------- entries/submit.xml | 72 ++++++++++++++--------- 18 files changed, 738 insertions(+), 494 deletions(-) diff --git a/entries/scroll.xml b/entries/scroll.xml index 0f96c8ed..080ecdc9 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -21,10 +21,11 @@ 1.0 -

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

    +

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

    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:

    -
    <div id="target" style="overflow: scroll; width: 200px; height: 100px;">
    +    
    
    +<div id="target" style="overflow: scroll; width: 200px; height: 100px;">
       Lorem ipsum dolor sit amet, consectetur adipisicing elit,
       sed do eiusmod tempor incididunt ut labore et dolore magna
       aliqua. Ut enim ad minim veniam, quis nostrud exercitation
    @@ -37,43 +38,57 @@
     <div id="other">
       Trigger the handler
     </div>
    -<div id="log"></div>
    +<div id="log"></div> +

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

    The scroll event handler can be bound to this element:

    -
    $('#target').scroll(function() {
    -  $('#log').append('<div>Handler for .scroll() called.</div>');
    -});
    +
    
    +$( "#target" ).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.

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

    -
    $('#other').click(function() {
    -  $('#target').scroll();
    -});
    +
    
    +$( "#other" ).click(function() {
    +  $( "#target" ).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: - + div { + color: blue; + } + p { + color: green; + } + span { + color: red; + display: none; + } +]]> + diff --git a/entries/scrollLeft.xml b/entries/scrollLeft.xml index 85f539e3..2b53896b 100644 --- a/entries/scrollLeft.xml +++ b/entries/scrollLeft.xml @@ -15,13 +15,20 @@ Get the scrollLeft of a paragraph. - - + @@ -41,22 +48,31 @@ $("p:last").text( "scrollLeft:" + p.scrollLeft() ); Set the scrollLeft of a div. - - +]]> + diff --git a/entries/scrollTop.xml b/entries/scrollTop.xml index 82bbe43f..027d3db0 100644 --- a/entries/scrollTop.xml +++ b/entries/scrollTop.xml @@ -11,13 +11,20 @@ Get the scrollTop of a paragraph. - - + p { + margin: 10px; + padding: 5px; + border: 2px solid #666; + } +]]> + @@ -37,22 +44,31 @@ $("p:last").text( "scrollTop:" + p.scrollTop() ); Set the scrollTop of a div. - - + div.demo { + background: #ccc none repeat scroll 0 0; + border: 3px solid #666; + margin: 5px; + padding: 5px; + position: relative; + width: 200px; + height: 100px; + overflow: auto; + } + p { + margin: 10px; + padding: 5px; + border: 2px solid #666; + width: 1000px; + height: 1000px; + } +]]> + diff --git a/entries/select.xml b/entries/select.xml index d49f5ae2..cb0cc4e8 100644 --- a/entries/select.xml +++ b/entries/select.xml @@ -21,23 +21,28 @@ 1.0 -

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

    +

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

    The select event is sent to an element when the user makes a text selection inside it. This event is limited to <input type="text"> fields and <textarea> boxes.

    For example, consider the HTML:

    -
    <form>
    -  <input id="target" type="text" value="Hello there" />
    +    
    
    +<form>
    +  <input id="target" type="text" value="Hello there">
     </form>
     <div id="other">
       Trigger the handler
     </div>

    The event handler can be bound to the text input:

    -
    $('#target').select(function() {
    -  alert('Handler for .select() called.');
    -});
    +
    
    +$( "#target" ).select(function() {
    +  alert( "Handler for .select() called." );
    +});
    +    

    Now when any portion of the text is selected, the alert is displayed. Merely setting the location of the insertion point will not trigger the event. To trigger the event manually, apply .select() without an argument:

    -
    $('#other').click(function() {
    -  $('#target').select();
    -});
    +
    
    +$( "#other").click(function() {
    +  $( "#target" ).select();
    +});
    +    

    After this code executes, clicks on the Trigger button will also alert the message:

    Handler for .select() called. @@ -50,26 +55,30 @@ To do something when text in input boxes is selected: + p { + color: blue; + } + div { + color: red; + } +]]> +

    Click and drag the mouse to select text in the inputs.

    + + +
    + ]]> To trigger the select event on all input elements, try: - + diff --git a/entries/selected-selector.xml b/entries/selected-selector.xml index b54a0de4..455ba37e 100644 --- a/entries/selected-selector.xml +++ b/entries/selected-selector.xml @@ -13,31 +13,33 @@ 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. - + div { + color: red; + } +]]> + - \ No newline at end of file + diff --git a/entries/selector.xml b/entries/selector.xml index de6090ec..74ea2326 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -6,7 +6,7 @@ A selector representing selector passed to jQuery(), if any, when creating the original set. -

    The .selector property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector should have the caller pass in the selector as part of the plugin's arguments during initialization.

    +

    The .selector property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as $.fn.foo = function( selector, options ) { /* plugin code goes here */ };, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} ); with the "div.bar" selector repeated as the first argument of .foo().

    diff --git a/entries/serialize.xml b/entries/serialize.xml index a6fd91ca..c5c99ccb 100644 --- a/entries/serialize.xml +++ b/entries/serialize.xml @@ -8,61 +8,72 @@

    The .serialize() method creates a text string in standard URL-encoded notation. It can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>: $( "input, textarea, select" ).serialize();

    It is typically easier, however, to select the <form> itself for serialization:

    -
    $( "form" ).on( "submit", function( event ) {
    +    
    
    +$( "form" ).on( "submit", function( event ) {
       event.preventDefault();
    -  console.log( $(this).serialize() );
    -});
    + console.log( $( this ).serialize() ); +}); +

    In this case, jQuery serializes the successful controls within the form. Only form elements are examined for inputs they contain, in all other cases the input elements to be serialized should be part of the set passed to the .serialize() method. Selecting both the form and its children in a set will cause duplicates in the serialized string.

    Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

    Serialize a form to a query string that could be sent to a server in an Ajax request. + body, select { + font-size: 12px; + } + form { + margin: 5px; + } + p { + color: red; + margin: 5px; + font-size: 14px; + } + b { + color: blue; + } +]]> 200 + +

    +]]>
    diff --git a/entries/serializeArray.xml b/entries/serializeArray.xml index bd90e0ac..319abcb5 100644 --- a/entries/serializeArray.xml +++ b/entries/serializeArray.xml @@ -8,9 +8,9 @@

    The .serializeArray() method creates a JavaScript array of objects, ready to be encoded as a JSON string. It operates on a jQuery object representing a set of form elements. The form elements can be of several types:

    <form>
    -  <div><input type="text" name="a" value="1" id="a" /></div>
    -  <div><input type="text" name="b" value="2" id="b" /></div>
    -  <div><input type="hidden" name="c" value="3" id="c" /></div>
    +  <div><input type="text" name="a" value="1" id="a"></div>
    +  <div><input type="text" name="b" value="2" id="b"></div>
    +  <div><input type="hidden" name="c" value="3" id="c"></div>
       <div>
         <textarea name="d" rows="8" cols="40">4</textarea>
       </div>
    @@ -20,20 +20,23 @@
         <option value="7">7</option>
       </select></div>
       <div>
    -    <input type="checkbox" name="f" value="8" id="f" />
    +    <input type="checkbox" name="f" value="8" id="f">
       </div>
       <div>
    -    <input type="submit" name="g" value="Submit" id="g" />
    +    <input type="submit" name="g" value="Submit" id="g">
       </div>
     </form>

    The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized.

    This method can act on a jQuery object that has selected individual form elements, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> tag itself for serialization:

    -
    $('form').submit(function() {
    -  console.log($(this).serializeArray());
    +    
    
    +$( "form" ).submit(function() {
    +  console.log( $( this ).serializeArray() );
       return false;
    -});
    +}); +

    This produces the following data structure (provided that the browser supports console.log):

    -
    [
    +    
    
    +[
       {
         name: "a",
         value: "1"
    @@ -54,58 +57,64 @@
         name: "e",
         value: "5"
       }
    -]
    +] +
    Get the values from a form, iterate through them, and append them to a results display. - + body, select { + font-size: 14px; + } + form { + margin: 5px; + } + p { + color: red; + margin: 5px; + } + b { + color: blue; + } +]]> + - \ No newline at end of file + diff --git a/entries/show.xml b/entries/show.xml index e94ce321..475b7971 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -29,27 +29,30 @@

    With no parameters, the .show() method is the simplest way to display an element:

    -
    $('.target').show();
    +    
    
    +$( ".target" ).show();
         
    -

    The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling .css('display', 'block'), except that the display property is restored to whatever it was initially. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

    +

    The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling .css( "display", "block"), except that the display property is restored to whatever it was initially. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

    Note: If using !important in your styles, such as display: none !important, - it is necessary to override the style using .css('display', 'block !important') should you wish for .show() to function correctly.

    + it is necessary to override the style using .css( "display", "block !important") should you wish for .show() to function correctly.

    When a duration, a plain object, or a "complete" function is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123">
     With the element initially hidden, we can show it slowly:
    -$('#clickme').click(function() {
    -  $('#book').show('slow', function() {
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).show( "slow", function() {
         // Animation complete.
       });
    -});
    +}); +

    @@ -61,73 +64,90 @@ $('#clickme').click(function() { Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds. - + 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. + div { + background: #def3ca; + margin: 3px; + width: 80px; + display: none; + float: left; + text-align: center; + } +]]> + + +

    Hello 3,
    +
    how
    +
    are
    +
    you?
    +]]> Show all span and input elements with an animation. Change the text once the animation is done. + span { + display: none; + } + div { + display: none; + } + p { + font-weight: bold; + background-color: #fcd; + } +]]>
    - + +

    Unique siblings:

    +]]> Find all siblings with a class "selected" of each div. - - + + - \ No newline at end of file + diff --git a/entries/size.xml b/entries/size.xml index da4f1094..86d68f54 100644 --- a/entries/size.xml +++ b/entries/size.xml @@ -8,7 +8,7 @@

    The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.

    -

    The .size() method is functionally equivalent to the .length property; however, the .length property is preferred because it does not have the overhead of a function call.

    +

    The .size() method is functionally equivalent to the .length property; however, the .length property is preferred because it does not have the overhead of a function call.

    Given a simple unordered list on the page:

    
     <ul>
    @@ -17,8 +17,10 @@
     </ul>
         

    Both .size() and .length identify the number of items:

    -
    alert( "Size: " + $("li").size() );
    -alert( "Size: " + $("li").length );
    +
    
    +alert( "Size: " + $( "li" ).size() );
    +alert( "Size: " + $( "li" ).length );
    +    

    This results in two alerts:

    Size: 2 @@ -30,24 +32,34 @@ alert( "Size: " + $("li").length );

    Count the divs. Click to add more. + body { + cursor: pointer; + min-height: 100px; + } + div { + width: 50px; + height: 30px; + margin: 5px; + float: left; + background: blue; + } + span { + color: red; + } +]]> diff --git a/entries/slice.xml b/entries/slice.xml index 031da20c..89477387 100644 --- a/entries/slice.xml +++ b/entries/slice.xml @@ -24,80 +24,106 @@ </ul>

    We can apply this method to the set of list items:

    -
    $('li').slice(2).css('background-color', 'red');
    +
    
    +$( "li" ).slice( 2 ).css( "background-color", "red" );
    +    

    The result of this call is a red background for items 3, 4, and 5. Note that the supplied index is zero-based, and refers to the position of elements within the jQuery object, not within the DOM tree.

    The end parameter allows us to limit the selected range even further. For example:

    -
    $('li').slice(2, 4).css('background-color', 'red');
    +
    
    +$( "li" ).slice( 2, 4 ).css( "background-color", "red" );
    +    

    Now only items 3 and 4 are selected. The index is once again zero-based; the range extends up to but not including the specified index.

    Negative Indices

    The jQuery .slice() method is patterned after the JavaScript .slice() method for arrays. One of the features that it mimics is the ability for negative numbers to be passed as either the start or end parameter. If a negative number is provided, this indicates a position starting from the end of the set, rather than the beginning. For example:

    -
    $('li').slice(-2, -1).css('background-color', 'red');
    +
    
    +$( "li" ).slice( -2, -1 ).css( "background-color", "red" );
    +    

    This time only list item 4 is turned red, since it is the only item in the range between two from the end (-2) and one from the end (-1).

    Turns divs yellow based on a random slice. + div { + width: 40px; + height: 40px; + margin: 10px; + float: left; + border: 2px solid blue; + } + span { + color: red; + font-weight: bold; + } + button { + margin: 5px; + } +]]> 240 - +
    + ]]>
    Selects all paragraphs, then slices the selection to include only the first element. - + Selects all paragraphs, then slices the selection to include only the first and second element. - + Selects all paragraphs, then slices the selection to include only the second element. - + Selects all paragraphs, then slices the selection to include only the second and third element. - + Selects all paragraphs, then slices the selection to include only the third element. - + diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 0ffeadf9..bc8f7c8f 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -22,16 +22,20 @@

    The .slideDown() method animates the height of the matched elements. This causes lower parts of the page to slide down, making way for the revealed items.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123"> +

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

    -
    $('#clickme').click(function() {
    -  $('#book').slideDown('slow', function() {
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).slideDown( "slow", function() {
         // Animation complete.
       });
    -});
    +}); +

    @@ -42,58 +46,80 @@

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Animates all divs to slide down and show themselves over 600 milliseconds. - +
    +]]>
    Animates all inputs to slide down, completing the animation within 1000 milliseconds. Once the animation is done, the input look is changed especially if it is the middle input which gets the focus. - + diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml index 2283c5ea..e3c3d474 100644 --- a/entries/slideToggle.xml +++ b/entries/slideToggle.xml @@ -22,17 +22,20 @@

    The .slideToggle() method animates the height of the matched elements. This causes lower parts of the page to slide up or down, appearing to reveal or conceal the items. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline. When the height reaches 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123"> +

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

    -
    $('#clickme').click(function() {
    -  $('#book').slideToggle('slow', function() {
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).slideToggle( "slow", function() {
         // Animation complete.
       });
    -});
    -
    +}); +

    With the element initially shown, we can hide it slowly with the first click:

    @@ -51,47 +54,65 @@

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds. - + p { + width: 400px; + } +]]> + Animates divs between dividers with a toggle that makes some appear and some disappear. - + +

    There have been 0 toggled divs.

    +]]>
    diff --git a/entries/slideUp.xml b/entries/slideUp.xml index bfc3d62d..345d3c4f 100644 --- a/entries/slideUp.xml +++ b/entries/slideUp.xml @@ -22,17 +22,20 @@

    The .slideUp() method animates the height of the matched elements. This causes lower parts of the page to slide up, appearing to conceal the items. Once the height reaches 0 (or, if set, to whatever the CSS min-height property is), the display style property is set to none to ensure that the element no longer affects the layout of the page.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively. If any other string is supplied, or if the duration parameter is omitted, the default duration of 400 milliseconds is used.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    +<img id="book" src="book.png" alt="" width="100" height="123"> +

    With the element initially shown, we can hide it slowly:

    -
    $('#clickme').click(function() {
    -  $('#book').slideUp('slow', function() {
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).slideUp( "slow", function() {
         // Animation complete.
       });
     });
    -  
    +

    @@ -43,63 +46,71 @@

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    -

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    +

    As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

    Animates all divs to slide up, completing the animation within 400 milliseconds. +$( document.body ).click(function() { + if ( $( "div:first" ).is( ":hidden" ) ) { + $( "div" ).show( "slow" ); + } else { + $( "div" ).slideUp(); + } +}); +]]> - + div { + background: #3d9a44; + margin: 3px; + width: 80px; + height: 40px; + float: left; + } +]]> + Animates the parent paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert. - + +
    +]]>
    diff --git a/entries/stop.xml b/entries/stop.xml index 498cb257..b06f2dc0 100644 --- a/entries/stop.xml +++ b/entries/stop.xml @@ -29,16 +29,20 @@

    If the jumpToEnd argument is provided with a value of true, the current animation stops, but the element is immediately given its target values for each CSS property. In our above .slideUp() example, the element would be immediately hidden. The callback function is then immediately called, if provided.

    As of jQuery 1.7, if the first argument is provided as a string, only the animations in the queue represented by that string will be stopped.

    The usefulness of the .stop() method is evident when we need to animate an element on mouseenter and mouseleave:

    -
    <div id="hoverme">
    +    
    
    +<div id="hoverme">
       Hover me
    -  <img id="hoverme" src="book.png" alt="" width="100" height="123" />
    -</div>
    + <img id="hoverme" src="book.png" alt="" width="100" height="123"> +</div> +

    We can create a nice fade effect without the common problem of multiple queued animations by adding .stop(true, true) to the chain:

    -
    $('#hoverme-stop-2').hover(function() {
    -  $(this).find('img').stop(true, true).fadeOut();
    +    
    
    +$( "#hoverme-stop-2" ).hover(function() {
    +  $( this ).find( "img" ).stop( true, true ).fadeOut();
     }, function() {
    -  $(this).find('img').stop(true, true).fadeIn();
    -});
    + $( this ).find( "img" ).stop( true, true ).fadeIn(); +}); +

    Toggling Animations

    As of jQuery 1.7, stopping a toggled animation prematurely with .stop() will trigger jQuery's internal effects tracking. In previous versions, calling the .stop() method before a toggled animation was completed would cause the animation to lose track of its state (if jumpToEnd was false). Any subsequent animations would start at a new "half-way" state, sometimes resulting in the element disappearing. To observe the new behavior, see the final example below.

    @@ -48,58 +52,63 @@ Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned. Another option is to click several buttons to queue them up and see that stop just kills the currently playing one. - - + Click the slideToggle button to start the animation, then click again before the animation is completed. The animation will toggle the other direction from the saved starting point. - - + - \ No newline at end of file + diff --git a/entries/submit-selector.xml b/entries/submit-selector.xml index bda79001..b39c39df 100644 --- a/entries/submit-selector.xml +++ b/entries/submit-selector.xml @@ -13,25 +13,32 @@ Finds all submit elements that are descendants of a td element. '); +// Extra JS to make the HTML easier to edit (None of this is relevant to the ':submit' selector) +$( "#exampleTable" ).find( "td" ).each(function( i, el ) { + var inputEl = $( el ).children(), + inputType = inputEl.attr( "type" ) ? " type='" + inputEl.attr( "type" ) + "'" : "" ; + $( el ).before( "
    " ); }) ]]> - + p { + margin: 0; + color: blue; + } + div,p { + margin-left: 10px; + } + span { + color: red; + } +]]> + If you'd like to prevent forms from being submitted unless a flag variable is set, try: - +}); +]]> To trigger the submit event on the first form on the page, try: - + From 1d1dfdc1bdf7e0ef16e9d38cab0dfd0c68d99dd5 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Thu, 18 Jul 2013 18:02:49 +0100 Subject: [PATCH 250/998] Code indentation and formatting (t entries) --- entries/text-selector.xml | 73 ++++++++++-------- entries/text.xml | 86 +++++++++++++-------- entries/toArray.xml | 32 ++++---- entries/toggle-event.xml | 33 ++++---- entries/toggle.xml | 73 ++++++++++-------- entries/toggleClass.xml | 149 ++++++++++++++++++++++--------------- entries/trigger.xml | 108 ++++++++++++++++----------- entries/triggerHandler.xml | 26 +++---- 8 files changed, 343 insertions(+), 237 deletions(-) diff --git a/entries/text-selector.xml b/entries/text-selector.xml index 833b0a10..5c3d4ff6 100644 --- a/entries/text-selector.xml +++ b/entries/text-selector.xml @@ -7,48 +7,55 @@ Selects all elements of type text. -

    $(':text') allows us to select all <input type="text"> elements. As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':text') is equivalent to $('*:text'), so $('input:text') should be used instead.

    +

    $( ":text" ) allows us to select all <input type="text"> elements. As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":text" ) is equivalent to $( "*:text" ), so $( "input:text" ) should be used instead.

    Note: As of jQuery 1.5.2, :text selects input elements that have no specified type attribute (in which case type="text" is implied).

    -

    This difference in behavior between $(':text') and $('[type=text]'), can be seen below:

    -
    $('<input>').is('[type=text]'); // false
    -$('<input>').is(':text'); // true
    -
    +

    This difference in behavior between $( ":text" ) and $( "[type=text]" ), can be seen below:

    +
    
    +$( "<input>" ).is( "[type=text]"); // false
    +$( "<input>" ).is( ":text" ); // true
    +    
    Finds all text inputs. - + textarea { + height: 25px; + } +]]> + - \ No newline at end of file + diff --git a/entries/text.xml b/entries/text.xml index af97f505..f96966f9 100644 --- a/entries/text.xml +++ b/entries/text.xml @@ -9,33 +9,41 @@ Get the combined text contents of each element in the set of matched elements, including their descendants.

    Unlike the .html() method, .text() can be used in both XML and HTML documents. The result of the .text() method is a string containing the combined text of all matched elements. (Due to variations in the HTML parsers in different browsers, the text returned may vary in newlines and other white space.) Consider the following HTML:

    -
    <div class="demo-container">
    -      <div class="demo-box">Demonstration Box</div>
    +      
    
    +<div class="demo-container">
    +  <div class="demo-box">Demonstration Box</div>
       <ul>
    -  <li>list item 1</li>
    -  <li>list <strong>item</strong> 2</li>
    +    <li>list item 1</li>
    +    <li>list <strong>item</strong> 2</li>
       </ul>
    -  </div>
    -
    -

    The code $('div.demo-container').text() would produce the following result:

    +</div> +
    +

    The code $( "div.demo-container" ).text() would produce the following result:

    Demonstration Box list item 1 list item 2

    -

    The .text() method cannot be used on form inputs or scripts. To set or get the text value of input or textarea elements, use the .val() method. To get the value of a script element, use the .html() method.

    +

    The .text() method cannot be used on form inputs or scripts. To set or get the text value of input or textarea elements, use the .val() method. To get the value of a script element, use the .html() method.

    As of jQuery 1.4, the .text() method returns the value of text and CDATA nodes as well as element nodes.

    Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone). - + p { + color: blue; + margin: 8px; + } + b { + color: red; + } +]]> + @@ -58,41 +66,55 @@ $("p:last").html(str);

    Unlike the .html() method, .text() can be used in both XML and HTML documents.

    We need to be aware that this method escapes the string provided as necessary so that it will render correctly in HTML. To do so, it calls the DOM method .createTextNode(), does not interpret the string as HTML. Consider the following HTML:

    -
    <div class="demo-container">
    +      
    
    +<div class="demo-container">
       <div class="demo-box">Demonstration Box</div>
       <ul>
         <li>list item 1</li>
         <li>list <strong>item</strong> 2</li>
       </ul>
     </div>
    -
    -

    The code $('div.demo-container').text('<p>This is a test.</p>'); will produce the following DOM output:

    -
    <div class="demo-container">
    +      
    +

    The code $( "div.demo-container" ).text( "<p>This is a test.</p>" ); will produce the following DOM output:

    +
    
    +<div class="demo-container">
     &lt;p&gt;This is a test.&lt;/p&gt;
    -</div>
    +</div> +

    It will appear on a rendered page as though the tags were exposed, like this:

    -
    <p>This is a test</p>
    -

    The .text() method cannot be used on input elements. For input field text, use the .val() method.

    +
    
    +<p>This is a test</p>
    +      
    +

    The .text() method cannot be used on input elements. For input field text, use the .val() method.

    As of jQuery 1.4, the .text() method allows us to set the text content by passing in a function.

    -
    $('ul li').text(function(index) {
    -  return 'item number ' + (index + 1);
    -});
    +
    
    +$( "ul li" ).text(function( index ) {
    +  return "item number " + ( index + 1 );
    +});
    +      

    Given an unordered list with three <li> elements, this example will produce the following DOM output:

    -
    <ul>
    +      
    
    +<ul>
       <li>item number 1</li>
       <li>item number 2</li>
       <li>item number 3</li>
     </ul>
    -
    +
    Add text to the paragraph (notice the bold tag is escaped). - + - + p { + color: blue; + margin: 8px; + } +]]> + diff --git a/entries/toArray.xml b/entries/toArray.xml index 9c98f424..73991abe 100644 --- a/entries/toArray.xml +++ b/entries/toArray.xml @@ -7,7 +7,9 @@ Retrieve all the DOM elements contained in the jQuery set, as an array.

    .toArray() returns all of the elements in the jQuery set:

    -
    alert($('li').toArray());
    +
    
    +alert( $( "li" ).toArray() );
    +    

    All of the matched DOM nodes are returned by this call, contained in a standard array:

    [<li id="foo">, <li id="bar">] @@ -16,25 +18,29 @@ Selects all divs in the document and returns the DOM Elements as an Array, then uses the built-in reverse-method to reverse that array. - + +

    One
    +
    Two
    +
    Three
    ]]> + - \ No newline at end of file + diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index 413a6b34..ed329adb 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -16,19 +16,23 @@
    -

    Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

    +

    Note: This method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. jQuery also provides an animation method named .toggle() that toggles the visibility of elements. Whether the animation or the event method is fired depends on the set of arguments passed.

    The .toggle() method binds a handler for the click event, so the rules outlined for the triggering of click apply here as well.

    -
    For example, consider the HTML:
    +    

    For example, consider the HTML:

    +
    
     <div id="target">
       Click here
    -</div>
    +</div> +

    Event handlers can then be bound to the <div>:

    -
    $('#target').toggle(function() {
    -  alert('First handler for .toggle() called.');
    +    
    
    +$( "#target" ).toggle(function() {
    +  alert( "First handler for .toggle() called." );
     }, function() {
    -  alert('Second handler for .toggle() called.');
    -});
    + alert( "Second handler for .toggle() called." ); +}); +

    As the element is clicked repeatedly, the messages alternate:

    First handler for .toggle() called. @@ -46,14 +50,15 @@ Toggle a style on table cells. (Not recommended. Use .toggleClass() instead.): - +); +]]> diff --git a/entries/toggle.xml b/entries/toggle.xml index b112cd3f..34a03db5 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -31,28 +31,32 @@

    -

    Note: The event handling suite also has a method named .toggle(). Which one is fired depends on the set of arguments passed.

    +

    Note: The event handling suite also has a method named .toggle(). Which one is fired depends on the set of arguments passed.

    With no parameters, the .toggle() method simply toggles the visibility of elements:

    -
    $('.target').toggle();
    +
    
    +$( ".target" ).toggle();
    +    

    The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS display property. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

    When a duration, a plain object, or a single "complete" function is provided, .toggle() becomes an animation method. The .toggle() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    We can animate any element, such as a simple image:

    -
    <div id="clickme">
    +    
    
    +<div id="clickme">
       Click here
     </div>
    -<img id="book" src="book.png" alt="" width="100" height="123" />
    -
    +<img id="book" src="book.png" alt="" width="100" height="123"> +

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

    -
    $('#clickme').click(function() {
    -  $('#book').toggle('slow', function() {
    +    
    
    +$( "#clickme" ).click(function() {
    +  $( "#book" ).toggle( "slow", function() {
         // Animation complete.
       });
     });
    -
    +

    With the element initially shown, we can hide it slowly with the first click:

    @@ -70,56 +74,65 @@

    The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:

    -
    $('#foo').toggle(showOrHide);
    +
    
    +$( "#foo" ).toggle( showOrHide );
    +    

    is equivalent to:

    -
    if ( showOrHide == true ) {
    -  $('#foo').show();
    +    
    
    +if ( showOrHide == true ) {
    +  $( "#foo" ).show();
     } else if ( showOrHide == false ) {
    -  $('#foo').hide();
    +  $( "#foo" ).hide();
     }
    -
    +
    Toggles all paragraphs. - +

    Good Bye

    +]]>
    Animates all paragraphs to be shown if they are hidden and hidden if they are visible, completing the animation within 600 milliseconds. - +

    Such interesting text, eh?

    +]]>
    Shows all paragraphs, then hides them all, back and forth. - +

    Good Bye

    +]]>
    diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index ee20f07d..f4be79a0 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -36,87 +36,120 @@

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    <div class="tumble">Some text.</div>
         
    -

    The first time we apply $('div.tumble').toggleClass('bounce'), we get the following:

    -
    <div class="tumble bounce">Some text.</div>
    +    

    The first time we apply $( "div.tumble" ).toggleClass( "bounce" ), we get the following:

    +
    
    +<div class="tumble bounce">Some text.</div>
         
    -

    The second time we apply $('div.tumble').toggleClass('bounce'), the <div> class is returned to the single tumble value:

    +

    The second time we apply $( "div.tumble" ).toggleClass( "bounce" ), the <div> class is returned to the single tumble value:

    <div class="tumble">Some text.</div>
    -

    Applying .toggleClass('bounce spin') to the same <div> alternates between <div class="tumble bounce spin"> and <div class="tumble">.

    +

    Applying .toggleClass( "bounce spin" ) to the same <div> alternates between <div class="tumble bounce spin"> and <div class="tumble">.

    The second version of .toggleClass() uses the second parameter for determining whether the class should be added or removed. If this parameter's value is true, then the class is added; if false, the class is removed. In essence, the statement:

    -
    $('#foo').toggleClass(className, addOrRemove);
    +
    
    +$( "#foo" ).toggleClass(className, addOrRemove);
    +    

    is equivalent to:

    -
    if (addOrRemove) {
    -    $('#foo').addClass(className);
    -  }
    -  else {
    -    $('#foo').removeClass(className);
    -  }
    -  
    +
    
    +if (addOrRemove) {
    +  $( "#foo" ).addClass( className );
    +} else {
    +  $( "#foo" ).removeClass( className );
    +}
    +    

    As of jQuery 1.4, if no arguments are passed to .toggleClass(), all class names on the element the first time .toggleClass() is called will be toggled. Also as of jQuery 1.4, the class name to be toggled can be determined by passing in a function.

    -
    $('div.foo').toggleClass(function() {
    -  if ($(this).parent().is('.bar')) {
    -    return 'happy';
    +    
    
    +$( "div.foo" ).toggleClass(function() {
    +  if ( $( this ).parent().is( ".bar" ) ) {
    +    return "happy";
       } else {
    -    return 'sad';
    +    return "sad";
       }
    -});
    +}); +

    This example will toggle the happy class for <div class="foo"> elements if their parent element has a class of bar; otherwise, it will toggle the sad class.

    Toggle the class 'highlight' when a paragraph is clicked. - + p { + margin: 4px; + font-size: 16px; + font-weight: bolder; + cursor: pointer; + } + .blue { + color: blue; + } + .highlight { + background: yellow; + } +]]> + Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click. - + p { + margin: 4px; + font-size: 16px; + font-weight: bolder; + cursor: pointer; + } + .blue { + color: blue; + } + .highlight { + background: red; + } +]]> + Toggle the class name(s) indicated on the buttons for each div. ' + (this.className || 'none') + ''; + return "
    " + ( this.className || "none" ) + "
    "; }); }; appendClass(); -$('button').on('click', function() { +$( "button" ).on( "click", function() { var tc = this.className || undefined; divs.toggleClass(tc); appendClass(); }); -$('a').on('click', function(event) { +$( "a" ).on( "click", function( event ) { event.preventDefault(); - divs.empty().each(function(i) { - this.className = cls[i]; + divs.empty().each(function( i ) { + this.className = cls[ i ]; }); appendClass(); }); @@ -165,4 +198,4 @@ $('a').on('click', function(event) { - \ No newline at end of file + diff --git a/entries/trigger.xml b/entries/trigger.xml index 88a70757..3c7a1ba5 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -16,7 +16,7 @@ 1.3 - A jQuery.Event object. + A jQuery.Event object. @@ -26,18 +26,21 @@

    Any event handlers attached with .on() or one of its shortcut methods are triggered when the corresponding event occurs. They can be fired manually, however, with the .trigger() method. A call to .trigger() executes the handlers in the same order they would be if the event were triggered naturally by the user:

    -
    $('#foo').on('click', function() {
    -      alert($(this).text());
    -    });
    -    $('#foo').trigger('click');
    -

    As of jQuery 1.3, .trigger()ed events bubble up the DOM tree; an event handler can stop the bubbling by returning false from the handler or calling the .stopPropagation() method on the event object passed into the event. Although .trigger() simulates an event activation, complete with a synthesized event object, it does not perfectly replicate a naturally-occurring event.

    -

    To trigger handlers bound via jQuery without also triggering the native event, use .triggerHandler() instead.

    +
    
    +$( "#foo" ).on( "click", function() {
    +  alert( $( this ).text() );
    +});
    +$( "#foo" ).trigger( "click" );
    +   
    +

    As of jQuery 1.3, .trigger()ed events bubble up the DOM tree; an event handler can stop the bubbling by returning false from the handler or calling the .stopPropagation() method on the event object passed into the event. Although .trigger() simulates an event activation, complete with a synthesized event object, it does not perfectly replicate a naturally-occurring event.

    +

    To trigger handlers bound via jQuery without also triggering the native event, use .triggerHandler() instead.

    When we define a custom event type using the .on() method, the second argument to .trigger() can become useful. For example, suppose we have bound a handler for the custom event to our element instead of the built-in click event as we did above:

    -
    $('#foo').on('custom', function(event, param1, param2) {
    -  alert(param1 + "\n" + param2);
    +    
    
    +$( "#foo" ).on( "custom", function(event, param1, param2) {
    +  alert( param1 + "\n" + param2 );
     });
    -$('#foo').trigger('custom', ['Custom', 'Event']);
    -
    +$( "#foo").trigger( "custom", [ "Custom", "Event" ] ); +

    The event object is always passed as the first parameter to an event handler. An array of arguments can also be passed to the .trigger() call, and these parameters will be passed along to the handler as well following the event object. As of jQuery 1.6.2, single string or numeric argument can be passed without being wrapped in an array.

    Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

    The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

    @@ -46,67 +49,84 @@ $('#foo').trigger('custom', ['Custom', 'Event']); Clicks to button #2 also trigger a click for button #1. - +
    0 button #2 clicks.
    +]]>
    To submit the first form without using the submit() function, try: - + To submit the first form without using the submit() function, try: - + // Perform an action... +} +]]>
    To pass arbitrary data to an event: - + To pass arbitrary data through an event object: - +$( "body" ).trigger( event ); +]]> Alternative way to pass data through an event object: - + diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index b3d462e5..a470e31f 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -19,28 +19,28 @@
  • Events created with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.
  • Instead of returning the jQuery object (to allow chaining), .triggerHandler() returns whatever value was returned by the last handler it caused to be executed. If no handlers are triggered, it returns undefined
  • -

    For more information on this method, see the discussion for .trigger().

    +

    For more information on this method, see the discussion for .trigger().

    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. - + +]]> - \ No newline at end of file + From 4883288654d4883275eea461295ad634e016779b Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Fri, 19 Jul 2013 11:41:52 +0100 Subject: [PATCH 251/998] Code indentation and formatting (u - w entries) --- entries/unbind.xml | 115 +++++++++++++-------- entries/undelegate.xml | 70 +++++++------ entries/unload.xml | 15 ++- entries/unwrap.xml | 22 ++-- entries/val.xml | 188 ++++++++++++++++++++--------------- entries/visible-selector.xml | 48 +++++---- entries/width.xml | 95 +++++++++++------- entries/wrap.xml | 144 ++++++++++++++++++--------- entries/wrapAll.xml | 122 ++++++++++++++++------- entries/wrapInner.xml | 122 +++++++++++++++-------- 10 files changed, 592 insertions(+), 349 deletions(-) diff --git a/entries/unbind.xml b/entries/unbind.xml index a4f6b5db..7f41e1c9 100644 --- a/entries/unbind.xml +++ b/entries/unbind.xml @@ -27,51 +27,67 @@ -

    Event handlers attached with .bind() can be removed with .unbind(). (As of jQuery 1.7, the .on() and .off() methods are preferred to attach and remove event handlers on elements.) In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements:

    -
    $('#foo').unbind();
    +

    Event handlers attached with .bind() can be removed with .unbind(). (As of jQuery 1.7, the .on() and .off() methods are preferred to attach and remove event handlers on elements.) In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements:

    +
    
    +$( "#foo" ).unbind();
    +    

    This version removes the handlers regardless of type. To be more precise, we can pass an event type:

    -
    $('#foo').unbind('click');
    +
    
    +$( "#foo").unbind( "click" );
    +    

    By specifying the click event type, only handlers for that event type will be unbound. This approach can still have negative ramifications if other scripts might be attaching behaviors to the same element, however. Robust and extensible applications typically demand the two-argument version for this reason:

    -
    var handler = function() {
    -  alert('The quick brown fox jumps over the lazy dog.');
    +    
    
    +var handler = function() {
    +  alert( "The quick brown fox jumps over the lazy dog." );
     };
    -$('#foo').bind('click', handler);
    -$('#foo').unbind('click', handler);
    -
    +$( "#foo" ).bind( "click", handler ); +$( "#foo" ).unbind( "click", handler ); +

    By naming the handler, we can be assured that no other functions are accidentally removed. Note that the following will not work:

    -
    $('#foo').bind('click', function() {
    -  alert('The quick brown fox jumps over the lazy dog.');
    +    
    
    +$( "#foo" ).bind( "click", function() {
    +  alert( "The quick brown fox jumps over the lazy dog." );
     });
     
    -// will NOT work
    -$('#foo').unbind('click', function() {
    -  alert('The quick brown fox jumps over the lazy dog.');
    -});
    +// Will NOT work +$( "#foo" ).unbind( "click", function() { + alert( "The quick brown fox jumps over the lazy dog." ); +}); +

    Even though the two functions are identical in content, they are created separately and so JavaScript is free to keep them as distinct function objects. To unbind a particular handler, we need a reference to that function and not a different one that happens to do the same thing.

    Note: Using a proxied function to unbind an event on an element will unbind all proxied functions on that element, as the same proxy function is used for all proxied events. To allow unbinding a specific event, use unique class names on the event (e.g. click.proxy1, click.proxy2) when attaching them.

    Using Namespaces

    Instead of maintaining references to handlers in order to unbind them, we can namespace the events and use this capability to narrow the scope of our unbinding actions. As shown in the discussion for the .bind() method, namespaces are defined by using a period (.) character when binding a handler:

    -
    $('#foo').bind('click.myEvents', handler);
    +
    
    +$( "#foo" ).bind( "click.myEvents", handler);
    +    

    When a handler is bound in this fashion, we can still unbind it the normal way:

    -
    $('#foo').unbind('click');
    +
    
    +$( "#foo" ).unbind( "click" );
    +    

    However, if we want to avoid affecting other handlers, we can be more specific:

    -
    $('#foo').unbind('click.myEvents');
    +
    
    +$( "#foo" ).unbind( "click.myEvents" );
    +    

    We can also unbind all of the handlers in a namespace, regardless of event type:

    -
    $('#foo').unbind('.myEvents');
    +
    
    +$( "#foo" ).unbind( ".myEvents" );
    +    

    It is particularly useful to attach namespaces to event bindings when we are developing plug-ins or otherwise writing code that may interact with other event-handling code in the future.

    Using the Event Object

    The third form of the .unbind() method is used when we wish to unbind a handler from within itself. For example, suppose we wish to trigger an event handler only three times:

    -
    var timesClicked = 0;
    -$('#foo').bind('click', function(event) {
    -  alert('The quick brown fox jumps over the lazy dog.');
    +    
    
    +var timesClicked = 0;
    +$( "#foo" ).bind( "click", function( event ) {
    +  alert( "The quick brown fox jumps over the lazy dog." );
       timesClicked++;
    -  if (timesClicked >= 3) {
    -    $(this).unbind(event);
    +  if ( timesClicked >= 3 ) {
    +    $( this ).unbind( event );
       }
     });
    -
    +

    The handler in this case must take a parameter, so that we can capture the event object and use it to unbind the handler after the third click. The event object contains the context necessary for .unbind() to know which handler to remove. This example is also an illustration of a closure. Since the handler refers to the timesClicked variable, which is defined outside the function, incrementing the variable has an effect even between invocations of the handler.

    @@ -79,46 +95,57 @@ This example is also an illustration of a closure. Since the handler refers to t Can bind and unbind events to the colored button. - +
    Click!
    +]]> To unbind all events from all paragraphs, write: - + To unbind all click events from all paragraphs, write: - + To unbind just one previously bound handler, pass the function in as the second argument: - +$( "p" ).unbind( "click", foo ); // ... foo will no longer be called. +]]> diff --git a/entries/undelegate.xml b/entries/undelegate.xml index b853b570..c542d456 100644 --- a/entries/undelegate.xml +++ b/entries/undelegate.xml @@ -42,67 +42,79 @@ -

    The .undelegate() method is a way of removing event handlers that have been bound using .delegate(). As of jQuery 1.7, the .on() and .off() methods are preferred for attaching and removing event handlers.

    +

    The .undelegate() method is a way of removing event handlers that have been bound using .delegate(). As of jQuery 1.7, the .on() and .off() methods are preferred for attaching and removing event handlers.

    Can bind and unbind events to the colored button. - +
    Click!
    +]]>
    To unbind all delegated events from all paragraphs, write: - + To unbind all delegated click events from all paragraphs, write: - + To undelegate just one previously bound handler, pass the function in as the third argument: - +$( "body" ).undelegate( "p", "click", foo ); +]]> To unbind all delegated events by their namespace: - +// Unbind all events delegated under the ".whatever" namespace +$("form").undelegate(".whatever"); +]]> diff --git a/entries/unload.xml b/entries/unload.xml index 3594eb75..70cb37d0 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -18,23 +18,28 @@ Bind an event handler to the "unload" JavaScript event. -

    This method is a shortcut for .on('unload', handler).

    +

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

    The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

    The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers, and contrasted with the proprietary beforeunload event.

    Any unload event handler should be bound to the window object:

    -
    $(window).unload(function() {
    -  alert('Handler for .unload() called.');
    +    
    
    +$( window ).unload(function() {
    +  alert( "Handler for .unload() called." );
     });
    -
    +

    After this code executes, the alert will be displayed whenever the browser leaves the current page. It is not possible to cancel the unload event with .preventDefault(). This event is available so that scripts can perform cleanup when the user leaves the page.

    To display an alert when a page is unloaded: - + diff --git a/entries/unwrap.xml b/entries/unwrap.xml index 28e2ae94..48a1765d 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -11,18 +11,24 @@ Wrap/unwrap a div around each of the paragraphs. +}); +]]> + div { + border: 2px solid blue; + } + p { + background: yellow; + margin: 4px; + } +]]>
    +

    For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

    +
    
    +$( "select.foo option:selected").val();    // Get the value from a dropdown select
    +$( "select.foo" ).val();                    // Get the value from a dropdown select even easier
    +$( "input:checkbox:checked" ).val();        // Get the value from a checked checkbox
    +$( "input:radio[name=bar]:checked" ).val(); // Get the value from a set of radio buttons
    +      

    Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

    @@ -26,56 +28,65 @@ $.valHooks.textarea = { return elem.value.replace( /\r?\n/g, "\r\n" ); } }; - +
    Get the single value from a single select and an array of values from a multiple select and display their values. Single: " + - singleValues + - " Multiple: " + - multipleValues.join(", ")); - } - - $("select").change(displayVals); - displayVals(); +function displayVals() { + var singleValues = $( "#single" ).val(); + var multipleValues = $( "#multiple" ).val() || []; + $( "p" ).html( "Single: " + singleValues + + " Multiple: " + multipleValues.join( ", " ) ); +} +$("select").change(displayVals); +displayVals(); ]]> - + Find the value of an input box. - + p { + color: blue; + margin: 8px; + } +]]> + @@ -103,71 +114,84 @@ $.valHooks.textarea = {

    This method is typically used to set the values of form fields.

    Passing an array of element values allows matching <input type="checkbox">, <input type="radio"> and <option>s inside of n <select multiple="multiple"> to be selected. In the case of <input type="radio">s that are part of a radio group and <select multiple="multiple"> the other elements will be deselected.

    The .val() method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

    -
    $('input:text.items').val(function( index, value ) {
    -  return value + ' ' + this.className;
    +      
    
    +$( "input:text.items" ).val(function( index, value ) {
    +  return value + " " + this.className;
     });
    -
    +

    This example appends the string " items" to the text inputs' values.

    Set the value of an input box. - + button { + margin: 4px; + cursor: pointer; + } + input { + margin: 4px; + color: blue; + } +]]> + Use the function argument to modify the value of an input box. +}); +]]> Set a single select, a multiple select, checkboxes and a radio button . - + + + +
    + check1 + check2 + radio1 + radio2 +]]>
    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index 34c14f2e..ecd43762 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -9,35 +9,43 @@

    Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

    -

    Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    -

    During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    +

    Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    +

    During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    Make all visible divs turn yellow on click. - + div { + width: 50px; + height: 40px; + margin: 5px; + border: 3px outset green; + float: left; + } + .starthidden { + display: none; + } +]]> + - \ No newline at end of file + diff --git a/entries/width.xml b/entries/width.xml index 707452d7..0427f961 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -13,42 +13,54 @@

    This method is also able to find the width of the window and document.

    -
    $(window).width();   // returns width of browser viewport
    -      $(document).width(); // returns width of HTML document
    -

    Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS width plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css("width") rather than .width().

    +
    
    +$( window ).width();   // Returns width of browser viewport
    +$( document ).width(); // Returns width of HTML document
    +      
    +

    Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS width plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "width" ) rather than .width().

    Show various widths. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. - + body { + background: yellow; + } + button { + font-size: 12px; + margin: 2px; + } + p { + width: 150px; + border: 1px red solid; + } + div { + color: red; + font-weight: bold; + } +]]> + @@ -82,23 +94,32 @@ $("#getw").click(function () { + div { + width: 70px; + height: 50px; + float: left; + margin: 5px; + background: red; + cursor: pointer; + } + .mod { + background: blue; + cursor: default; + } +]]> diff --git a/entries/wrap.xml b/entries/wrap.xml index 4db0e15a..2a681020 100644 --- a/entries/wrap.xml +++ b/entries/wrap.xml @@ -21,85 +21,137 @@

    The .wrap() function can take any string or object that could be passed to the $() factory function to specify a DOM structure. This structure may be nested several levels deep, but should contain only one inmost element. A copy of this structure will be wrapped around each of the elements in the set of matched elements. This method returns the original set of elements for chaining purposes.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    Using .wrap(), we can insert an HTML structure around the inner <div> elements like so:

    -
    $('.inner').wrap('<div class="new" />');
    +
    
    +$( ".inner" ).wrap( "<div class='new' />" );
    +    

    The new <div> element is created on the fly and added to the DOM. The result is a new <div> wrapped around each matched element:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="new">
         <div class="inner">Hello</div>
       </div>
       <div class="new">
         <div class="inner">Goodbye</div>
       </div>
    -</div>
    +</div> +

    The second version of this method allows us to instead specify a callback function. This callback function will be called once for every matched element; it should return a DOM element, jQuery object, or HTML snippet in which to wrap the corresponding element. For example:

    -
    $('.inner').wrap(function() {
    -  return '<div class="' + $(this).text() + '" />';
    -});
    +
    
    +$( ".inner" ).wrap(function() {
    +  return "<div class='" + $( this ).text() + "' />";
    +});
    +    

    This will cause each <div> to have a class corresponding to the text it wraps:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="Hello">
         <div class="inner">Hello</div>
       </div>
       <div class="Goodbye">
         <div class="inner">Goodbye</div>
       </div>
    -</div>
    +</div> +
    Wrap a new div around all of the paragraphs. - + - + div { + border: 2px solid blue; + } + p { + background: yellow; + margin: 4px; + } +]]> + - - + Wraps a newly created tree of objects around the spans. Notice anything in between the spans gets left out like the <strong> (red text) in this example. Even the white space between spans is left out. Click View Source to see the original html.> + - + div { + border: 2px blue solid; + margin: 2px; + padding: 2px; + } + p { + background: yellow; + margin: 2px; + padding: 2px; + } + strong { + color: red; + } +]]> + Wrap a new div around all of the paragraphs. - + - + div { + border: 2px solid blue; + } + p { + background: yellow; + margin: 4px; + } +]]> + Wrap a jQuery object double depth div around all of the paragraphs. Notice it doesn't move the object but just clones it to wrap around its target. - + - + div { + border: 2px solid blue; + margin: 2px; + padding: 2px; + } + .doublediv { + border-color: red; + } + p { + background: yellow; + margin: 4px; + font-size: 14px; + } +]]> + diff --git a/entries/wrapAll.xml b/entries/wrapAll.xml index 20b22446..2c62bf95 100644 --- a/entries/wrapAll.xml +++ b/entries/wrapAll.xml @@ -15,12 +15,16 @@

    The .wrapAll() function can take any string or object that could be passed to the $() function to specify a DOM structure. This structure may be nested several levels deep, but should contain only one inmost element. The structure will be wrapped around all of the elements in the set of matched elements, as a single group.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    Using .wrapAll(), we can insert an HTML structure around the inner <div> elements like so:

    -
    $('.inner').wrapAll('<div class="new" />');
    +
    
    +$( ".inner" ).wrapAll( "<div class='new' />");
    +    

    The new <div> element is created on the fly and added to the DOM. The result is a new <div> wrapped around all matched elements:

    <div class="container">
       <div class="new">
    @@ -31,54 +35,96 @@
       
       
         Wrap a new div around all of the paragraphs.
    -    
    +    
         
    -    
    +  div {
    +    border: 2px solid blue;
    +  }
    +  p {
    +    background: yellow;
    +    margin: 4px;
    +  }
    +]]>
    +    
       
       
         Wraps a newly created tree of objects around the spans.  Notice anything in between the spans gets left out like the <strong> (red text) in this example.  Even the white space between spans is left out.  Click View Source to see the original html.
    -    
    +    
         
    -    
    +  div {
    +    border: 2px blue solid;
    +    margin: 2px;
    +    padding: 2px;
    +  }
    +  p {
    +    background: yellow;
    +    margin: 2px;
    +    padding: 2px;
    +  }
    +  strong {
    +    color: red;
    +  }
    +]]>
    +    
       
       
         Wrap a new div around all of the paragraphs.
    -    
    +    
         
    -    
    +  div {
    +    border: 2px solid blue;
    +  }
    +  p {
    +    background: yellow;
    +    margin: 4px;
    +  }
    +]]>
    +    
       
       
         Wrap a jQuery object double depth div around all of the paragraphs.  Notice it doesn't move the object but just clones it to wrap around its target.
    -    
    +    
         
    -    
    +  div {
    +    border: 2px solid blue;
    +    margin: 2px;
    +    padding: 2px;
    +  }
    +  .doublediv {
    +    border-color: red;
    +  }
    +  p {
    +    background: yellow;
    +    margin: 4px;
    +    font-size: 14px;
    +  }
    +]]>
    +    
       
       
       
    diff --git a/entries/wrapInner.xml b/entries/wrapInner.xml
    index 4484bf6c..e252bcb6 100644
    --- a/entries/wrapInner.xml
    +++ b/entries/wrapInner.xml
    @@ -17,82 +17,124 @@
       
         

    The .wrapInner() function can take any string or object that could be passed to the $() factory function to specify a DOM structure. This structure may be nested several levels deep, but should contain only one inmost element. The structure will be wrapped around the content of each of the elements in the set of matched elements.

    Consider the following HTML:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">Hello</div>
       <div class="inner">Goodbye</div>
    -</div>
    +</div> +

    Using .wrapInner(), we can insert an HTML structure around the content of each inner <div> elements like so:

    -
    $('.inner').wrapInner('<div class="new" />');
    +
    
    +$( ".inner" ).wrapInner( "<div class='new' />");
    +    

    The new <div> element is created on the fly and added to the DOM. The result is a new <div> wrapped around the content of each matched element:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">
         <div class="new">Hello</div>
       </div>
       <div class="inner">
         <div class="new">Goodbye</div>
       </div>
    -</div>
    +</div> +

    The second version of this method allows us to instead specify a callback function. This callback function will be called once for every matched element; it should return a DOM element, jQuery object, or HTML snippet in which to wrap the content of the corresponding element. For example:

    -
    $('.inner').wrapInner(function() {
    -  return '<div class="' + this.nodeValue + '" />';
    -});
    +
    
    +$( ".inner" ).wrapInner(function() {
    +  return "<div class='" + this.nodeValue + "' />";
    +});
    +    

    This will cause each <div> to have a class corresponding to the text it wraps:

    -
    <div class="container">
    +    
    
    +<div class="container">
       <div class="inner">
         <div class="Hello">Hello</div>
       </div>
       <div class="inner">
         <div class="Goodbye">Goodbye</div>
       </div>
    -</div>
    +</div> +

    Note: When passing a selector string to the .wrapInner() function, the expected input is well formed HTML with correctly closed tags. Examples of valid input include:

    
    -$(elem).wrapInner("<div class='test' />");
    -$(elem).wrapInner("<div class='test'></div>");
    -$(elem).wrapInner("<div class=\"test\"></div>");
    +$( elem ).wrapInner( "<div class='test' />" );
    +$( elem ).wrapInner( "<div class='test'></div>" );
    +$( elem ).wrapInner( "<div class=\"test\"></div>" );
         
    Selects all paragraphs and wraps a bold tag around each of its contents. - - - + + + Wraps a newly created tree of objects around the inside of the body. - + - + div { + border: 2px green solid; + margin: 2px; + padding: 2px; + } + p { + background: yellow; + margin: 2px; + padding: 2px; + } +]]> + Selects all paragraphs and wraps a bold tag around each of its contents. - - - + + + Selects all paragraphs and wraps a jQuery object around each of its contents. - + - + p { + background: #9f9; + } + .red { + color: red; + } +]]> + - \ No newline at end of file + From 437d3fc3e7f318ba59bf00c57b7d423fa121cb7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 14 Sep 2013 16:15:38 -0400 Subject: [PATCH 252/998] Cleanup. --- entries/animate.xml | 2 +- entries/focusin.xml | 4 +- entries/jQuery.Callbacks.xml | 11 +- entries/jQuery.ajax.xml | 58 ++++---- entries/jQuery.ajaxPrefilter.xml | 4 +- entries/jQuery.ajaxTransport.xml | 12 +- entries/jQuery.boxModel.xml | 2 +- entries/jQuery.browser.xml | 4 +- entries/jQuery.cssHooks.xml | 226 +++++++++++++++-------------- entries/jQuery.data.xml | 35 ++--- entries/jQuery.dequeue.xml | 15 +- entries/jQuery.each.xml | 9 +- entries/jQuery.extend.xml | 16 +- entries/jQuery.fx.interval.xml | 2 +- entries/jQuery.fx.off.xml | 4 +- entries/jQuery.get.xml | 11 +- entries/jQuery.getJSON.xml | 21 ++- entries/jQuery.getScript.xml | 40 ++--- entries/jQuery.grep.xml | 10 +- entries/jQuery.isFunction.xml | 5 +- entries/jQuery.isNumeric.xml | 2 +- entries/jQuery.makeArray.xml | 7 +- entries/jQuery.map.xml | 8 +- entries/jQuery.noConflict.xml | 17 ++- entries/jQuery.param.xml | 27 ++-- entries/jQuery.parseHTML.xml | 2 +- entries/jQuery.parseXML.xml | 6 +- entries/jQuery.post.xml | 21 ++- entries/jQuery.proxy.xml | 11 +- entries/jQuery.queue.xml | 51 ++++--- entries/jQuery.removeData.xml | 4 +- entries/jQuery.sub.xml | 10 +- entries/jQuery.trim.xml | 6 +- entries/jQuery.type.xml | 2 +- entries/jQuery.unique.xml | 3 +- entries/jQuery.when.xml | 10 +- entries/jQuery.xml | 16 +- entries/jquery-2.xml | 4 +- entries/keydown.xml | 8 +- entries/keypress.xml | 6 +- entries/keyup.xml | 4 +- entries/last-child-selector.xml | 2 +- entries/length.xml | 18 ++- entries/live.xml | 17 ++- entries/load-event.xml | 4 +- entries/load.xml | 7 +- entries/map.xml | 17 ++- entries/mouseenter.xml | 3 +- entries/mouseleave.xml | 11 +- entries/mousemove.xml | 16 +- entries/mouseup.xml | 3 +- entries/multiple-selector.xml | 5 +- entries/next-adjacent-Selector.xml | 8 +- entries/next.xml | 2 +- entries/nextUntil.xml | 4 +- entries/not-selector.xml | 2 +- entries/off.xml | 14 +- entries/offset.xml | 8 +- entries/on.xml | 10 +- entries/one.xml | 4 +- entries/outerHeight.xml | 4 +- entries/outerWidth.xml | 4 +- entries/parent.xml | 4 +- entries/parents.xml | 12 +- entries/parentsUntil.xml | 4 +- entries/password-selector.xml | 4 +- entries/position.xml | 2 +- entries/prepend.xml | 6 +- entries/promise.xml | 6 +- entries/prop.xml | 15 +- entries/queue.xml | 68 ++++----- entries/radio-selector.xml | 13 +- entries/ready.xml | 2 +- entries/removeAttr.xml | 2 +- entries/removeProp.xml | 10 +- entries/replaceAll.xml | 8 +- entries/reset-selector.xml | 11 +- entries/selected-selector.xml | 15 +- entries/serializeArray.xml | 10 +- entries/show.xml | 9 +- entries/size.xml | 3 +- entries/slice.xml | 6 +- entries/slideDown.xml | 15 +- entries/stop.xml | 7 +- entries/submit-selector.xml | 6 +- entries/submit.xml | 20 +-- entries/text-selector.xml | 16 +- entries/text.xml | 2 +- entries/toggle.xml | 6 +- entries/toggleClass.xml | 13 +- entries/trigger.xml | 6 +- entries/unbind.xml | 15 +- entries/undelegate.xml | 9 +- entries/unload.xml | 2 +- entries/unwrap.xml | 2 +- entries/val.xml | 23 ++- entries/width.xml | 23 +-- entries/wrap.xml | 4 +- entries/wrapAll.xml | 8 +- entries/wrapInner.xml | 5 +- 100 files changed, 689 insertions(+), 582 deletions(-) diff --git a/entries/animate.xml b/entries/animate.xml index fffcb68c..d05f366e 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -66,7 +66,7 @@ $( "#clickme" ).click(function() {

    The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

    Directional properties (top, right, bottom, left) have no discernible effect on elements if their position style property is static, which it is by default.

    -

    Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

    +

    Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

    Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

    diff --git a/entries/focusin.xml b/entries/focusin.xml index dca9e850..e441a4e4 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -19,8 +19,8 @@

    This method is a shortcut for .on('focusin', handler).

    -

    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.

    +

    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/jQuery.Callbacks.xml b/entries/jQuery.Callbacks.xml index 4185b962..8443476b 100644 --- a/entries/jQuery.Callbacks.xml +++ b/entries/jQuery.Callbacks.xml @@ -106,7 +106,7 @@ foobar var callbacks = $.Callbacks( "unique" ); callbacks.add( fn1 ); callbacks.fire( "foo" ); -callbacks.add( fn1 ); // repeat addition +callbacks.add( fn1 ); // Repeat addition callbacks.add( fn2 ); callbacks.fire( "bar" ); callbacks.remove( fn2 ); @@ -122,12 +122,12 @@ foobar

    $.Callbacks( "stopOnFalse" ):

    
    -function fn1( value ){
    +function fn1( value ) {
       console.log( value );
       return false;
     }
     
    -function fn2( value ){
    +function fn2( value ) {
       fn1( "fn2 says: " + value );
       return false;
     }
    @@ -163,7 +163,7 @@ function fn2( value ) {
     var callbacks = $.Callbacks( "unique memory" );
     callbacks.add( fn1 );
     callbacks.fire( "foo" );
    -callbacks.add( fn1 ); // repeat addition
    +callbacks.add( fn1 ); // Repeat addition
     callbacks.add( fn2 );
     callbacks.fire( "bar" );
     callbacks.add( fn2 );
    @@ -201,8 +201,7 @@ remove( fn1 );
     var topics = {};
     
     jQuery.Topic = function( id ) {
    -  var callbacks,
    -    method,
    +  var callbacks, method,
         topic = id && topics[ id ];
     
       if ( !topic ) {
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index fe1f8939..3816729e 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -14,7 +14,7 @@
       
         1.0
         
    -      A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
    +      A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
           
             The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
           
    @@ -79,10 +79,10 @@ $.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."  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."  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. 
           
           
    -        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.
    +        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.
           
           
             An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here.  Values in the headers setting can also be overwritten from within the beforeSend function.
    @@ -154,18 +154,16 @@ $.ajax({
           
           
             
    -          

    An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. -

    
    +          

    An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed.

    +
    
     $.ajax({
        url: a_cross_domain_url,
        xhrFields: {
           withCredentials: true
        }
     });
    -            
    -

    In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. -

    -

    +
    +

    In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it.

    @@ -190,11 +188,11 @@ $.ajax({ } }) .done(function( data ) { - if( console && console.log ) { + if ( console && console.log ) { console.log( "Sample of data:", data.slice( 0, 100 ) ); } }); -
    +

    The jqXHR objects returned by $.ajax() as of jQuery 1.5 implement the Promise interface, giving them all the properties, methods, and behavior of a Promise (see Deferred object for more information). These methods take one or more function arguments that are called when the $.ajax() request terminates. This allows you to assign multiple callbacks on a single request, and even to assign callbacks after the request may have completed. (If the request is already complete, the callback is fired immediately.) Available Promise methods of the jqXHR object include:

    • @@ -222,22 +220,22 @@ $.ajax({
      
       // Assign handlers immediately after making the request,
      -// and remember the jqxhr object for this request
      +// and remember the jqXHR object for this request
       var jqxhr = $.ajax( "example.php" )
         .done(function() {
           alert( "success" );
      -})
      +  })
         .fail(function() {
           alert( "error" );
      -})
      +  })
         .always(function() {
           alert( "complete" );
      -});
      +  });
       
      -// perform other work here ...
      +// Perform other work here ...
       
       // Set another completion function for the request above
      - jqxhr.always(function() {
      +jqxhr.always(function() {
         alert( "second complete" );
       });
           
      @@ -308,7 +306,8 @@ var jqxhr = $.ajax( "example.php" )
      
       (function() {
         var _super = jQuery.ajaxSettings.xhr,
      -    xhrCorsHeaders = [ "Cache-Control", "Content-Language", "Content-Type", "Expires", "Last-Modified", "Pragma" ];
      +    xhrCorsHeaders = [ "Cache-Control", "Content-Language", "Content-Type",
      +      "Expires", "Last-Modified", "Pragma" ];
       
         jQuery.ajaxSettings.xhr = function() {
           var xhr = _super(),
      @@ -321,8 +320,7 @@ var jqxhr = $.ajax( "example.php" )
               if ( allHeaders ) {
                 return allHeaders;
               }
      -      } catch ( e ) {
      -      }
      +      } catch ( e ) {}
       
             $.each( xhrCorsHeaders, function( i, headerName ) {
               if ( xhr.getResponseHeader( headerName ) ) {
      @@ -349,7 +347,7 @@ $.ajaxSetup({
         },
         converters: {
           "mycustomtype json": function( result ) {
      -      // do stuff
      +      // Do stuff
             return newresult;
           }
         }
      @@ -365,7 +363,7 @@ $.ajaxSetup({
         converters: {
           "text mycustomtype": true,
           "mycustomtype json": function( result ) {
      -      // do stuff
      +      // Do stuff
             return newresult;
           }
         }
      @@ -382,9 +380,10 @@ $.ajax({
         type: "POST",
         url: "some.php",
         data: { name: "John", location: "Boston" }
      -}).done(function( msg ) {
      -  alert( "Data Saved: " + msg );
      -});
      +})
      +  .done(function( msg ) {
      +    alert( "Data Saved: " + msg );
      +  });
       ]]>
         
         
      @@ -393,9 +392,10 @@ $.ajax({
       $.ajax({
         url: "test.html",
         cache: false
      -}).done(function( html ) {
      -  $( "#results" ).append( html );
      -});
      +})
      +  .done(function( html ) {
      +    $( "#results" ).append( html );
      +  });
       ]]>
         
         
      @@ -409,7 +409,7 @@ var xmlRequest = $.ajax({
         data: xmlDocument
       });
       
      -xmlRequest.done(handleResponse);
      +xmlRequest.done( handleResponse );
       ]]>
         
         
      diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml
      index 02760c13..405811bc 100644
      --- a/entries/jQuery.ajaxPrefilter.xml
      +++ b/entries/jQuery.ajaxPrefilter.xml
      @@ -14,7 +14,7 @@
         
           

      A typical prefilter registration using $.ajaxPrefilter() looks like this:

      
      -$.ajaxPrefilter( function( options, originalOptions, jqXHR ) {
      +$.ajaxPrefilter(function( options, originalOptions, jqXHR ) {
         // Modify options, control originalOptions, store jqXHR, etc
       });
           
      @@ -39,7 +39,7 @@ $.ajaxPrefilter(function( options, originalOptions, jqXHR ) {

      Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through http://mydomain.net/proxy/:

      
      -$.ajaxPrefilter( function( options ) {
      +$.ajaxPrefilter(function( options ) {
         if ( options.crossDomain ) {
           options.url = "http://mydomain.net/proxy/" + encodeURIComponent( options.url );
           options.crossDomain = false;
      diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml
      index d0b5c9eb..d44730d3 100644
      --- a/entries/jQuery.ajaxTransport.xml
      +++ b/entries/jQuery.ajaxTransport.xml
      @@ -16,7 +16,7 @@
           

      Since each request requires its own transport object instance, transports cannot be registered directly. Therefore, you should provide a function that returns a transport instead.

      Transports factories are registered using $.ajaxTransport(). A typical registration looks like this:

      
      -$.ajaxTransport( function( options, originalOptions, jqXHR ) {
      +$.ajaxTransport(function( options, originalOptions, jqXHR ) {
         if( /* transportCanHandleRequest */ ) {
           return {
             send: function( headers, completeCallback ) {
      @@ -51,7 +51,7 @@ function( status, statusText, responses, headers ) {}
           

      Just like prefilters, a transport's factory function can be attached to a specific dataType:

      
       $.ajaxTransport( "script", function( options, originalOptions, jqXHR ) {
      -    // Will only be called for script requests
      +  // Will only be called for script requests
       });
           

      The following example shows how a minimal image transport could be implemented:

      @@ -64,8 +64,8 @@ $.ajaxTransport( "image", function( s ) { image = new Image(); function done( status ) { if ( image ) { - var statusText = ( status == 200 ) ? "success" : "error", - tmp = image; + var statusText = ( status === 200 ) ? "success" : "error", + tmp = image; image = image.onreadystatechange = image.onerror = image.onload = null; callback( status, statusText, { image: tmp } ); } @@ -93,9 +93,9 @@ $.ajaxTransport( "image", function( s ) {

      The unminified jQuery source itself includes a list of default converters, which effectively illustrates how they can be used:

      
       // List of data converters
      -// 1) key format is "source_type destination_type"
      +// 1) Key format is "source_type destination_type"
       //    (a single space in-between)
      -// 2) the catchall symbol "*" can be used for source_type
      +// 2) The catchall symbol "*" can be used for source_type
       converters: {
         // Convert anything to text
         "* text": window.String,
      diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml
      index 424fdfd7..18411216 100644
      --- a/entries/jQuery.boxModel.xml
      +++ b/entries/jQuery.boxModel.xml
      @@ -4,7 +4,7 @@
         
           1.0
         
      -  Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.
      +  Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.
         
         
           Returns the box model for the iframe.
      diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml
      index 7a2a7e92..eb535b35 100644
      --- a/entries/jQuery.browser.xml
      +++ b/entries/jQuery.browser.xml
      @@ -23,7 +23,7 @@
           
             Show the browser info.
             
           
      diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml
      index 57d91b41..8252bfa5 100644
      --- a/entries/jQuery.cssHooks.xml
      +++ b/entries/jQuery.cssHooks.xml
      @@ -12,106 +12,117 @@
           

      Defining a new css hook is straight-forward. The skeleton template below can serve as a guide to creating your own.

      
       (function( $ ) {
      -  // First, check to see if cssHooks are supported
      -  if ( !$.cssHooks ) {
      -    // If not, output an error message
      -    throw("jQuery 1.4.3 or above is required for this plugin to work");
      -    return;
      -  }
       
      -  // Wrap in a document ready call, because jQuery writes
      -  // cssHooks at this time and will blow away your functions
      -  // if they exist.
      -  $(function () {
      -    $.cssHooks[ "someCSSProp" ] = {
      -      get: function( elem, computed, extra ) {
      -        // Handle getting the CSS property
      -      },
      -      set: function( elem, value ) {
      -        // Handle setting the CSS value
      -      }
      -    };
      -  });
      +// First, check to see if cssHooks are supported
      +if ( !$.cssHooks ) {
      +  // If not, output an error message
      +  throw( new Error( "jQuery 1.4.3 or above is required for this plugin to work" ) );
      +}
      +
      +// Wrap in a document ready call, because jQuery writes
      +// cssHooks at this time and will blow away your functions
      +// if they exist.
      +$(function () {
      +  $.cssHooks[ "someCSSProp" ] = {
      +    get: function( elem, computed, extra ) {
      +      // Handle getting the CSS property
      +    },
      +    set: function( elem, value ) {
      +      // Handle setting the CSS value
      +    }
      +  };
      +});
      +
       })( jQuery );
           

      Feature Testing

      Before normalizing a vendor-specific CSS property, first determine whether the browser supports the standard property or a vendor-prefixed variation. For example, to check for support of the border-radius property, see if any variation is a member of a temporary element's style object.

      
       (function( $ ) {
      -  function styleSupport( prop ) {
      -    var vendorProp, supportedProp,
      -      // Capitalize first character of the prop to test vendor prefix
      -      capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
      -      prefixes = [ "Moz", "Webkit", "O", "ms" ],
      -      div = document.createElement( "div" );
      -
      -    if ( prop in div.style ) {
      -      // Browser supports standard CSS property name
      -      supportedProp = prop;
      -    } else {
      -      // Otherwise test support for vendor-prefixed property names
      -      for ( var i = 0; i < prefixes.length; i++ ) {
      -        vendorProp = prefixes[ i ] + capProp;
      -        if ( vendorProp in div.style ) {
      -          supportedProp = vendorProp;
      -          break;
      -        }
      +
      +function styleSupport( prop ) {
      +  var vendorProp, supportedProp,
      +
      +    // Capitalize first character of the prop to test vendor prefix
      +    capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
      +    prefixes = [ "Moz", "Webkit", "O", "ms" ],
      +    div = document.createElement( "div" );
      +
      +  if ( prop in div.style ) {
      +
      +    // Browser supports standard CSS property name
      +    supportedProp = prop;
      +  } else {
      +
      +    // Otherwise test support for vendor-prefixed property names
      +    for ( var i = 0; i < prefixes.length; i++ ) {
      +      vendorProp = prefixes[ i ] + capProp;
      +      if ( vendorProp in div.style ) {
      +        supportedProp = vendorProp;
      +        break;
             }
           }
      -    // Avoid memory leak in IE
      -    div = null;
      -    // Add property to $.support so it can be accessed elsewhere
      -    $.support[ prop ] = supportedProp;
      -    return supportedProp;
         }
      -  // Call the function, e.g. testing for "border-radius" support:
      -  styleSupport( "borderRadius" );
      +
      +  // Avoid memory leak in IE
      +  div = null;
      +
      +  // Add property to $.support so it can be accessed elsewhere
      +  $.support[ prop ] = supportedProp;
      +  return supportedProp;
      +}
      +
      +// Call the function, e.g. testing for "border-radius" support:
      +styleSupport( "borderRadius" );
      +
       })( jQuery );
           

      Defining a complete css hook

      To define a complete css hook, combine the support test with a filled-out version of the skeleton template provided in the first example:

      
       (function( $ ) {
      -  if ( !$.cssHooks ) {
      -    throw( "jQuery 1.4.3+ is needed for this plugin to work" );
      -    return;
      -  }
       
      -  function styleSupport( prop ) {
      -    var vendorProp, supportedProp,
      -      capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
      -      prefixes = [ "Moz", "Webkit", "O", "ms" ],
      -      div = document.createElement( "div" );
      -
      -    if ( prop in div.style ) {
      -      supportedProp = prop;
      -    } else {
      -      for ( var i = 0; i < prefixes.length; i++ ) {
      -        vendorProp = prefixes[ i ] + capProp;
      -        if ( vendorProp in div.style ) {
      -          supportedProp = vendorProp;
      -          break;
      -        }
      -      }
      -    }
      +if ( !$.cssHooks ) {
      +  throw( new Error( "jQuery 1.4.3+ is needed for this plugin to work" ) );
      +}
       
      -    div = null;
      -    $.support[ prop ] = supportedProp;
      -    return supportedProp;
      -  }
      -  var borderRadius = styleSupport( "borderRadius" );
      -  // Set cssHooks only for browsers that
      -  // support a vendor-prefixed border radius
      -  if ( borderRadius && borderRadius !== "borderRadius" ) {
      -    $.cssHooks.borderRadius = {
      -      get: function( elem, computed, extra ) {
      -        return $.css( elem, borderRadius );
      -      },
      -      set: function( elem, value) {
      -        elem.style[ borderRadius ] = value;
      +function styleSupport( prop ) {
      +  var vendorProp, supportedProp,
      +    capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
      +    prefixes = [ "Moz", "Webkit", "O", "ms" ],
      +    div = document.createElement( "div" );
      +
      +  if ( prop in div.style ) {
      +    supportedProp = prop;
      +  } else {
      +    for ( var i = 0; i < prefixes.length; i++ ) {
      +      vendorProp = prefixes[ i ] + capProp;
      +      if ( vendorProp in div.style ) {
      +        supportedProp = vendorProp;
      +        break;
             }
      -    };
      +    }
         }
      +
      +  div = null;
      +  $.support[ prop ] = supportedProp;
      +  return supportedProp;
      +}
      +
      +var borderRadius = styleSupport( "borderRadius" );
      +
      +// Set cssHooks only for browsers that support a vendor-prefixed border radius
      +if ( borderRadius && borderRadius !== "borderRadius" ) {
      +  $.cssHooks.borderRadius = {
      +    get: function( elem, computed, extra ) {
      +      return $.css( elem, borderRadius );
      +    },
      +    set: function( elem, value) {
      +      elem.style[ borderRadius ] = value;
      +    }
      +  };
      +}
      +
       })( jQuery );
           

      You can then set the border radius in a supported browser using either the DOM (camelCased) style or the CSS (hyphenated) style:

      @@ -121,43 +132,46 @@ $( "#another" ).css( "border-radius", "20px" );

      If the browser lacks support for any form of the CSS property, vendor-prefixed or not, the style is not applied to the element. However, if the browser supports a proprietary alternative, it can be applied to the cssHooks instead.

      
      - (function( $ ) {
      -  // Feature test for support of a CSS property
      -  // and a proprietary alternative
      -  // ...
      - if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" ) {
      -    // Set cssHooks for browsers that
      -    // support only a vendor-prefixed someCSSProp
      -    $.cssHooks.someCSSProp = {
      -      get: function( elem, computed, extra ) {
      -        return $.css( elem, $.support.someCSSProp );
      -      },
      -      set: function( elem, value) {
      -        elem.style[ $.support.someCSSProp ] = value;
      -      }
      -    };
      -  } else if ( supportsProprietaryAlternative ) {
      -    $.cssHooks.someCSSProp = {
      -      get: function( elem, computed, extra ) {
      -        // Handle crazy conversion from the proprietary alternative
      -      },
      -      set: function( elem, value ) {
      -        // Handle crazy conversion to the proprietary alternative
      -      }
      +(function( $ ) {
      +
      +// Feature test for support of a CSS property
      +// and a proprietary alternative
      +// ...
      +if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" ) {
      +
      +  // Set cssHooks for browsers that
      +  // support only a vendor-prefixed someCSSProp
      +  $.cssHooks.someCSSProp = {
      +    get: function( elem, computed, extra ) {
      +      return $.css( elem, $.support.someCSSProp );
      +    },
      +    set: function( elem, value) {
      +      elem.style[ $.support.someCSSProp ] = value;
      +    }
      +  };
      +} else if ( supportsProprietaryAlternative ) {
      +  $.cssHooks.someCSSProp = {
      +    get: function( elem, computed, extra ) {
      +      // Handle crazy conversion from the proprietary alternative
      +    },
      +    set: function( elem, value ) {
      +      // Handle crazy conversion to the proprietary alternative
           }
         }
      +}
      +
       })( 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

      
      -$.cssNumber[ "someCSSProp" ] = true;
      +$.cssNumber.someCSSProp = true;
           

      Animating with cssHooks

      A css hook can also hook into jQuery's animation mechanism by adding a property to the jQuery.fx.step object:

      
      -  $.fx.step[ "someCSSProp" ] = function( fx ) {
      -  $.cssHooks[ "someCSSProp" ].set( fx.elem, fx.now + fx.unit );
      +$.fx.step.someCSSProp = function( fx ) {
      +  $.cssHooks.someCSSProp.set( fx.elem, fx.now + fx.unit );
       };
           

      Note that this works best for simple numeric-value animations. More custom code may be required depending on the CSS property, the type of value it returns, and the animation's complexity.

      diff --git a/entries/jQuery.data.xml b/entries/jQuery.data.xml index d46bd6ca..dcfc68d7 100644 --- a/entries/jQuery.data.xml +++ b/entries/jQuery.data.xml @@ -91,24 +91,25 @@ alert( jQuery.data( document.body ) ); Get the data named "blah" stored at for an element. Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going. Iterates over items in an array, accessing both the current item and its index. @@ -84,7 +85,7 @@ $.each( [ 'a', 'b', 'c' ], function( i, l ){ Iterates over the properties in an object, accessing both the current item and its key. diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index d7304466..594a1b75 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -56,14 +56,14 @@ var object2 = { // Merge object2 into object1 $.extend( object1, object2 ); -var printObj = typeof JSON != "undefined" ? JSON.stringify : function( obj ) { +var printObj = typeof JSON !== "undefined" ? JSON.stringify : function( obj ) { var arr = []; $.each( obj, function( key, val ) { var next = key + ": "; next += $.isPlainObject( val ) ? printObj( val ) : val; arr.push( next ); }); - return "{ " + arr.join(", ") + " }"; + return "{ " + arr.join( ", " ) + " }"; }; $( "#log" ).append( printObj( object1 ) ); @@ -86,16 +86,16 @@ var object2 = { }; // Merge object2 into object1, recursively -$.extend(true, object1, object2); +$.extend( true, object1, object2 ); -var printObj = typeof JSON != "undefined" ? JSON.stringify : function( obj ) { +var printObj = typeof JSON !== "undefined" ? JSON.stringify : function( obj ) { var arr = []; $.each( obj, function( key, val ) { var next = key + ": "; next += $.isPlainObject( val ) ? printObj( val ) : val; arr.push( next ); }); - return "{ " + arr.join(", ") + " }"; + return "{ " + arr.join( ", " ) + " }"; }; $( "#log" ).append( printObj( object1 ) ); @@ -111,16 +111,16 @@ var defaults = { validate: false, limit: 5, name: "foo" }; var options = { validate: true, name: "bar" }; // Merge defaults and options, without modifying defaults -var settings = $.extend({}, defaults, options); +var settings = $.extend( {}, defaults, options ); -var printObj = typeof JSON != "undefined" ? JSON.stringify : function(obj) { +var printObj = typeof JSON !== "undefined" ? JSON.stringify : function( obj ) { var arr = []; $.each( obj, function( key, val ) { var next = key + ": "; next += $.isPlainObject( val ) ? printObj( val ) : val; arr.push( next ); }); - return "{ " + arr.join(", ") + " }"; + return "{ " + arr.join( ", " ) + " }"; }; $( "#log" ).append( "
      defaults -- " + printObj( defaults ) + "
      " ); diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index 93720ced..9f89cd32 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -28,7 +28,7 @@ $( "input" ).click(function() { } ]]>
      diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index ac01e9c8..ae9b32d3 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -35,8 +35,8 @@ $( "input" ).click(function() { } ]]> diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 102dd7d9..af75af2c 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -61,7 +61,7 @@ var jqxhr = $.get( "example.php", function() { // Perform other work here ... // Set another completion function for the request above -jqxhr.always(function(){ +jqxhr.always(function() { alert( "second finished" ); });
      @@ -86,7 +86,7 @@ $.get( "test.php", { name: "John", time: "2pm" } ); Pass arrays of data to the server (while still ignoring the return results). @@ -100,17 +100,18 @@ $.get( "test.php", function( data ) { Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 047e7231..92adffa6 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -40,7 +40,8 @@ $.getJSON( "ajax/test.json", function( data ) { });

      This example, of course, relies on the structure of the JSON file:

      -
      {
      +    
      
      +{
         "one": "Singular sensation",
         "two": "Beady little eyes",
         "three": "Little birds pitch by my doorstep"
      @@ -63,11 +64,17 @@ $.getJSON( "ajax/test.json", function( data ) {
       var jqxhr = $.getJSON( "example.json", function() {
         console.log( "success" );
       })
      -  .done(function() { console.log( "second success" ); })
      -  .fail(function() { console.log( "error" ); })
      -  .always(function() { console.log( "complete" ); });
      +  .done(function() {
      +    console.log( "second success" );
      +  })
      +  .fail(function() {
      +    console.log( "error" );
      +  })
      +  .always(function() {
      +    console.log( "complete" );
      +  });
       
      -// perform other work here ...
      +// Perform other work here ...
       
       // Set another completion function for the request above
       jqxhr.complete(function() {
      @@ -91,7 +98,7 @@ jqxhr.complete(function() {
         })
           .done(function( data ) {
             $.each( data.items, function( i, item ) {
      -        $( "" ).attr( "src", item.media.m ).appendTo( "#images" );
      +        $( "" ).attr( "src", item.media.m ).appendTo( "#images" );
               if ( i === 3 ) {
                 return false;
               }
      @@ -127,7 +134,7 @@ $.getJSON( "test.js", { name: "John", time: "2pm" } )
         })
         .fail(function( jqxhr, textStatus, error ) {
           var err = textStatus + ", " + error;
      -    console.log( "Request Failed: " + err);
      +    console.log( "Request Failed: " + err );
       });
       ]]>
         
      diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml
      index 6a04369d..d13e6e90 100644
      --- a/entries/jQuery.getScript.xml
      +++ b/entries/jQuery.getScript.xml
      @@ -31,9 +31,9 @@ $( ".result" ).html( "<p>Lorem ipsum dolor sit amet.</p>" );
           

      Scripts are included and run by referencing the file name:

      
       $.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {
      -  console.log( data ); //Data returned
      -  console.log( textStatus ); //Success
      -  console.log( jqxhr.status ); //200
      +  console.log( data ); // Data returned
      +  console.log( textStatus ); // Success
      +  console.log( jqxhr.status ); // 200
         console.log( "Load was performed." );
       });
           
      @@ -41,7 +41,7 @@ $.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {

      As of jQuery 1.5, you may use .fail() to account for errors:

      
       $.getScript( "ajax/test.js" )
      -  .done( function(script, textStatus ) {
      +  .done(function( script, textStatus ) {
           console.log( textStatus );
         })
         .fail(function( jqxhr, settings, exception ) {
      @@ -50,8 +50,8 @@ $.getScript( "ajax/test.js" )
           

      Prior to jQuery 1.5, the global .ajaxError() callback event had to be used in order to handle $.getScript() errors:

      
      -$( "div.log" ).ajaxError(function(e, jqxhr, settings, exception) {
      -  if (settings.dataType == "script" ) {
      +$( "div.log" ).ajaxError(function( e, jqxhr, settings, exception ) {
      +  if ( settings.dataType == "script" ) {
           $( this ).text( "Triggered ajaxError handler." );
         }
       });
      @@ -91,19 +91,23 @@ $.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.
           
            4 );
      +  return ( n !== 5 && i > 4 );
       });
      -$( "p" ).text( arr.join(", ") );
      +$( "p" ).text( arr.join( ", " ) );
       
       arr = jQuery.grep(arr, function( a ) {
      -  return a != 9;
      +  return a !== 9;
       });
       
       $( "span" ).text( arr.join( ", " ) );
      @@ -67,7 +67,7 @@ $.grep( [ 0, 1, 2 ], function( n, i ) {
         
           Filter an array of numbers to include numbers that are not bigger than zero.
            0;
       }, true );
       ]]>
      diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml
      index 2f66a042..2ceed224 100644
      --- a/entries/jQuery.isFunction.xml
      +++ b/entries/jQuery.isFunction.xml
      @@ -14,8 +14,7 @@
         
           Test a few parameter examples.
           
           
           
           Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not.
            0 ? n + 1 : null;
       });
       ]]>
           
         
         
      diff --git a/entries/jQuery.noConflict.xml b/entries/jQuery.noConflict.xml
      index ed8464dc..451ae4d1 100644
      --- a/entries/jQuery.noConflict.xml
      +++ b/entries/jQuery.noConflict.xml
      @@ -12,18 +12,18 @@
           

      Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If you need to use another JavaScript library alongside jQuery, return control of $ back to the other library with a call to $.noConflict(). Old references of $ are saved during jQuery initialization; noConflict() simply restores them.

      If for some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict( true ) from the second version will return the globally scoped jQuery variables to those of the first version.

      
      -<script type="text/javascript" src="other_lib.js"></script>
      -<script type="text/javascript" src="jquery.js"></script>
      -<script type="text/javascript">
      +<script src="other_lib.js"></script>
      +<script src="jquery.js"></script>
      +<script>
       $.noConflict();
       // Code that uses other library's $ can follow here.
       </script>
           

      This technique is especially effective in conjunction with the .ready() method's ability to alias the jQuery object, as within callback passed to .ready() you can use $ if you wish without fear of conflicts later:

      
      -<script type="text/javascript" src="other_lib.js"></script>
      -<script type="text/javascript" src="jquery.js"></script>
      -<script type="text/javascript">
      +<script src="other_lib.js"></script>
      +<script src="jquery.js"></script>
      +<script>
       $.noConflict();
       jQuery( document ).ready(function( $ ) {
         // Code that uses jQuery's $ can follow here.
      @@ -53,6 +53,7 @@ jQuery.noConflict();
           // More code using $ as alias to jQuery
         });
       })(jQuery);
      +
       // Other code using $ as an alias to the other library
       ]]>
         
      @@ -60,8 +61,10 @@ jQuery.noConflict();
           Create a different alias instead of jQuery to use in the rest of the script.
           
      @@ -75,8 +78,10 @@ dom.query = jQuery.noConflict( true );
           
      diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml
      index e458487e..56d88fc6 100644
      --- a/entries/jQuery.param.xml
      +++ b/entries/jQuery.param.xml
      @@ -28,9 +28,11 @@
           

      As of jQuery 1.8, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

      If the object passed is in an Array, it must be an array of objects in the format returned by .serializeArray()

      
      -[{ name:"first", value:"Rick" },
      -{ name:"last", value:"Astley" },
      -{ name:"job", value:"Rock Star" }]
      +[
      +  { name: "first", value: "Rick" },
      +  { name: "last", value: "Astley" },
      +  { name: "job", value: "Rock Star" }
      +]
           

      Note: Because some frameworks have limited ability to parse serialized arrays, developers should exercise caution when passing an obj argument that contains objects or arrays nested within another array.

      @@ -40,13 +42,14 @@

      In jQuery 1.4, HTML5 input elements are also serialized.

      We can display a query string representation of an object and a URI-decoded version of the same as follows:

      -
      var myObject = {
      +    
      
      +var myObject = {
         a: {
           one: 1,
           two: 2,
           three: 3
         },
      -  b: [1,2,3]
      +  b: [ 1, 2, 3 ]
       };
       var recursiveEncoded = $.param( myObject );
       var recursiveDecoded = decodeURIComponent( $.param( myObject ) );
      @@ -61,7 +64,8 @@ alert( recursiveDecoded );
             a[one]=1&a[two]=2&a[three]=3&b[]=1&b[]=2&b[]=3
           

      To emulate the behavior of $.param() prior to jQuery 1.4, we can set the traditional argument to true:

      -
      var myObject = {
      +    
      
      +var myObject = {
         a: {
           one: 1,
           two: 2,
      @@ -102,14 +106,17 @@ $( "#results" ).text( str );
           Serialize a few complex objects
           =1.4:
      -$.param({ a: [2, 3, 4] }); // "a[]=2&a[]=3&a[]=4"
      +$.param({ a: [ 2, 3, 4 ] }); // "a[]=2&a[]=3&a[]=4"
       
       // <=1.3.2:
      -$.param({ a: { b:1, c:2 }, d: [ 3, 4, { e:5 } ] }); // "a=[object+Object]&d=3&d=4&d=[object+Object]"
      +$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
      +// "a=[object+Object]&d=3&d=4&d=[object+Object]"
      +
       // >=1.4:
      -$.param({ a: { b:1, c:2 }, d: [ 3, 4, { e:5 } ] }); // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
      +$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
      +// "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
       ]]>
           " + el.nodeName + "
    • "; + nodeNames[ i ] = "
    • " + el.nodeName + "
    • "; }); // Insert the node names diff --git a/entries/jQuery.parseXML.xml b/entries/jQuery.parseXML.xml index 0636b51c..8829bdb9 100644 --- a/entries/jQuery.parseXML.xml +++ b/entries/jQuery.parseXML.xml @@ -23,13 +23,13 @@ var xml = "RSS Title" $xml = $( xmlDoc ), $title = $xml.find( "title" ); -/* append "RSS Title" to #someElement */ +// Append "RSS Title" to #someElement $( "#someElement" ).append( $title.text() ); -/* change the title to "XML Title" */ +// Change the title to "XML Title" $title.text( "XML Title" ); -/* append "XML Title" to #anotherElement */ +// Append "XML Title" to #anotherElement $( "#anotherElement" ).append( $title.text() ); ]]>
      diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index f1738f1b..e32e7e00 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -39,7 +39,7 @@ $.post( "ajax/test.html", function( data ) { });

      This example fetches the requested HTML snippet and inserts it on the page.

      -

      Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

      +

      Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

      The jqXHR Object

      As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

      The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

      @@ -59,11 +59,11 @@ var jqxhr = $.post( "example.php", function() { alert( "finished" ); }); -// perform other work here ... +// Perform other work here ... // Set another completion function for the request above -jqxhr.always(function(){ - alert("second finished"); +jqxhr.always(function() { + alert( "second finished" ); }); @@ -107,20 +107,19 @@ $.post( "test.php", function( data ) { Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). Post to the test.php page and get content which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index dd8a2ce9..1ec94257 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -47,8 +47,7 @@ Takes a function and returns a new one that will always have a particular context.

      This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

      -

      Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding. -

      +

      Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

      As of jQuery 1.6, any number of additional arguments may supplied to $.proxy(), and they will be passed to the function whose context will be changed.

      As of jQuery 1.9, when the context is null or undefined the the proxied function will be called with the same this object as the proxy was called with. This allows $.proxy() to be used to partially apply the arguments of a function without changing the context.

      @@ -132,7 +131,7 @@ var me = { type: "dog", // Note that event comes *after* one and two - test: function(one, two, event) { + test: function( one, two, event ) { $( "#log" ) // `one` maps to `you`, the 1st additional @@ -147,10 +146,10 @@ var me = { // argument in the $.proxy function call .append( "and they are " + two.type + ".
      " ) - // the event type is "click" - .append( "Thanks for " + event.type + "ing " ) + // The event type is "click" + .append( "Thanks for " + event.type + "ing." ) - // the clicked element is `event.target`, + // The clicked element is `event.target`, // and its type is "button" .append( "the " + event.target.type + "." ); } diff --git a/entries/jQuery.queue.xml b/entries/jQuery.queue.xml index 88502494..8b620b8f 100644 --- a/entries/jQuery.queue.xml +++ b/entries/jQuery.queue.xml @@ -14,7 +14,7 @@ Show the queue of functions to be executed on the matched element. -

      Note: This is a low-level method, you should probably use .queue() instead.

      +

      Note: This is a low-level method, you should probably use .queue() instead.

      Show the length of the queue. @@ -25,14 +25,19 @@ $( "#show" ).click(function() { }); function runIt() { - $( "div" ).show( "slow" ); - $( "div" ).animate({ left: "+=200" }, 2000 ); - $( "div" ).slideToggle( 1000 ); - $( "div" ).slideToggle( "fast" ); - $( "div" ).animate({ left: "-=200" }, 1500 ); - $( "div" ).hide( "slow" ); - $( "div" ).show( 1200 ); - $( "div" ).slideUp( "normal", runIt ); + $( "div" ) + .show( "slow" ) + .animate({ + left: "+=200" + }, 2000 ) + .slideToggle( 1000 ) + .slideToggle( "fast" ) + .animate({ + left: "-=200" + }, 1500 ) + .hide( "slow" ) + .show( 1200 ) + .slideUp( "normal", runIt ); } runIt(); @@ -101,18 +106,19 @@ runIt(); Queue a custom function. Remove a previously-stored piece of data. -

      Note: This is a low-level method, you should probably use .removeData() instead.

      -

      The jQuery.removeData() method allows us to remove values that were previously set using jQuery.data(). When called with the name of a key, jQuery.removeData() deletes that particular value; when called with no arguments, all values are removed.

      +

      Note: This is a low-level method, you should probably use .removeData() instead.

      +

      The jQuery.removeData() method allows us to remove values that were previously set using jQuery.data(). When called with the name of a key, jQuery.removeData() deletes that particular value; when called with no arguments, all values are removed.

      Set a data store for 2 names then remove one of them. diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index 9dea8924..a52c9ab6 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -38,6 +38,7 @@ typeof jQuery( "body" ).myCustomMethod // undefined var myjQuery = jQuery.sub(); myjQuery.fn.remove = function() { + // New functionality: Trigger a remove event this.trigger( "remove" ); @@ -51,19 +52,21 @@ typeof jQuery( "body" ).myCustomMethod // undefined }); // A new remove event is now triggered from this copy of jQuery - $( document ).on( "remove", function( e ) { - $( e.target ).parent().hide(); + $( document ).on( "remove", function( event ) { + $( event.target ).parent().hide(); }); }); })(); // Regular jQuery doesn't trigger a remove event when removing an element -// This functionality is only contained within the modified 'myjQuery'.]]> +// This functionality is only contained within the modified 'myjQuery'. +]]> Create a plugin that returns plugin-specific methods. 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() {
      -  $(  "span", this ).addClass( "bar" );
      +  $( "span", this ).addClass( "bar" );
       });
             

      When the search for the span selector is restricted to the context of this, only spans within the clicked element will get the additional class.

      @@ -70,7 +70,7 @@ $( "div.foo" ).click(function() {
      
       $.post( "url.xml", function( data ) {
         var $child = $( data ).find( "child" );
      -})
      +});
             

      Cloning jQuery Objects

      @@ -95,7 +95,7 @@ $foo.prop( "foo", "foobar" ); var test2 = $foo.prop( "foo" ); // foobar // Test using .data() as summarized above -$foo.data( "keyName", "someValue"); +$foo.data( "keyName", "someValue" ); console.log( $foo ); // will now contain a jQuery{randomNumber} property // Test binding an event name and triggering @@ -124,7 +124,7 @@ $( "div > p" ).css( "border", "1px solid gray" ); Find all inputs of type radio within the first form in the document. @@ -187,12 +187,12 @@ $( "<input>" );

      When passing HTML to jQuery(), please also note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally otherwise ignored or removed. E.g:

      
      -var el = $( "1<br/>2<br/>3" ); // returns [<br>, "2", <br>]
      -el  = $( "1<br/>2<br/>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]
      +var el = $( "1<br>2<br>3" ); // returns [<br>, "2", <br>]
      +el = $( "1<br>2<br>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]
             

      This behavior is expected.

      -

      As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

      -

      Important: If the second argument is passed, the HTML string in the first argument must represent a a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

      +

      As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

      +

      Important: If the second argument is passed, the HTML string in the first argument must represent a a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

      As of jQuery 1.8, any jQuery instance method (a method of jQuery.fn) can be used as a property of the object passed to the second parameter:

      
       $( "
      ", { diff --git a/entries/jquery-2.xml b/entries/jquery-2.xml index 2513ec7c..4dc645e7 100644 --- a/entries/jquery-2.xml +++ b/entries/jquery-2.xml @@ -15,11 +15,11 @@ var a = { what: "A regular JS object" }, b = $( "body" ); if ( a.jquery ) { // Falsy, since it's undefined - alert( " a is a jQuery object! " ); + alert( "a is a jQuery object!" ); } if ( b.jquery ) { // Truthy, since it's a string - alert( " b is a jQuery object! " ); + alert( "b is a jQuery object!" ); } ]]>
      diff --git a/entries/keydown.xml b/entries/keydown.xml index 6ad83356..b72e0ad7 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -58,10 +58,10 @@ $( "#other" ).click(function() { var xTriggered = 0; $( "#target" ).keydown(function( event ) { if ( event.which == 13 ) { - event.preventDefault(); - } - xTriggered++; - var msg = "Handler for .keydown() called " + xTriggered + " time(s)."; + event.preventDefault(); + } + xTriggered++; + var msg = "Handler for .keydown() called " + xTriggered + " time(s)."; $.print( msg, "html" ); $.print( event ); }); diff --git a/entries/keypress.xml b/entries/keypress.xml index a34024ee..5535c2bb 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -64,9 +64,9 @@ var xTriggered = 0; $( "#target" ).keypress(function( event ) { if ( event.which == 13 ) { event.preventDefault(); - } - xTriggered++; - var msg = "Handler for .keypress() called " + xTriggered + " time(s)."; + } + xTriggered++; + var msg = "Handler for .keypress() called " + xTriggered + " time(s)."; $.print( msg, "html" ); $.print( event ); }); diff --git a/entries/keyup.xml b/entries/keyup.xml index 4bf09a42..f65c6a03 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -57,8 +57,8 @@ $( "#other" ).click(function() { @@ -87,13 +91,14 @@ $( "a" ).live( "click", function( event ){ Bind custom events with .live(). Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding. diff --git a/entries/map.xml b/entries/map.xml index f5ab2378..6fbe68d7 100644 --- a/entries/map.xml +++ b/entries/map.xml @@ -75,13 +75,16 @@ $( "p" ) - A" ); @@ -126,7 +129,7 @@ $.fn.equalizeHeights = function() { var maxHeight = this.map(function( i, e ) { return $( e ).height(); }).get(); - return this.height( Math.max.apply(this, maxHeight) ); + return this.height( Math.max.apply( this, maxHeight ) ); }; $( "input" ).click(function() { @@ -144,9 +147,9 @@ $( "input" ).click(function() { ]]> diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml index 02d13f06..c90a8a03 100644 --- a/entries/mouseenter.xml +++ b/entries/mouseenter.xml @@ -24,7 +24,8 @@

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

      The mouseenter JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser. This event is sent to an element when the mouse pointer enters the element. Any HTML element can receive this event.

      For example, consider the HTML:

      -
      <div id="outer">
      +    
      
      +<div id="outer">
         Outer
         <div id="inner">
           Inner
      diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml
      index d04a0264..e7fd4c49 100644
      --- a/entries/mouseleave.xml
      +++ b/entries/mouseleave.xml
      @@ -24,7 +24,8 @@
           

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

      The mouseleave JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser. This event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.

      For example, consider the HTML:

      -
      <div id="outer">
      +    
      
      +<div id="outer">
         Outer
         <div id="inner">
           Inner
      @@ -40,14 +41,14 @@
           

      The event handler can be bound to any element:

      
       $( "#outer" ).mouseleave(function() {
      -    $( "#log" ).append( "<div>Handler for .mouseleave() called.</div>" );
      -  });
      +  $( "#log" ).append( "<div>Handler for .mouseleave() called.</div>" );
      +});
           

      Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

      
       $( "#other" ).click(function() {
      -    $( "#outer" ).mouseleave();
      -  });
      +  $( "#outer" ).mouseleave();
      +});
           

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

      The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.

      diff --git a/entries/mousemove.xml b/entries/mousemove.xml index 446ae603..a0e1a46a 100644 --- a/entries/mousemove.xml +++ b/entries/mousemove.xml @@ -24,13 +24,15 @@

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

      The mousemove event is sent to an element when the mouse pointer moves inside the element. Any HTML element can receive this event.

      For example, consider the HTML:

      -
      <div id="target">
      +    
      
      +<div id="target">
         Move here
       </div>
       <div id="other">
         Trigger the handler
       </div>
      -<div id="log"></div>
      +<div id="log"></div> +

      The event handler can be bound to the target:

      
       $( "#target" ).mousemove(function( event ) {
      @@ -67,11 +69,11 @@ $( "#other" ).click(function() {
         
           Show the mouse coordinates when the mouse is moved over the yellow div.  Coordinates are relative to the window, which in this case is the iframe.
           
           300
      diff --git a/entries/mouseup.xml b/entries/mouseup.xml
      index 215c1d3a..018ea304 100644
      --- a/entries/mouseup.xml
      +++ b/entries/mouseup.xml
      @@ -24,7 +24,8 @@
           

      This method is a shortcut for .on('mouseup', handler) in the first variation, and .trigger('mouseup') in the second.

      The mouseup event is sent to an element when the mouse pointer is over the element, and the mouse button is released. Any HTML element can receive this event.

      For example, consider the HTML:

      -
      <div id="target">
      +    
      
      +<div id="target">
         Click here
       </div>
       <div id="other">
      diff --git a/entries/multiple-selector.xml b/entries/multiple-selector.xml
      index c27a3f9b..2035e5a2 100644
      --- a/entries/multiple-selector.xml
      +++ b/entries/multiple-selector.xml
      @@ -44,11 +44,12 @@ $( "div, span, p.myClass" ).css( "border", "3px solid red" );
         
           Show the order in the jQuery object.
           
           
           
           
           
           
             
           
           
           
           
           
           
           
      diff --git a/entries/promise.xml b/entries/promise.xml index ad38f98d..9fd1118b 100644 --- a/entries/promise.xml +++ b/entries/promise.xml @@ -23,7 +23,7 @@ Using .promise() on a collection with no active animation returns a resolved Promise: diff --git a/entries/queue.xml b/entries/queue.xml index a3e58c6a..b5d512af 100644 --- a/entries/queue.xml +++ b/entries/queue.xml @@ -17,14 +17,15 @@ var div = $( "div" ); function runIt() { - div.show( "slow" ); - div.animate({ left: "+=200" }, 2000 ); - div.slideToggle( 1000 ); - div.slideToggle( "fast" ); - div.animate({ left: "-=200" }, 1500 ); - div.hide( "slow" ); - div.show( 1200 ); - div.slideUp( "normal", runIt ); + div + .show( "slow" ) + .animate({ left: "+=200" }, 2000 ) + .slideToggle( 1000 ) + .slideToggle( "fast" ) + .animate({ left: "-=200" }, 1500 ) + .hide( "slow" ) + .show( 1200 ) + .slideUp( "normal", runIt ); } function showIt() { @@ -118,18 +119,17 @@ $( "#test" ).queue(function( next ) { Queue a custom function. Set a numeric property on a paragraph and then remove it. diff --git a/entries/slice.xml b/entries/slice.xml index 89477387..81d76c98 100644 --- a/entries/slice.xml +++ b/entries/slice.xml @@ -48,7 +48,7 @@ function colorEm() { var start = Math.floor( Math.random() * $div.length ); var end = Math.floor( Math.random() * ( $div.length - start ) ) + start + 1; - if ( end == $div.length ) { + if ( end === $div.length ) { end = undefined; } $div.css( "background", "" ); @@ -57,8 +57,8 @@ function colorEm() { } else { $div.slice( start ).css( "background", "yellow" ); } - $( "span" ).text( "$( 'div' ).slice( "+ start + - (end ? ", " + end : "" ) + + $( "span" ).text( "$( 'div' ).slice( " + start + + (end ? ", " + end : "") + ").css( 'background', 'yellow' );" ); } diff --git a/entries/slideDown.xml b/entries/slideDown.xml index bc8f7c8f..01a14e03 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -81,17 +81,18 @@ Click me! Animates all inputs to slide down, completing the animation within 1000 milliseconds. Once the animation is done, the input look is changed especially if it is the middle input which gets the focus. , can be seen below:

      
      -$( "<input>" ).is( "[type=text]"); // false
      +$( "<input>" ).is( "[type=text]" ); // false
       $( "<input>" ).is( ":text" ); // true
           
      @@ -22,12 +22,16 @@ $( "<input>" ).is( ":text" ); // true var input = $( "form input:text" ).css({ background: "yellow", border: "3px red solid" - }); -$( "div" ).text( "For this type jQuery found " + input.length + "." ) +}); + +$( "div" ) + .text( "For this type jQuery found " + input.length + "." ) .css( "color", "red" ); -$( "form" ).submit(function() { - return false; -}); // So it won't submit + +// Prevent form submission +$( "form" ).submit(function( event ) { + event.preventDefault(); +}); ]]> @@ -167,7 +168,7 @@ $( "p" ).each(function() { ]]> To trigger handlers bound via jQuery without also triggering the native event, use .triggerHandler() instead.

      When we define a custom event type using the .on() method, the second argument to .trigger() can become useful. For example, suppose we have bound a handler for the custom event to our element instead of the built-in click event as we did above:

      
      -$( "#foo" ).on( "custom", function(event, param1, param2) {
      +$( "#foo" ).on( "custom", function( event, param1, param2 ) {
         alert( param1 + "\n" + param2 );
       });
       $( "#foo").trigger( "custom", [ "Custom", "Event" ] );
      @@ -50,7 +50,7 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );
           Clicks to button #2 also trigger a click for button #1.
           
      @@ -150,4 +151,4 @@ $( "p" ).unbind( "click", foo ); // ... foo will no longer be called.
         
         
         
      -
      \ No newline at end of file
      +
      diff --git a/entries/undelegate.xml b/entries/undelegate.xml
      index c542d456..460410d5 100644
      --- a/entries/undelegate.xml
      +++ b/entries/undelegate.xml
      @@ -51,11 +51,13 @@ function aClick() {
         $( "div" ).show().fadeOut( "slow" );
       }
       $( "#bind" ).click(function() {
      -  $( "body" ).delegate( "#theone", "click", aClick )
      +  $( "body" )
      +    .delegate( "#theone", "click", aClick )
           .find( "#theone" ).text( "Can Click!" );
       });
       $( "#unbind" ).click(function() {
      -  $( "body" ).undelegate( "#theone", "click", aClick )
      +  $( "body" )
      +    .undelegate( "#theone", "click", aClick )
           .find( "#theone" ).text( "Does nothing..." );
       });
       ]]>
      @@ -93,6 +95,7 @@ $( "p" ).undelegate( "click" );
       var foo = function () {
         // Code to handle some kind of event
       };
      +
       // ... Now foo will be called when paragraphs are clicked ...
       $( "body" ).delegate( "p", "click", foo );
       
      @@ -113,7 +116,7 @@ $( "form" ).delegate( ":button", "click.whatever", foo );
       $( "form" ).delegate( "input[type='text'] ", "keypress.whatever", foo );
       
       // Unbind all events delegated under the ".whatever" namespace
      -$("form").undelegate(".whatever");
      +$( "form" ).undelegate( ".whatever" );
       ]]>
         
         
      diff --git a/entries/unload.xml b/entries/unload.xml
      index 70cb37d0..077ec6fc 100644
      --- a/entries/unload.xml
      +++ b/entries/unload.xml
      @@ -38,7 +38,7 @@ It is not possible to cancel the unload event with .preventDe
           
         
         
      diff --git a/entries/unwrap.xml b/entries/unwrap.xml
      index 48a1765d..d966952c 100644
      --- a/entries/unwrap.xml
      +++ b/entries/unwrap.xml
      @@ -6,7 +6,7 @@
         
         Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
         
      -    

      The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

      +

      The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

      Wrap/unwrap a div around each of the paragraphs. diff --git a/entries/val.xml b/entries/val.xml index 20ea98c7..3d1b96bf 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -14,10 +14,17 @@

      The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of <select multiple="multiple"> elements, the .val() method returns an array containing each selected option; if no option is selected, it returns null.

      For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

      
      -$( "select.foo option:selected").val();    // Get the value from a dropdown select
      -$( "select.foo" ).val();                    // Get the value from a dropdown select even easier
      -$( "input:checkbox:checked" ).val();        // Get the value from a checked checkbox
      -$( "input:radio[name=bar]:checked" ).val(); // Get the value from a set of radio buttons
      +// Get the value from a dropdown select
      +$( "select.foo option:selected").val();
      +
      +// Get the value from a dropdown select even easier
      +$( "select.foo" ).val();
      +
      +// Get the value from a checked checkbox
      +$( "input:checkbox:checked" ).val();
      +
      +// Get the value from a set of radio buttons
      +$( "input:radio[name=bar]:checked" ).val();
             

      Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

      @@ -40,7 +47,7 @@ function displayVals() { " Multiple: " + multipleValues.join( ", " ) ); } -$("select").change(displayVals); +$( "select" ).change( displayVals ); displayVals(); ]]>
      check1 check2 - radio1 - radio2 + radio1 + radio2 ]]> diff --git a/entries/width.xml b/entries/width.xml index 0427f961..9c49066e 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -14,8 +14,11 @@

      This method is also able to find the width of the window and document.

      
      -$( window ).width();   // Returns width of browser viewport
      -$( document ).width(); // Returns width of HTML document
      +// Returns width of browser viewport
      +$( window ).width();
      +
      +// Returns width of HTML document
      +$( document ).width();
             

      Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS width plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "width" ) rather than .width().

      @@ -23,13 +26,13 @@ $( document ).width(); // Returns width of HTML document Show various widths. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. Date: Tue, 10 Sep 2013 18:15:48 +0200 Subject: [PATCH 254/998] Fix #315. Discourage jQuery.support usage, remove examples. Since jQuery.support is an unstable interface not intended for public use, it's better to not describe it and make it easier for others to (mis)use. This commit removes examples and changes text that might urge others to try to rely on jQuery.support. --- entries/jQuery.browser.xml | 2 +- entries/jQuery.support.xml | 77 +------------------------------------- 2 files changed, 2 insertions(+), 77 deletions(-) diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index eb535b35..b1c78f6c 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -18,7 +18,7 @@

    This property is available immediately. It is therefore safe to use it to determine whether or not to call $(document).ready(). The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

    -

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. The $.support property is available for detection of support for particular features rather than relying on $.browser.

    +

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

    Show the browser info. diff --git a/entries/jQuery.support.xml b/entries/jQuery.support.xml index b10c1d5c..e04634c9 100644 --- a/entries/jQuery.support.xml +++ b/entries/jQuery.support.xml @@ -4,82 +4,7 @@ 1.3 - A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. - -

    Rather than using $.browser to detect the current user agent and alter the page presentation based on which browser is running, it is a good practice to use feature detection. To make this process simpler, jQuery performs many such tests and sets properties of the jQuery.support object.

    -

    - Since jQuery requires these tests internally, they must be performed on every page load. Although some of these properties are documented below, they are not subject to a long deprecation/removal cycle and may be removed once internal jQuery code no longer needs them. -

    - -

    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.

    -

    The tests included in jQuery.support are as follows:

    -
      -
    • ajax is equal to true if a browser is able to create an XMLHttpRequest object.
    • -
    • boxModel is equal to true if the page is rendering according to the W3C CSS Box Model (is currently false in IE 6 and 7 when they are in Quirks Mode). This property is null until document ready occurs.
    • -
    • changeBubbles is equal to true if the change event bubbles up the DOM tree, as required by the W3C DOM event model. (It is currently false in IE, and jQuery simulates bubbling).
    • -
    • checkClone is equal to true if a browser correctly clones the checked state of radio buttons or checkboxes in document fragments.
    • -
    • checkOn is equal to true if the value of a checkbox defaults to "on" when no value is specified.
    • -
    • cors is equal to true if a browser can create an XMLHttpRequest object and if that XMLHttpRequest object has a withCredentials property. To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain XHR requests (windows gadget, etc), set $.support.cors = true;. - CORS WD
    • -
    • cssFloat is equal to true if the name of the property containing the CSS float value is .cssFloat, as defined in the CSS Spec. (It is currently false in IE, it uses styleFloat instead).
    • -
    • hrefNormalized is equal to true if the .getAttribute() method retrieves the href attribute of elements unchanged, rather than normalizing it to a fully-qualified URL. (It is currently false in IE, the URLs are normalized). -
    • -
    • htmlSerialize is equal to true if the browser is able to serialize/insert <link> elements using the .innerHTML property of elements. (is currently false in IE).
    • -
    • leadingWhitespace is equal to true if the browser inserts content with .innerHTML exactly as provided—specifically, if leading whitespace characters are preserved. (It is currently false in IE 6-8).
    • -
    • noCloneChecked is equal to true if cloned DOM elements copy over the state of the .checked expando. (It is currently false in IE). (Added in jQuery 1.5.1)
    • -
    • noCloneEvent is equal to true if cloned DOM elements are created without event handlers (that is, if the event handlers on the source element are not cloned). (It is currently false in IE).
    • -
    • opacity is equal to true if a browser can properly interpret the opacity style property. (It is currently false in IE, it uses alpha filters instead).
    • -
    • optDisabled is equal to true if option elements within disabled select elements are not automatically marked as disabled.
    • -
    • optSelected is equal to true if an <option> element that is selected by default has a working selected property.
    • -
    • scriptEval() is equal to true if inline scripts are automatically evaluated and executed when inserted into the document using standard DOM manipulation methods such as .appendChild() and .createTextNode(). (It is currently false in IE, it uses .text to insert executable scripts). -
      Note: No longer supported; removed in jQuery 1.6. Prior to jQuery 1.5.1, the scriptEval() method was the static scriptEval property. The change to a method allowed the test to be deferred until first use to prevent content security policy inline-script violations.
      -
    • -
    • style is equal to true if inline styles for an element can be accessed through the DOM attribute called style, as required by the DOM Level 2 specification. In this case, .getAttribute('style') can retrieve this value; in Internet Explorer, .cssText is used for this purpose.
    • -
    • submitBubbles is equal to true if the submit event bubbles up the DOM tree, as required by the W3C DOM event model. (It is currently false in IE, and jQuery simulates bubbling).
    • -
    • tbody is equal to true if an empty <table> element can exist without a <tbody> element. According to the HTML specification, this sub-element is optional, so the property should be true in a fully-compliant browser. If false, we must account for the possibility of the browser injecting <tbody> tags implicitly. (It is currently false in IE, which automatically inserts tbody if it is not present in a string assigned to innerHTML).
    • -
    -
    - - Returns the box model for the iframe. - - - - - - Returns false if the page is in QuirksMode in Internet Explorer - - - + 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. From bfdbd209de8c0d9393db8e7b4185d5fbcfe20510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Mon, 16 Sep 2013 22:16:28 +0200 Subject: [PATCH 255/998] 1.10.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7ea6ee4..f50b53e2 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": "1.10.2-3", + "version": "1.10.3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 76e1775f370f0a474fc65e93aaeffed0c4464317 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 24 Sep 2013 14:51:53 -0400 Subject: [PATCH 256/998] .off(): Add no-argument signature. Fixes #358 --- entries/off.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entries/off.xml b/entries/off.xml index b91ccc42..78ab983b 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -23,8 +23,11 @@ A selector which should match the one originally passed to .on() when attaching event handlers. + + 1.7 + -

    The .off() method removes event handlers that were attached with .on(). See the discussion of delegated and directly bound events on that page for more information. Specific event handlers can be removed on elements by providing combinations of event names, namespaces, selectors, or handler function names. When multiple filtering arguments are given, all of the arguments provided must match for the event handler to be removed.

    +

    The .off() method removes event handlers that were attached with .on(). See the discussion of delegated and directly bound events on that page for more information. Calling .off() with no arguments removes all handlers attached to the elements. Specific event handlers can be removed on elements by providing combinations of event names, namespaces, selectors, or handler function names. When multiple filtering arguments are given, all of the arguments provided must match for the event handler to be removed.

    If a simple event name such as "click" is provided, all events of that type (both direct and delegated) are removed from the elements in the jQuery set. When writing code that will be used as a plugin, or simply when working with a large code base, best practice is to attach and remove events using namespaces so that the code will not inadvertently remove event handlers attached by other code. All events of all types in a specific namespace can be removed from an element by providing just a namespace, such as ".myPlugin". At minimum, either a namespace or event name must be provided.

    To remove specific delegated event handlers, provide a selector argument. The selector string must exactly match the one passed to .on() when the event handler was attached. To remove all delegated events from an element without removing non-delegated events, use the special value "**".

    A handler can also be removed by specifying the function name in the handler argument. When jQuery attaches an event handler, it assigns a unique id to the handler function. Handlers proxied by jQuery.proxy() or a similar mechanism will all have the same unique id (the proxy function), so passing proxied handlers to .off may remove more handlers than intended. In those situations it is better to attach and remove event handlers using namespaces.

    From 126cd70c1aa49f3b8132dd987b216b9d1f30d357 Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Wed, 25 Sep 2013 06:28:44 -0500 Subject: [PATCH 257/998] jQuery.browser: Corrected link href to modernizr.com fixes #370 --- entries/jQuery.browser.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index b1c78f6c..fe0f3add 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -18,7 +18,7 @@

    This property is available immediately. It is therefore safe to use it to determine whether or not to call $(document).ready(). The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

    -

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

    +

    Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

    Show the browser info. From fef4356fe33812a8d398ca8411481504d742ed28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 25 Sep 2013 09:30:01 -0400 Subject: [PATCH 258/998] Upgrade to grunt-jquery-content 0.10.5. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f50b53e2..ff32cb15 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.10.2", + "grunt-jquery-content": "0.10.5", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From d4ae84ae24bb730c3b165d753404174f943c5227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 25 Sep 2013 09:30:21 -0400 Subject: [PATCH 259/998] 1.10.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff32cb15..750f088a 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": "1.10.3", + "version": "1.10.4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From f981228676c057cf1dfb35dbe63fa0ebeb8d7a32 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Tue, 15 Oct 2013 20:39:30 -0400 Subject: [PATCH 260/998] jQuery.ajax: getAllResponseHeaders hack is no longer needed This was fixed in FF21 a while ago as well as in webkit and blink: https://bugs.webkit.org/show_bug.cgi?id=41210 https://code.google.com/p/chromium/issues/detail?id=87338 https://bugs.webkit.org/show_bug.cgi?id=76419 https://bugzilla.mozilla.org/show_bug.cgi?id=608735 confirmed using http://jsfiddle.net/xeBub/7/ in browserstack --- entries/jQuery.ajax.xml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 3816729e..a8abca31 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -301,39 +301,6 @@ jqxhr.always(function() {

    The scriptCharset allows the character set to be explicitly specified for requests that use a <script> tag (that is, a type of script or jsonp). This is useful if the script and host page have differing character sets.

    The first letter in Ajax stands for "asynchronous," meaning that the operation occurs in parallel and the order of completion is not guaranteed. The async option to $.ajax() defaults to true, indicating that code execution can continue after the request is made. Setting this option to false (and thus making the call no longer asynchronous) is strongly discouraged, as it can cause the browser to become unresponsive.

    The $.ajax() function returns the XMLHttpRequest object that it creates. Normally jQuery handles the creation of this object internally, but a custom function for manufacturing one can be specified using the xhr option. The returned object can generally be discarded, but does provide a lower-level interface for observing and manipulating the request. In particular, calling .abort() on the object will halt the request before it completes.

    -

    At present, due to a bug in Firefox where .getAllResponseHeaders() returns the empty string although .getResponseHeader('Content-Type') returns a non-empty string, automatically decoding JSON CORS responses in Firefox with jQuery is not supported.

    -

    A workaround to this is possible by overriding jQuery.ajaxSettings.xhr as follows:

    -
    
    -(function() {
    -  var _super = jQuery.ajaxSettings.xhr,
    -    xhrCorsHeaders = [ "Cache-Control", "Content-Language", "Content-Type",
    -      "Expires", "Last-Modified", "Pragma" ];
    -
    -  jQuery.ajaxSettings.xhr = function() {
    -    var xhr = _super(),
    -      getAllResponseHeaders = xhr.getAllResponseHeaders;
    -
    -    xhr.getAllResponseHeaders = function() {
    -      var allHeaders = "";
    -      try {
    -        allHeaders = getAllResponseHeaders.apply( xhr );
    -        if ( allHeaders ) {
    -          return allHeaders;
    -        }
    -      } catch ( e ) {}
    -
    -      $.each( xhrCorsHeaders, function( i, headerName ) {
    -        if ( xhr.getResponseHeader( headerName ) ) {
    -          allHeaders += headerName + ": " + xhr.getResponseHeader( headerName ) + "\n";
    -        }
    -      });
    -      return allHeaders;
    -    };
    -
    -    return xhr;
    -  };
    -})();
    -    

    Extending Ajax

    As of jQuery 1.5, jQuery's Ajax implementation includes prefilters, transports, and converters that allow you to extend Ajax with a great deal of flexibility.

    From 3ca0bd09e7fd245e1004babedc53b10b7f434554 Mon Sep 17 00:00:00 2001 From: Nathaniel Higgins Date: Tue, 15 Oct 2013 20:46:18 -0400 Subject: [PATCH 261/998] Update one.xml - add example that shows multiple event types Makes it clear that one will trigger handlers once per event type. Fixes #352 --- entries/one.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/entries/one.xml b/entries/one.xml index e1ac7a82..8f55d4aa 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -1,7 +1,7 @@ .one() - Attach a handler to an event for the elements. The handler is executed at most once per element. + Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 1.1 @@ -107,6 +107,19 @@ $( "p" ).one( "click", function() { alert( $( this ).text() ); }); ]]> +
    + + Event handlers will trigger once per element per event type + + From 108c29a34f53d62268966b287349df97cbc56c64 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 15 Oct 2013 21:07:05 -0400 Subject: [PATCH 262/998] 1.10.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 750f088a..fed68346 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": "1.10.4", + "version": "1.10.5", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 1b940b9865f87018980ac8f592d45cb186d8d168 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 16 Oct 2013 08:54:35 -0400 Subject: [PATCH 263/998] jQuery #13421 et al.: add detail to CSS shorthand properties note --- entries/css.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/css.xml b/entries/css.xml index 491b28af..021ab125 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -19,7 +19,7 @@

    The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    -

    Shorthand CSS properties (e.g. margin, background, border) are not supported. For example, if you want to retrieve the rendered margin, use: $( elem ).css( "marginTop" ) and $( elem ).css( "marginRight" ), and so on.

    +

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $(elem).css('borderTopWidth'), $(elem).css('borderBottomWidth'), and so on.

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs.

    @@ -136,7 +136,7 @@ $( "div" ).click(function() {

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    -

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background> will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    +

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    
    
    From 4829a6d74bcc4c5566144a2c4a6d0ac3673e89b5 Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Wed, 16 Oct 2013 09:12:59 -0400
    Subject: [PATCH 264/998] .css(): Fix code formatting and add in-content
     example of array signature
    
    ---
     entries/css.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 021ab125..ec95b3cc 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -19,8 +19,8 @@
         
           

    The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    -

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $(elem).css('borderTopWidth'), $(elem).css('borderBottomWidth'), and so on.

    -

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs.

    +

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    +

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

    Get the background color of a clicked div. From 245e460ef938df3770ac5281e2d26d9e70b7eea4 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 18 Oct 2013 14:14:09 -0400 Subject: [PATCH 265/998] jQuery.each - Use passed val argument instead of this in example --- entries/jQuery.each.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index 03693a84..55cd16f9 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -48,10 +48,11 @@ $.each( obj, function( key, value ) { var arr = [ "one", "two", "three", "four", "five" ]; var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; -jQuery.each( arr, function() { - $( "#" + this ).text( "Mine is " + this + "." ); +jQuery.each( arr, function( i, val ) { + $( "#" + val ).text( "Mine is " + val + "." ); + // Will stop running after "three" - return ( this !== "three" ); + return ( val !== "three" ); }); jQuery.each( obj, function( i, val ) { From f2dc3853854cf3edb7dc6cb984a8efc4e6a82b47 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 19 Oct 2013 12:20:04 -0400 Subject: [PATCH 266/998] :eq() selector: Fix content related to selector. Fixes #376 --- entries/eq-selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml index e5b5e7ca..1d595ff1 100644 --- a/entries/eq-selector.xml +++ b/entries/eq-selector.xml @@ -18,7 +18,7 @@ Select the element at index n within the matched set.

    The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

    -

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(2)" ) selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    +

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(2)" ) selects the third element in the document with the class myclass, rather than the second. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    Prior to jQuery 1.8, the :eq(index) selector did not accept a negative value for index (though the .eq(index) method did).

    From 812081ed8dfc6e46bec0549a80028f3f11c2335d Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 19 Oct 2013 12:22:09 -0400 Subject: [PATCH 267/998] 1.10.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fed68346..24fd2e76 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": "1.10.5", + "version": "1.10.6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From 1cbe467f6f7ab021016594b93aa789d1998c232f Mon Sep 17 00:00:00 2001 From: antishok Date: Sun, 20 Oct 2013 00:51:57 -0400 Subject: [PATCH 268/998] Add .unbind() no-arguments signature --- entries/unbind.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entries/unbind.xml b/entries/unbind.xml index 489a7b4d..19a3d8a0 100644 --- a/entries/unbind.xml +++ b/entries/unbind.xml @@ -4,7 +4,7 @@ Remove a previously-attached event handler from the elements. 1.0 - + A string containing a JavaScript event type, such as click or submit. @@ -26,6 +26,9 @@ A JavaScript event object as passed to an event handler. + + 1.0 +

    Event handlers attached with .bind() can be removed with .unbind(). (As of jQuery 1.7, the .on() and .off() methods are preferred to attach and remove event handlers on elements.) In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements:

    
    
    From 916f0552c38962414331869b8f3f2bcd95e7b2d4 Mon Sep 17 00:00:00 2001
    From: chocolateboy 
    Date: Mon, 21 Oct 2013 08:34:10 -0400
    Subject: [PATCH 269/998] fix invalid :eq index (introduced in a3565d9)
    
    ---
     entries/eq-selector.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml
    index 1d595ff1..aad654c0 100644
    --- a/entries/eq-selector.xml
    +++ b/entries/eq-selector.xml
    @@ -18,12 +18,12 @@
       Select the element at index n within the matched set.
       
         

    The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

    -

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(2)" ) selects the third element in the document with the class myclass, rather than the second. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    +

    Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(1)" ) selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

    Prior to jQuery 1.8, the :eq(index) selector did not accept a negative value for index (though the .eq(index) method did).

    - Finds the third td. + Find the third td. From 3e9a924cb429d626c77117771446163bea051302 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 21 Oct 2013 08:35:58 -0400 Subject: [PATCH 270/998] 1.10.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24fd2e76..f5028936 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": "1.10.6", + "version": "1.10.7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From f2fa2e54b8d42807e8861ba1a8cbbcb160e86334 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 3 Nov 2013 20:48:29 -0500 Subject: [PATCH 271/998] jQuery.fx.interval: Remove note about prop having no effect in rAF. Fixes #380. --- entries/jQuery.fx.interval.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index 9f89cd32..cf67f484 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -8,7 +8,6 @@

    This property can be manipulated to adjust the number of frames per second at which animations will run. The default is 13 milliseconds. Making this a lower number could make the animations run smoother in faster browsers (such as Chrome) but there may be performance and CPU implications of doing so.

    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.

    -

    Note:jQuery.fx.interval currently has no effect in browsers that support the requestAnimationFrame property, such as Google Chrome 11. This behavior is subject to change in a future release.

    Cause all animations to run with less frames. From 26b0689267955b7f13e574f91d29d1f931582f79 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 4 Nov 2013 09:59:04 -0500 Subject: [PATCH 272/998] $.ajax: Remove recommendation to set accepts globally. Fxes #378. --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index a8abca31..fa35ac58 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -16,7 +16,7 @@ A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + The content type sent in the request header that tells the server what kind of response it will accept in return. By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). From 1b3bc19f49e1ff84b937ee68a5033dd3ad0a46e9 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Sun, 1 Dec 2013 10:24:06 -0500 Subject: [PATCH 273/998] jQuery.proxy, load-event: Fix two minor grammar issues. Closes gh-389. --- entries/jQuery.proxy.xml | 2 +- entries/load-event.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index 1ec94257..42a64dbd 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -49,7 +49,7 @@

    This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

    Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

    As of jQuery 1.6, any number of additional arguments may supplied to $.proxy(), and they will be passed to the function whose context will be changed.

    -

    As of jQuery 1.9, when the context is null or undefined the the proxied function will be called with the same this object as the proxy was called with. This allows $.proxy() to be used to partially apply the arguments of a function without changing the context.

    +

    As of jQuery 1.9, when the context is null or undefined the proxied function will be called with the same this object as the proxy was called with. This allows $.proxy() to be used to partially apply the arguments of a function without changing the context.

    Change the context of functions bound to a click handler using the "function, context" signature. Unbind the first handler after first click. diff --git a/entries/load-event.xml b/entries/load-event.xml index 16ab3180..30e7662a 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -61,7 +61,7 @@ $( window ).load(function() { ]]>
    - Add the class bigImg to all images with height greater then 100 upon each image load. + Add the class bigImg to all images with height greater than 100 upon each image load. From f373a30dfacf7beeafc5d35852415a429e8ed95e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 3 Dec 2013 12:18:38 +0100 Subject: [PATCH 275/998] Index: Fixed wording for consistency. Closes gh-390 --- entries/index.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/index.xml b/entries/index.xml index 5daa692e..16742497 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -79,7 +79,7 @@ alert( "Index: " + $( "#bar" ).index() );

    - On click, returns the index (based zero) of that div in the page. + On click, returns the index (zero-based) of that div in the page. Date: Tue, 3 Dec 2013 13:57:11 -0500 Subject: [PATCH 277/998] 1.10.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 871d44b5..6691c70d 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": "1.10.8", + "version": "1.10.9", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (http://jquery.org/)" From a36639caa59768ec0118917eb12b36a8da7652c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 10:44:55 -0500 Subject: [PATCH 278/998] Adjust URLs to be protocol-relative where necessary. Closes gh-392 --- LICENSE-MIT.txt | 2 +- categories.xml | 2 +- entries/contents.xml | 2 +- entries/deferred.always.xml | 2 +- entries/jQuery.getScript.xml | 4 ++-- entries/jQuery.noConflict.xml | 2 +- entries/keypress.xml | 2 +- entries/live.xml | 4 ++-- entries2html.xsl | 2 +- notes.xsl | 10 +++++----- package.json | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/LICENSE-MIT.txt b/LICENSE-MIT.txt index 091e6f07..bcf89b03 100644 --- a/LICENSE-MIT.txt +++ b/LICENSE-MIT.txt @@ -3,7 +3,7 @@ Copyright (c) 2013 jQuery Foundation, http://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history -and logs, available at http://github.com/jquery/api.jquery.com +and logs, available at https://github.com/jquery/api.jquery.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/categories.xml b/categories.xml index 5a94e236..b1eb7172 100644 --- a/categories.xml +++ b/categories.xml @@ -3,7 +3,7 @@ - + diff --git a/entries/contents.xml b/entries/contents.xml index 8a0a1355..833aea25 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -55,7 +55,7 @@ $( "p" ) $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" ); ]]> diff --git a/entries/deferred.always.xml b/entries/deferred.always.xml index 4dff5a86..57b3cf7f 100644 --- a/entries/deferred.always.xml +++ b/entries/deferred.always.xml @@ -19,7 +19,7 @@

    The argument can be either a single function or an array of functions. When the Deferred is resolved or rejected, the alwaysCallbacks are called. Since deferred.always() returns the Deferred object, other methods of the Deferred object can be chained to this one, including additional .always() methods. When the Deferred is resolved or rejected, callbacks are executed in the order they were added, using the arguments provided to the resolve, reject, resolveWith or rejectWith method calls. For more information, see the documentation for Deferred object.

    - Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. + Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. - Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. + Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. diff --git a/entries/live.xml b/entries/live.xml index 31473564..4ed78cc8 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -30,8 +30,8 @@ -

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

    -

    This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

    +

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

    +

    This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

    Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:

    
     $( selector ).live( events, data, handler );                // jQuery 1.3+
    diff --git a/entries2html.xsl b/entries2html.xsl
    index 35ac66cf..fe428c66 100755
    --- a/entries2html.xsl
    +++ b/entries2html.xsl
    @@ -12,7 +12,7 @@
     	<meta charset="utf-8">
     	<title> demo</title>
     	<style>	</style>
    -	<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    +	<script src="//code.jquery.com/jquery-1.9.1.js"></script>
     	<script>
     	
     	</script>
    diff --git a/notes.xsl b/notes.xsl
    index bec2e8da..87737d52 100644
    --- a/notes.xsl
    +++ b/notes.xsl
    @@ -8,22 +8,22 @@
     			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.
     		
     		
    -			Because  is a jQuery extension and not part of the CSS specification, queries using  cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. To achieve the best performance when using  to select elements, first select the elements using a pure CSS selector, then use .filter("").
    +			Because  is a jQuery extension and not part of the CSS specification, queries using  cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. To achieve the best performance when using  to select elements, first select the elements using a pure CSS selector, then use .filter("").
     		
     		
     			Because  is a jQuery extension and not part of the CSS specification, queries using  cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use  instead.
     		
     		
    -			All jQuery effects, including , can be turned off globally by setting jQuery.fx.off = true, which effectively sets the duration to 0. For more information, see jQuery.fx.off.
    +			All jQuery effects, including , can be turned off globally by setting jQuery.fx.off = true, which effectively sets the duration to 0. For more information, see jQuery.fx.off.
     		
     		
     			Note that this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.
     		
     		
    -			In Internet Explorer prior to version 9, using .prop() to set a DOM element property to anything other than a simple primitive value (number, string, or boolean) can cause memory leaks if the property is not removed (using .removeProp()) before the DOM element is removed from the document. To safely set values on DOM objects without memory leaks, use .data().
    +			In Internet Explorer prior to version 9, using .prop() to set a DOM element property to anything other than a simple primitive value (number, string, or boolean) can cause memory leaks if the property is not removed (using .removeProp()) before the DOM element is removed from the document. To safely set values on DOM objects without memory leaks, use .data().
     		
     		
    -			Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events. Similarly, events handled by .delegate() will propagate to the elements to which they are delegated; event handlers bound on any elements below it in the DOM tree will already have been executed by the time the delegated event handler is called. These handlers, therefore, may prevent the delegated handler from triggering by calling event.stopPropagation() or returning false.
    +			Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events. Similarly, events handled by .delegate() will propagate to the elements to which they are delegated; event handlers bound on any elements below it in the DOM tree will already have been executed by the time the delegated event handler is called. These handlers, therefore, may prevent the delegated handler from triggering by calling event.stopPropagation() or returning false.
     		
     		
     			Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol.
    @@ -32,7 +32,7 @@
     			Script and JSONP requests are not subject to the same origin policy restrictions.
     		
     		
    -			If a request with  returns an error code, it will fail silently unless the script has also called the global .ajaxError()  method. Alternatively, as of jQuery 1.5, the .error() method of the jqXHR object returned by  is also available for error handling.
    +			If a request with  returns an error code, it will fail silently unless the script has also called the global .ajaxError()  method. 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  method will not fire.
    diff --git a/package.json b/package.json
    index 6691c70d..e72e6a21 100644
    --- a/package.json
    +++ b/package.json
    @@ -5,7 +5,7 @@
       "version": "1.10.9",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
    -    "name": "jQuery Foundation (http://jquery.org/)"
    +    "name": "jQuery Foundation (https://jquery.org/)"
       },
       "repository": {
         "type": "git",
    
    From 5c628101e6d8156b452b9130ea105503c575795c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Wed, 4 Dec 2013 10:45:22 -0500
    Subject: [PATCH 279/998] 1.10.10
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index e72e6a21..64b1049a 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": "1.10.9",
    +  "version": "1.10.10",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation (https://jquery.org/)"
    
    From 080866273aa4bcb943d4ef2f9ca00529be49d515 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Wed, 4 Dec 2013 10:50:37 -0500
    Subject: [PATCH 280/998] Updated old docs.jquery.com URLs.
    
    ---
     categories.xml               | 2 +-
     entries/hidden-selector.xml  | 2 +-
     entries/visible-selector.xml | 2 +-
     3 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/categories.xml b/categories.xml
    index b1eb7172..ecfc683d 100644
    --- a/categories.xml
    +++ b/categories.xml
    @@ -38,7 +38,7 @@
         
         
           
         
         
    diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml
    index e866292d..6df903bf 100644
    --- a/entries/hidden-selector.xml
    +++ b/entries/hidden-selector.xml
    @@ -17,7 +17,7 @@
         

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    -

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    +

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index ecd43762..a6a6efa4 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -11,7 +11,7 @@

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

    Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    -

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    +

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    From c32efbd7efe0a11c72c9ad71d073f3fd8d29dc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 10:53:42 -0500 Subject: [PATCH 281/998] Use jQuery 1.10.2 for examples. --- entries2html.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries2html.xsl b/entries2html.xsl index fe428c66..85c33b39 100755 --- a/entries2html.xsl +++ b/entries2html.xsl @@ -12,7 +12,7 @@ <meta charset="utf-8"> <title> demo</title> <style> </style> - <script src="//code.jquery.com/jquery-1.9.1.js"></script> + <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> </script> From 509432516ef12126378b2582051c89df97b2f13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 10:53:55 -0500 Subject: [PATCH 282/998] 1.10.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64b1049a..d8bee94a 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": "1.10.10", + "version": "1.10.11", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From c4259ad02325efd6dd56dcf70be85cd4447f17b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 11:13:32 -0500 Subject: [PATCH 283/998] Use HTTPS for URL in license. --- LICENSE-MIT.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE-MIT.txt b/LICENSE-MIT.txt index bcf89b03..27ec7f48 100644 --- a/LICENSE-MIT.txt +++ b/LICENSE-MIT.txt @@ -1,5 +1,5 @@ Copyright (c) 2009 Packt Publishing, http://packtpub.com/ -Copyright (c) 2013 jQuery Foundation, http://jquery.org/ +Copyright (c) 2013 jQuery Foundation, https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history From c960a25994d62d1c39c3c5641c01fd544181557f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 11:28:53 -0500 Subject: [PATCH 284/998] Adjust URLs to be root-relative in pages. --- pages/Types.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/Types.html b/pages/Types.html index f94272e8..9eecb80b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -112,7 +112,7 @@

    Quoting

    "<a href=\"home\">Home</a>"

    Built-in Methods

    -

    A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array. +

    A string in JavaScript has some built-in methods to manipulate the string, though the result is always a new string - or something else, eg. split returns an array.

    "hello".charAt( 0 ) // "h"
     "hello".toUpperCase() // "HELLO"
    @@ -291,7 +291,7 @@ 

    Iteration

    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: +

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

    jQuery.each( obj, function( key, value ) {
       console.log( "key", key, "value", value );
    @@ -360,7 +360,7 @@ 

    Iteration

    // Do something with item }
    -

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

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

    var x = [ 1, 2, 3 ];
     jQuery.each( x, function( index, value ) {
    @@ -544,7 +544,7 @@ 

    Callback

    Selector

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via AJAX.

    -

    The selectors are a composition of CSS and custom additions. All selectors available in jQuery are documented on the Selectors API page. +

    The selectors are a composition of CSS and custom additions. All selectors available in jQuery are documented on the Selectors API page.

    There are lot of plugins that leverage jQuery's selectors in other ways. The validation plugin accepts a selector to specify a dependency, whether an input is required or not:

    @@ -559,7 +559,7 @@

    Selector

    Event

    jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler (no checks for window.event required). It normalizes the target, relatedTarget, which, metaKey and pageX/Y properties and provides both stopPropagation() and preventDefault() methods.

    -

    Those properties are all documented, and accompanied by examples, on the Event object page. +

    Those properties are all documented, and accompanied by examples, on the Event object page.

    The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

    @@ -607,13 +607,13 @@

    XMLHttpRequest

    Google does not appear to have an official page for their XHR documentation for Chrome. As of version 5, Chrome does not support the use of the file protocol for XHR requests.

    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 +

    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

    Deferred Object

    -

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function. +

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

    Promise Object

    -

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred. +

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred.

    Callbacks Object

    A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

    From 03db35cd98fc13221b983691a3d59143fb00d249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 4 Dec 2013 11:29:00 -0500 Subject: [PATCH 285/998] 1.10.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8bee94a..14041faf 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": "1.10.11", + "version": "1.10.12", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From e0a68341e7156682a0c4b37fdaf684868545f871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 13 Dec 2013 12:18:50 -0500 Subject: [PATCH 286/998] AJAX -> Ajax --- categories.xml | 10 +++++----- entries/jQuery.ajaxSetup.xml | 2 +- pages/Types.html | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/categories.xml b/categories.xml index ecfc683d..4255912c 100644 --- a/categories.xml +++ b/categories.xml @@ -1,18 +1,18 @@ - + - + - + - + - + diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml index 28e9802f..d9589e3a 100644 --- a/entries/jQuery.ajaxSetup.xml +++ b/entries/jQuery.ajaxSetup.xml @@ -11,7 +11,7 @@

    For details on the settings available for $.ajaxSetup(), see $.ajax().

    All subsequent Ajax calls using any function will use the new settings, unless overridden by the individual calls, until the next invocation of $.ajaxSetup().

    -

    Note: The settings specified here will affect all calls to $.ajax or AJAX-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

    +

    Note: The settings specified here will affect all calls to $.ajax or Ajax-based derivatives such as $.get(). This can cause undesirable behavior since other callers (for example, plugins) may be expecting the normal default settings. For that reason we strongly recommend against using this API. Instead, set the options explicitly in the call or define a simple plugin to do so.

    For example, the following sets a default for the url parameter before pinging the server repeatedly:

    
     $.ajaxSetup({
    diff --git a/pages/Types.html b/pages/Types.html
    index 9eecb80b..8c3dee9f 100644
    --- a/pages/Types.html
    +++ b/pages/Types.html
    @@ -542,7 +542,7 @@ 

    Callback


    Selector

    -

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via AJAX. +

    A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax.

    The selectors are a composition of CSS and custom additions. All selectors available in jQuery are documented on the Selectors API page.

    @@ -594,7 +594,7 @@

    jQuery

    $( ".badEntry" ).css({ color: "red" });
     

    XMLHttpRequest

    -

    Some of jQuery's AJAX functions return the native XMLHttpRequest (XHR) object, or pass it as an argument to success/error/complete handlers, so that you can do additional processing or monitoring on the request. Note that AJAX functions only return or pass an XHR object when an XHR object is actually used in the request. For example, JSONP requests and cross-domain GET requests use a script element rather than an XHR object. +

    Some of jQuery's Ajax functions return the native XMLHttpRequest (XHR) object, or pass it as an argument to success/error/complete handlers, so that you can do additional processing or monitoring on the request. Note that Ajax functions only return or pass an XHR object when an XHR object is actually used in the request. For example, JSONP requests and cross-domain GET requests use a script element rather than an XHR object.

    Although the XHR object is a standard, there are variations in its behavior on different browsers. Refer to the W3C site and browsers' documentation for more information:

    From c61edbe37f5a6a06d7d25ce5854f35725fb3219d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 13 Dec 2013 12:18:57 -0500 Subject: [PATCH 287/998] 1.10.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14041faf..721438ee 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": "1.10.12", + "version": "1.10.13", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 6ddb384a3e782b7d88742a36eee77e2a91e584ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 31 Dec 2013 09:48:19 -0500 Subject: [PATCH 288/998] Docs: Removed IRC channel links in CONTRIBUTING.md GitHub doesn't support links with the irc protocol, so these were dead links. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f6ce8293..ba9f6b8f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,4 +2,4 @@ Welcome! Thanks for your interest in contributing to api.jquery.com. You're **al You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). -You can find us on [IRC](http://irc.jquery.org), specifically in [#jquery-dev](irc://irc.freenode.net/#jquery-dev) and [#jquery-content](irc://irc.freenode.net/#jquery-content) should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). +You can find us on [IRC](http://irc.jquery.org), specifically in #jquery-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). From 2a925594f0640e74154528719edc005370cebb3e Mon Sep 17 00:00:00 2001 From: Robert Levy Date: Thu, 2 Jan 2014 11:22:59 -0500 Subject: [PATCH 289/998] Types: Refer to deferred.state instead of deprecated APIs Closes gh-408 deferred.isResolved and .isRejected were deprecated then removed in favor of .state --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 8c3dee9f..3ab239c0 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -613,7 +613,7 @@

    Deferred Object

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

    Promise Object

    -

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe. isResolved, and isRejected) to prevent users from changing the state of the Deferred. +

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, and state) to prevent users from changing the state of the Deferred.

    Callbacks Object

    A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

    From 75a361341075280453582ef22b7f75d4ea1c976c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 6 Jan 2014 13:25:10 -0500 Subject: [PATCH 290/998] Build: Upgrade to grunt-jquery-content 0.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 721438ee..3efc2069 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.10.5", + "grunt-jquery-content": "0.11.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From bad351189c5183397aaa82a5ceb107f84edead13 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Tue, 14 Jan 2014 17:16:42 -0800 Subject: [PATCH 291/998] Ajax_Events: Update examples so they are consistent Examples should be consistent in where they log to and attached to document instead of elsewhere --- entries/ajaxError.xml | 2 +- entries/ajaxStop.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 801fef62..4029c7be 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -19,7 +19,7 @@

    Attach the event handler to the document:

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

    Now, make an Ajax request using any jQuery method:

    diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 88d318e5..63e14639 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -18,8 +18,8 @@

    Attach the event handler to the document:

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

    Now, make an Ajax request using any jQuery method:

    From eecc8cb059009d70ac8482146ff5db54732c48d7 Mon Sep 17 00:00:00 2001 From: Maurice Gottlieb Date: Sun, 29 Dec 2013 14:44:03 +0100 Subject: [PATCH 292/998] Remove superfluous quotes from demo code Closes gh-407 --- entries/index.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/index.xml b/entries/index.xml index 16742497..ecd46243 100644 --- a/entries/index.xml +++ b/entries/index.xml @@ -133,7 +133,7 @@ $( "div" ).html( "Index: " + $( "li" ).index( listItem ) ); } ]]>

    The result of this call is a red background on items A, B, 1, 2, 3, and C. Even though item II matches the selector expression, it is not included in the results; only descendants are considered candidates for the match.

    -

    Unlike in the rest of the tree traversal methods, the selector expression is required in a call to .find(). If we need to retrieve all of the descendant elements, we can pass in the universal selector '*' to accomplish this.

    +

    Unlike most of the tree traversal methods, the selector expression is required in a call to .find(). If we need to retrieve all of the descendant elements, we can pass in the universal selector '*' to accomplish this.

    Selector context is implemented with the .find() method; therefore, $( "li.item-ii" ).find( "li" ) is equivalent to $( "li", "li.item-ii" ).

    As of jQuery 1.6, we can also filter the selection with a given jQuery collection or element. With the same nested list as above, if we start with:

    From c3ceeb43edbacb68ce7f1514bf17b6b0adebaba2 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 26 Jan 2014 17:53:19 -0500 Subject: [PATCH 294/998] Document escaping HTML, script injection. Fixes #23 --- entries/after.xml | 1 + entries/append.xml | 1 + entries/appendTo.xml | 1 + entries/before.xml | 1 + entries/html.xml | 1 + entries/insertAfter.xml | 1 + entries/insertBefore.xml | 1 + entries/prepend.xml | 1 + entries/prependTo.xml | 1 + notes.xsl | 3 +++ 10 files changed, 12 insertions(+) diff --git a/entries/after.xml b/entries/after.xml index 03324a88..8c0fe2c3 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -100,6 +100,7 @@ $( "p" ).first().after( $newdiv1, [ newdiv2, existingdiv1 ] );

    Since .after() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().after( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on the elements that are collected in the code.

    + Inserts some HTML after all paragraphs.

    Since .append() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').append( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Appends some HTML to all paragraphs.

    Since .before() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().before( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Inserts some HTML before all paragraphs.

    Since .prepend() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "body" ).prepend( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Prepends some HTML to all paragraphs. 1.3.2 - + An existing jQuery object to add to the set of matched elements. From 3fe6131a8747de97a749257fc752f32c9b2f723e Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 26 Jan 2014 20:42:01 -0500 Subject: [PATCH 296/998] Extend: Do not extend cyclical data structures, closes gh-332 --- entries/jQuery.extend.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 594a1b75..958e9d14 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -37,8 +37,8 @@

    The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second or subsequent object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

    Warning: Passing false for the first argument is not supported.

    Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

    -

    On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not.

    -

    For needs that fall outside of this behavior, write a custom extend method instead.

    +

    On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not. Deep-extending a cyclical data structure will result in an error.

    +

    For needs that fall outside of this behavior, write a custom extend method instead, or use a library like lodash.

    Merge two objects, modifying the first. From 4cf1841161e07369ac7d273da669ab00d594b327 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 26 Jan 2014 20:56:21 -0500 Subject: [PATCH 297/998] Types: Clarify behavior of jQuery-object-returning methods, ref gh-338 --- pages/Types.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index 3ab239c0..e8a53c47 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -585,6 +585,8 @@

    jQuery

    Most frequently, you will use the jQuery() function to create a jQuery object. jQuery() can also be accessed by its familiar single-character alias of $(), unless you have called jQuery.noConflict() to disable this option. Many jQuery methods return the jQuery object itself, so that method calls can be chained:

    +

    In API calls that return jQuery, the value returned will be the original jQuery object unless otherwise documented by that API. API methods such as .filter() or .not() modify their incoming set and thus return a new jQuery object. +

    $( "p" ).css( "color", "red" ).find( ".special" ).css( "color", "green" );
     

    Whenever you use a "destructive" jQuery method that potentially changes the set of elements in the jQuery object, such as .filter() or .find(), that method actually returns a new jQuery object with the resulting elements. To return to the previous jQuery object, you use the .end() method. From b03d09a676acda8234164048a79c378272e4d31b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 26 Jan 2014 21:11:06 -0500 Subject: [PATCH 298/998] CSS: Clarify computed style, closes gh-322 --- entries/css.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entries/css.xml b/entries/css.xml index ec95b3cc..6a5391cc 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -15,10 +15,11 @@ An array of one or more CSS properties. - Get the value of style properties for the first element in the set of matched elements. + Get the computed style properties for the first element in the set of matched elements.

    The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    -

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    +

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ).

    +

    Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

    From e482af6a58b0f41125a995150e5e6d1bcc2075a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Boucher?= Date: Sun, 26 Jan 2014 21:37:28 -0500 Subject: [PATCH 299/998] append() clones for all elements but the last one, not first. Closes #344 --- entries/append.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/append.xml b/entries/append.xml index 7804eee1..d8b4ebb9 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -66,7 +66,7 @@ $( ".container" ).append( $( "h2" ) ); <h2>Greetings</h2> </div>
    -

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    Additional Arguments

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

    From 2ee862f48b3c1597f0ccff71fe8641e99fd18cdb Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 26 Jan 2014 22:42:06 -0500 Subject: [PATCH 300/998] Update bind() - preventBubble argument is optional. Closes #416 --- entries/bind.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/bind.xml b/entries/bind.xml index 8daadb80..3b00923b 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -21,7 +21,7 @@ An object containing data that will be passed to the event handler. - + Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. From cbebba7e889f16eabb04960ebe50a94292a192af Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 26 Jan 2014 22:46:09 -0500 Subject: [PATCH 301/998] Update is(). Argument can take more than one element. Closes #415 --- entries/is.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/is.xml b/entries/is.xml index 86715968..20ebd45d 100644 --- a/entries/is.xml +++ b/entries/is.xml @@ -21,8 +21,8 @@ 1.6 - - An element to match the current set of elements against. + + One or more elements to match the current set of elements against. Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. From e47e9746b09bd3b54f7ceb92a043bc4fcf5d6cea Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 26 Jan 2014 22:47:18 -0500 Subject: [PATCH 302/998] 1.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3efc2069..4c711514 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": "1.10.13", + "version": "1.11.0", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 834e5503807fdbb58ff651e7da5b7ddeb2aef060 Mon Sep 17 00:00:00 2001 From: davidfregoli Date: Wed, 29 Jan 2014 07:58:32 -0500 Subject: [PATCH 303/998] Update SOP note in notes.xsl. Closes #398 --- notes.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes.xsl b/notes.xsl index 5925cd3f..c14473ee 100644 --- a/notes.xsl +++ b/notes.xsl @@ -26,7 +26,7 @@ Since the .live() method handles events once they have propagated to the top of the document, it is not possible to stop propagation of live events. Similarly, events handled by .delegate() will propagate to the elements to which they are delegated; event handlers bound on any elements below it in the DOM tree will already have been executed by the time the delegated event handler is called. These handlers, therefore, may prevent the delegated handler from triggering by calling event.stopPropagation() or returning false. - Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol. + Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol. Script and JSONP requests are not subject to the same origin policy restrictions. From dc83917209b4a637dcadb2c70692a3ea0490ea97 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 8 Feb 2014 14:07:42 -0500 Subject: [PATCH 304/998] .get() and .toArray(): Remove "DOM" from description. Fixes gh-443. --- entries/get.xml | 4 ++-- entries/toArray.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/get.xml b/entries/get.xml index d9e7428f..59457611 100644 --- a/entries/get.xml +++ b/entries/get.xml @@ -9,7 +9,7 @@ A zero-based integer indicating which element to retrieve. - Retrieve one of the DOM elements matched by the jQuery object. + Retrieve one of the elements matched by the jQuery object.

    The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

    
    @@ -71,7 +71,7 @@ $( "*", document.body ).click(function( event ) {
         
           1.0
         
    -    Retrieve the DOM elements matched by the jQuery object.
    +    Retrieve the elements matched by the jQuery object.
         
           

    Consider a simple unordered list:

    
    diff --git a/entries/toArray.xml b/entries/toArray.xml
    index 73991abe..dc57da06 100644
    --- a/entries/toArray.xml
    +++ b/entries/toArray.xml
    @@ -4,7 +4,7 @@
       
         1.4
       
    -  Retrieve all the DOM elements contained in the jQuery set, as an array.
    +  Retrieve all the elements contained in the jQuery set, as an array.
       
         

    .toArray() returns all of the elements in the jQuery set:

    
    @@ -16,7 +16,7 @@ alert( $( "li" ).toArray() );
         

    - Selects all divs in the document and returns the DOM Elements as an Array, then uses the built-in reverse-method to reverse that array. + Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. Date: Sat, 8 Feb 2014 14:10:38 -0500 Subject: [PATCH 305/998] 1.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c711514..9f282076 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": "1.11.0", + "version": "1.11.1", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From a7a562ca732e75062fbdc86526bd9f2b30f327b0 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sat, 8 Feb 2014 14:16:53 -0500 Subject: [PATCH 306/998] parseHTML: Add security warning, closes gh-59 --- entries/jQuery.parseHTML.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index a6e3bab6..b0d245e6 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -17,6 +17,8 @@

    jQuery.parseHTML uses a native DOM element creation function to convert the string to a set of DOM elements, which can then be inserted into the document.

    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.

    +

    Security Considerations

    +

    Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run script in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute script 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. From 0e31d5adf9e5b5cd95b91c68cd73e9f766588d27 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sat, 8 Feb 2014 14:46:32 -0500 Subject: [PATCH 307/998] Dimensions: values are non-integer and unreliable zoomed. Fixes gh-76, gh-103 --- entries/height.xml | 3 ++- entries/innerHeight.xml | 3 ++- entries/innerWidth.xml | 3 ++- entries/offset.xml | 5 +++-- entries/outerHeight.xml | 5 +++-- entries/outerWidth.xml | 3 ++- entries/position.xml | 3 ++- entries/width.xml | 3 ++- notes.xsl | 3 +++ 9 files changed, 21 insertions(+), 10 deletions(-) diff --git a/entries/height.xml b/entries/height.xml index 3632ed02..dd809c0f 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -1,7 +1,7 @@ Get the current computed height for the first element in the set of matched elements or set the height of every matched element. - + .height() 1.0 @@ -22,6 +22,7 @@ $( document ).height(); // returns height of HTML document

    Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

    + Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body.

    Since .after() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().after( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on the elements that are collected in the code.

    + Inserts some HTML after all paragraphs. diff --git a/entries/before.xml b/entries/before.xml index 13bfce2c..16738d29 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -80,6 +80,7 @@ $( "p" ).first().before( newdiv1, [ newdiv2, existingdiv1 ] );

    Since .before() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "p" ).first().before( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Inserts some HTML before all paragraphs. diff --git a/entries/replaceWith.xml b/entries/replaceWith.xml index 17e81829..0f01e47b 100644 --- a/entries/replaceWith.xml +++ b/entries/replaceWith.xml @@ -63,18 +63,8 @@ $( "div.third" ).replaceWith( $( ".first" ) );

    This example demonstrates that the selected element replaces the target by being moved from its old location, not by being cloned.

    The .replaceWith() method, like most jQuery methods, returns the jQuery object so that other methods can be chained onto it. However, it must be noted that the original jQuery object is returned. This object refers to the element that has been removed from the DOM, not the new element that has replaced it.

    -

    As of jQuery 1.4, .replaceWith() can also work on disconnected DOM nodes. For example, with the following code, .replaceWith() returns a jQuery set containing only a paragraph.:

    -
    
    -$( "<div/>" ).replaceWith( "<p></p>" );
    -    
    -

    The .replaceWith() method can also take a function as its argument:

    -
    
    -$( "div.container" ).replaceWith(function() {
    -  return $( this ).contents();
    -});
    -    
    -

    This results in <div class="container"> being replaced by its three child <div>s. The return value of the function may be an HTML string, DOM element, or jQuery object.

    + On click, replace the button with a div containing the same word. The numbers returned by dimensions-related APIs, including , may be fractional in some cases. Code should not assume it is an integer. Also, dimensions may be incorrect when the page is zoomed by the user; browsers do not expose an API to detect this condition. + - Prior to jQuery 1.9, would attempt to add or change nodes in the current jQuery set if the first node in the set was not connected to a document, and in those cases return a new jQuery set rather than the original set. The method might or might not return a new result depending on the number or connectedness of its arguments! As of jQuery 1.9, these methods always return the original unmodified set and attempting to use .after(), .before(), or .replaceWith() on a node without a parent has no effect--that is, neither the set or the nodes it contains are changed. + Prior to jQuery 1.9, would attempt to add or change nodes in the current jQuery set if the first node in the set was not connected to a document, and in those cases return a new jQuery set rather than the original set. The method might or might not have returned a new result depending on the number or connectedness of its arguments! As of jQuery 1.9, .after(), .before(), and .replaceWith() always return the original unmodified set. Attempting to use these methods on a node without a parent has no effect—that is, neither the set nor the nodes it contains are changed. Selected elements are in the order of their appearance in the document. From 258b3dcb5f22d091c76fc6dac114f4505f1e6be8 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 8 Feb 2014 15:03:53 -0500 Subject: [PATCH 310/998] 1.11.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f282076..d57081d2 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": "1.11.1", + "version": "1.11.2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From ece34cf78bcd213546c4bdd99ffd8c35601a1602 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 11 Feb 2014 14:11:19 -0800 Subject: [PATCH 311/998] More emphasis about element order with .add() and jQuery() Fixes gh-240 Closes #435 --- entries/add.xml | 2 +- entries/jQuery.xml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/entries/add.xml b/entries/add.xml index cf110550..e93025df 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -37,7 +37,7 @@ Add elements to the set of matched elements.

    Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

    -

    Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order, use the $(array_of_DOM_elements) signature.

    +

    Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order and without sorting overhead, use the $(array_of_DOM_elements) signature.

    The updated set of elements can be used in a following (chained) method, or assigned to a variable for later use. For example:

    
     $( "p" ).add( "div" ).addClass( "widget" );
    diff --git a/entries/jQuery.xml b/entries/jQuery.xml
    index 3cd7dedb..014a5fcf 100644
    --- a/entries/jQuery.xml
    +++ b/entries/jQuery.xml
    @@ -57,9 +57,8 @@ $( "div.foo" ).click(function() {
           

    Internally, selector context is implemented with the .find() method, so $( "span", this ) is equivalent to $( this ).find( "span" ).

    Using DOM elements

    -

    The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way.

    -

    Note: These formulations are meant to consume only DOM elements; feeding mixed data to the elementArray form is particularly discouraged.

    -

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

    +

    The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way. When passing an array, each element must be a DOM element; mixed data is not supported. A jQuery object is created from the array elements in the order they appeared in the array; unlike most other multi-element jQuery operations, the elements are not sorted in DOM order.

    +

    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() {
       $( this ).slideUp();
    
    From 49699e71cc0387ba10e6eb651c90d1254ce2b969 Mon Sep 17 00:00:00 2001
    From: Dave Methvin 
    Date: Tue, 11 Feb 2014 14:21:05 -0800
    Subject: [PATCH 312/998] Fix broken links to docs.jquery.com.
    
    Fixes gh-169
    Closes #432
    ---
     categories.xml               | 8 ++++----
     entries/hidden-selector.xml  | 2 +-
     entries/visible-selector.xml | 2 +-
     3 files changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/categories.xml b/categories.xml
    index 4255912c..8db3b46b 100644
    --- a/categories.xml
    +++ b/categories.xml
    @@ -328,22 +328,22 @@ jQuery.event.props.push( "dataTransfer" );
         
         
           
         
         
           
         
         
           
         
         
           
         
         
    diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml
    index 6df903bf..2daf20e6 100644
    --- a/entries/hidden-selector.xml
    +++ b/entries/hidden-selector.xml
    @@ -17,7 +17,7 @@
         

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    -

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    +

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index a6a6efa4..59fc4b42 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -11,7 +11,7 @@

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

    Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

    -

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    +

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    From 0051b225f73aae7b719afa2b8d2da2363a0c4082 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 11 Feb 2014 14:32:56 -0800 Subject: [PATCH 313/998] inner/outer height/width setters Fixes gh-98 Closes #431 --- entries/innerWidth.xml | 65 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index dbfe77bc..c2e30f3d 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -1,10 +1,12 @@ - + + Get the current computed inner width (including padding but not border) for the first element in the set of matched elements or set the inner width of every matched element. + .innerWidth() 1.2.6 - Get the current computed width for the first element in the set of matched elements, including padding but not border. + Get the current computed inner width for the first element in the set of matched elements, including padding but not border.

    This method returns the width of the element, including left and right padding, in pixels.

    This method is not applicable to window and document objects; for these, use .width() instead.

    @@ -36,3 +38,62 @@ $( "p:last" ).text( "innerWidth:" + p.innerWidth() );
    + + + + 1.8.0 + + + + A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + + + 1.8.0 + + A function returning the inner width (including padding but not border) to set. Receives the index position of the element in the set and the old inner width as arguments. Within the function, this refers to the current element in the set. + + +Set the CSS inner width of each element in the set of matched elements. + +

    When calling .innerWidth("value"), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used for the width (such as 100px, 50%, or auto). Note that in modern browsers, the CSS width property does not include padding, border, or margin, unless the box-sizing CSS property is used.

    +

    If no explicit unit is specified (like "em" or "%") then "px" is assumed.

    +
    + + Change the inner width of each div the first time it is clicked (and change its color). + + + + + + + + +
    +
    From 04fa3f5a6c930b0596d4dea38c0727bfe315e55a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 11 Feb 2014 14:38:41 -0800 Subject: [PATCH 314/998] event.which text update --- entries/event.which.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/event.which.xml b/entries/event.which.xml index f2f74685..efa9cddf 100644 --- a/entries/event.which.xml +++ b/entries/event.which.xml @@ -29,7 +29,7 @@ $( "#whichkey" ).on( "mousedown", function( event ) { }); ]]>
    From 2b156c298a395d69baa33626edde2c8f09f274b9 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 15 Feb 2014 10:55:14 -0700 Subject: [PATCH 315/998] 1.11.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d57081d2..d397cfd9 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": "1.11.2", + "version": "1.11.3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 2152cf588bf756f115a70682ef0c07774f0e4243 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Sat, 15 Feb 2014 11:32:22 -0700 Subject: [PATCH 316/998] Insertion methods: Correct description of insertion cloning behavior. Closes gh-438 --- entries/after.xml | 2 +- entries/append.xml | 2 +- entries/before.xml | 2 +- entries/prepend.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index b55e3e96..2c8869c9 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -60,7 +60,7 @@ $( ".container" ).after( $( "h2" ) ); </div> <h2>Greetings</h2>
    -

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    +

    Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    Inserting Disconnected DOM nodes

    As of jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes. For example, given the following code:

    $( "<div></div>" ).after( "<p></p>" );
    diff --git a/entries/append.xml b/entries/append.xml index d8b4ebb9..5903fa05 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -66,7 +66,7 @@ $( ".container" ).append( $( "h2" ) ); <h2>Greetings</h2> </div>
    -

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    +

    Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    Additional Arguments

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

    diff --git a/entries/before.xml b/entries/before.xml index 16738d29..4aeae8d6 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -62,7 +62,7 @@ $( ".container" ).before( $( "h2" ) ); <div class="inner">Goodbye</div> </div> -

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    +

    Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    In jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes:

    
     $( "<div>" ).before( "<p></p>" );
    diff --git a/entries/prepend.xml b/entries/prepend.xml
    index df99494c..ca783d51 100644
    --- a/entries/prepend.xml
    +++ b/entries/prepend.xml
    @@ -66,7 +66,7 @@ $( ".container" ).prepend( $( "h2" ) );
         <div class="inner">Goodbye</div>
     </div>
     
    -

    Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    +

    Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

    Additional Arguments

    Similar to other content-adding methods such as .append() and .before(), .prepend() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the first three child nodes of the body:

    From 7c87b42f559fee080dd90f923a9f7655b57e2d66 Mon Sep 17 00:00:00 2001 From: michalstanko Date: Sat, 15 Feb 2014 16:06:59 -0700 Subject: [PATCH 317/998] jQuery.proxy(): Add missing word --- entries/jQuery.proxy.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index 42a64dbd..e7c5f0ff 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -48,7 +48,7 @@

    This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

    Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

    -

    As of jQuery 1.6, any number of additional arguments may supplied to $.proxy(), and they will be passed to the function whose context will be changed.

    +

    As of jQuery 1.6, any number of additional arguments may be supplied to $.proxy(), and they will be passed to the function whose context will be changed.

    As of jQuery 1.9, when the context is null or undefined the proxied function will be called with the same this object as the proxy was called with. This allows $.proxy() to be used to partially apply the arguments of a function without changing the context.

    From f96d8d861ba7fc08e83090439b10a7c8dfe287e3 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Fri, 14 Feb 2014 09:09:31 -0800 Subject: [PATCH 318/998] Types: Add Date type Fixes jquery/api.jqueryui.com#194 Closes gh-445 --- pages/Types.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index e8a53c47..f1987a32 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -73,6 +73,7 @@
  • PlainObject
  • +
  • Date
  • Function
    • Arguments
    • @@ -421,6 +422,18 @@

      PlainObject

      jQuery.isPlainObject( o ); // true +

      Date

      +

      The Date type is a JavaScript object that represents a single moment in time. Date objects are instantiated using their constructor function, which by default creates an object that represents the current date and time. +

      +
      
      +new Date();
      +
      +

      To create a Date object for an alternative date and time, pass numeric arguments in the following order: year, month, day, minute, second, millisecond - although note that the month is zero-based, whereas the other arguments are one-based. The following creates a Date object representing January 1st, 2014 at 8:15. +

      +
      
      +new Date( 2014, 0, 1, 8, 15 );
      +
      +

      Function

      A function in JavaScript can be either named or anonymous. Any function can be assigned to a variable or passed to a method, but passing member functions this way can cause them to be called in the context of another object (i.e. with a different "this" object).

      From 6a7601fff5c3fcd6dea92f6dd8d3c7cb5ce34feb Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 17 Feb 2014 23:10:15 -0500 Subject: [PATCH 319/998] Types: Punctuation. No ticket. --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index f1987a32..5a4f10d6 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -428,7 +428,7 @@

      Date

      
       new Date();
       
      -

      To create a Date object for an alternative date and time, pass numeric arguments in the following order: year, month, day, minute, second, millisecond - although note that the month is zero-based, whereas the other arguments are one-based. The following creates a Date object representing January 1st, 2014 at 8:15. +

      To create a Date object for an alternative date and time, pass numeric arguments in the following order: year, month, day, minute, second, millisecond — although note that the month is zero-based, whereas the other arguments are one-based. The following creates a Date object representing January 1st, 2014, at 8:15.

      
       new Date( 2014, 0, 1, 8, 15 );
      
      From c6d5da3b86dd3b8c5aff197058b1490e931aadf2 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Mon, 17 Feb 2014 23:10:25 -0500
      Subject: [PATCH 320/998] 1.11.4
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index d397cfd9..907a22e2 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": "1.11.3",
      +  "version": "1.11.4",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (https://jquery.org/)"
      
      From 356fbe9b47ac80afb22d203dfcb62850c72ef5ec Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Wed, 26 Feb 2014 16:13:57 -0500
      Subject: [PATCH 321/998] get.xml: Add note about returning undefined when
       number out of bounds
      
      ---
       entries/get.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/get.xml b/entries/get.xml
      index 59457611..5698760d 100644
      --- a/entries/get.xml
      +++ b/entries/get.xml
      @@ -11,7 +11,7 @@
           
           Retrieve one of the elements matched by the jQuery object.
           
      -      

      The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

      +

      The .get() method grants access to the DOM nodes underlying each jQuery object. If the value of index is out of bounds — less than 0 or equal to or greater than the number of elements — it returns undefined. Consider a simple unordered list:

      
       <ul>
         <li id="foo">foo</li>
      
      From 501e5a44e068e1be73ee3913b57ac3ce34c0644c Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Wed, 26 Feb 2014 16:56:47 -0500
      Subject: [PATCH 322/998] closest.xml: Sublist  should be indented for style
       consistency with sublist
      
      Closes #394.
      
      Author:    Aurelio De Rosa 
      ---
       entries/closest.xml | 22 +++++++++++-----------
       1 file changed, 11 insertions(+), 11 deletions(-)
      
      diff --git a/entries/closest.xml b/entries/closest.xml
      index b3c8e169..9a01fb1e 100644
      --- a/entries/closest.xml
      +++ b/entries/closest.xml
      @@ -64,17 +64,17 @@
       <ul id="one" class="level-1">
         <li class="item-i">I</li>
         <li id="ii" class="item-ii">II
      -  <ul class="level-2">
      -    <li class="item-a">A</li>
      -    <li class="item-b">B
      -      <ul class="level-3">
      -        <li class="item-1">1</li>
      -        <li class="item-2">2</li>
      -        <li class="item-3">3</li>
      -      </ul>
      -    </li>
      -    <li class="item-c">C</li>
      -  </ul>
      +    <ul class="level-2">
      +      <li class="item-a">A</li>
      +      <li class="item-b">B
      +        <ul class="level-3">
      +          <li class="item-1">1</li>
      +          <li class="item-2">2</li>
      +          <li class="item-3">3</li>
      +        </ul>
      +      </li>
      +      <li class="item-c">C</li>
      +    </ul>
         </li>
         <li class="item-iii">III</li>
       </ul>
      
      From 0426c7655e8fa526e4db2fab677623cc0afd5336 Mon Sep 17 00:00:00 2001
      From: Tomasz Ratajczak 
      Date: Sun, 16 Mar 2014 14:31:22 -0400
      Subject: [PATCH 323/998] Fix Event Object url. Closes #402
      
      ---
       entries/on.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/on.xml b/entries/on.xml
      index 3bd2dff0..a322724e 100644
      --- a/entries/on.xml
      +++ b/entries/on.xml
      @@ -62,7 +62,7 @@ function notify() {
       }
       $( "button" ).on( "click", notify );
           
      -

      When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

      +

      When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

      By default, most events bubble up from the original event target to the document element. At each element along the way, jQuery calls any matching event handlers that have been attached. A handler can prevent the event from bubbling further up the document tree (and thus prevent handlers on those elements from running) by calling event.stopPropagation(). Any other handlers attached on the current element will run however. To prevent that, call event.stopImmediatePropagation(). (Event handlers bound to an element are called in the same order that they were bound.)

      Similarly, a handler can call event.preventDefault() to cancel any default action that the browser may have for this event; for example, the default action on a click event is to follow the link. Not all browser events have default actions, and not all default actions can be canceled. See the W3C Events Specification for details.

      Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $( "a.disabled" ).on( "click", false ); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

      From 08bdef496ff292a6daec6f58c9b51c646e950968 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Sun, 16 Mar 2014 14:42:43 -0400 Subject: [PATCH 324/998] .width() and .height(): synhronize documentation * Include the style/script warning * Follow the style guide for comments * Ref jQuery #14545 * Closes #403 --- entries/height.xml | 7 +++++-- entries/width.xml | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/entries/height.xml b/entries/height.xml index dd809c0f..4d315e46 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -14,8 +14,11 @@

      This method is also able to find the height of the window and document.

      
      -$( window ).height(); // returns height of browser viewport
      -$( document ).height(); // returns height of HTML document
      +// Returns height of browser viewport
      +$( window ).height();
      +
      +// Returns height of HTML document
      +$( document ).height();
             

      Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS height plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "height" ) rather than .height().

      diff --git a/entries/width.xml b/entries/width.xml index c8a11a28..27ac3a0d 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -21,6 +21,9 @@ $( window ).width(); $( document ).width();

      Note that .width() will always return the content width, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS width plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "width" ) rather than .width().

      +
      +

      Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

      +
      From a05af326c486e575ca90a6d43773e858ca03654c Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 16 Mar 2014 14:49:55 -0400 Subject: [PATCH 325/998] .filter: Update signature. An array of elements works as well. Closes #396 --- entries/filter.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/filter.xml b/entries/filter.xml index 9d8f53cc..9aa08474 100644 --- a/entries/filter.xml +++ b/entries/filter.xml @@ -15,8 +15,8 @@ 1.4 - - An element to match the current set of elements against. + + One or more DOM elements to match the current set of elements against. From 7c6cd12222932d7ebfb5240c1743a61041065343 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 16 Mar 2014 14:51:52 -0400 Subject: [PATCH 326/998] .removeData(): Fix a small typo. Closes #400 --- entries/removeData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/removeData.xml b/entries/removeData.xml index 7286016d..2c346cba 100644 --- a/entries/removeData.xml +++ b/entries/removeData.xml @@ -17,7 +17,7 @@ Remove a previously-stored piece of data. -

      The .removeData() method allows us to remove values that were previously set using .data(). When called with the name of a key, .removeData() deletes that particular value; when called with no arguments, all values are removed. Removing data from jQuery's internal .data() cache does not effect any HTML5 data- attributes in a document; use .removeAttr() to remove those.

      +

      The .removeData() method allows us to remove values that were previously set using .data(). When called with the name of a key, .removeData() deletes that particular value; when called with no arguments, all values are removed. Removing data from jQuery's internal .data() cache does not affect any HTML5 data- attributes in a document; use .removeAttr() to remove those.

      When using .removeData("name"), jQuery will attempt to locate a data- attribute on the element if no property by that name is in the internal data cache. To avoid a re-query of the data- attribute, set the name to a value of either null or undefined (e.g. .data("name", undefined)) rather than using .removeData().

      As of jQuery 1.7, when called with an array of keys or a string of space-separated keys, .removeData() deletes the value of each key in that array or string.

      As of jQuery 1.4.3, calling .removeData() will cause the value of the property being removed to revert to the value of the data attribute of the same name in the DOM, rather than being set to undefined.

      From d0ce77df70bfcdd2784f0f459b9fabd02f88b761 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 16 Mar 2014 14:56:15 -0400 Subject: [PATCH 327/998] .nextUntil(): Make explicit that element can be a jQuery object. Closes #404 --- entries/nextUntil.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entries/nextUntil.xml b/entries/nextUntil.xml index 3f0f3f0c..619b95a2 100644 --- a/entries/nextUntil.xml +++ b/entries/nextUntil.xml @@ -12,8 +12,10 @@ 1.6 - + A DOM node or jQuery object indicating where to stop matching following sibling elements. + + A string containing a selector expression to match elements against. From 5b6edccaaafb8526fb86575977316f81f6d3431d Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 16 Mar 2014 15:10:41 -0400 Subject: [PATCH 328/998] .prevUntil(), .parentsUntil(): Make explicit that Element can be a jQuery object. --- entries/parentsUntil.xml | 4 +++- entries/prevUntil.xml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/entries/parentsUntil.xml b/entries/parentsUntil.xml index b2aa8eb7..93e5e1fa 100644 --- a/entries/parentsUntil.xml +++ b/entries/parentsUntil.xml @@ -12,7 +12,9 @@ 1.6 - + + + A DOM node or jQuery object indicating where to stop matching ancestor elements. diff --git a/entries/prevUntil.xml b/entries/prevUntil.xml index 14c468ca..5e6effb0 100644 --- a/entries/prevUntil.xml +++ b/entries/prevUntil.xml @@ -12,7 +12,9 @@ 1.6 - + + + A DOM node or jQuery object indicating where to stop matching preceding sibling elements. From 0b9391316b0511206aeea1b49879111ffd674027 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 16 Mar 2014 15:14:36 -0400 Subject: [PATCH 329/998] .triggerHandler(): Use "triggered" (not "created"). Closes #428 --- entries/triggerHandler.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index a470e31f..df6fb8af 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -16,7 +16,7 @@
      • The .triggerHandler() method does not cause the default behavior of an event to occur (such as a form submission).
      • While .trigger() will operate on all elements matched by the jQuery object, .triggerHandler() only affects the first matched element.
      • -
      • Events created with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.
      • +
      • Events triggered with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.
      • Instead of returning the jQuery object (to allow chaining), .triggerHandler() returns whatever value was returned by the last handler it caused to be executed. If no handlers are triggered, it returns undefined

      For more information on this method, see the discussion for .trigger().

      From b83bd13f827f1e1a65f2a32930be71ebeca639cc Mon Sep 17 00:00:00 2001 From: Bill Edgington Date: Sun, 16 Mar 2014 15:18:12 -0400 Subject: [PATCH 330/998] .clone(): Specify which form controls maintain state when cloned. Fixes #381. Closes #382 --- entries/clone.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entries/clone.xml b/entries/clone.xml index 8dcd4fb2..91d7bc29 100644 --- a/entries/clone.xml +++ b/entries/clone.xml @@ -18,7 +18,10 @@
      Create a deep copy of the set of matched elements. -

      The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. For performance reasons, the dynamic state of form elements (e.g., user data typed into input, and textarea or user selections made to a select) is not copied to the cloned elements. The clone operation sets these fields to their default values as specified in the HTML.

      +

      The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes.

      +
      +

      Note: For performance reasons, the dynamic state of certain form elements (e.g., user data typed into textarea and user selections made to a select) is not copied to the cloned elements. When cloning input elements, the dynamic state of the element (e.g., user data typed into text inputs and user selections made to a checkbox) is retained in the cloned elements.

      +

      When used in conjunction with one of the insertion methods, .clone() is a convenient way to duplicate elements on a page. Consider the following HTML:

      
       <div class="container">
      
      From bcb87bf842e734ab631c46bf30ab322ab8ff4348 Mon Sep 17 00:00:00 2001
      From: Richard Gibson 
      Date: Sun, 16 Mar 2014 15:23:17 -0400
      Subject: [PATCH 331/998] .val(): Be more clear about when null is returned
      
      Ref jQuery #14654
      Closes #406
      ---
       entries/val.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/val.xml b/entries/val.xml
      index 3d1b96bf..9285a546 100644
      --- a/entries/val.xml
      +++ b/entries/val.xml
      @@ -11,7 +11,7 @@
           
           Get the current value of the first element in the set of matched elements.
           
      -      

      The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of <select multiple="multiple"> elements, the .val() method returns an array containing each selected option; if no option is selected, it returns null.

      +

      The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present.

      For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

      
       // Get the value from a dropdown select
      
      From 58be0ddb785f435d9310143ad70e25b9d0cc0c57 Mon Sep 17 00:00:00 2001
      From: John Reilly 
      Date: Tue, 18 Mar 2014 13:52:32 -0400
      Subject: [PATCH 332/998] .text(): Include Number and Boolean types for
       argument. Closes #460
      
      ---
       entries/text.xml | 7 +++++--
       1 file changed, 5 insertions(+), 2 deletions(-)
      
      diff --git a/entries/text.xml b/entries/text.xml
      index af7880ea..8ba40495 100644
      --- a/entries/text.xml
      +++ b/entries/text.xml
      @@ -52,8 +52,11 @@ $( "p:last" ).html( str );
         
           
             1.0
      -      
      -        A string of text to set as the content of each matched element.
      +      
      +        
      +        
      +        
      +        The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
             
           
           
      
      From fb3f5f8ceb98f73c6a35326c71fb33af429d5533 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Tue, 18 Mar 2014 15:39:25 -0400
      Subject: [PATCH 333/998] 1.11.5
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index 907a22e2..b2200764 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": "1.11.4",
      +  "version": "1.11.5",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (https://jquery.org/)"
      
      From cd7773862216f4a0be105688fe95058d6ef611ed Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Sun, 23 Mar 2014 12:26:14 +0100
      Subject: [PATCH 334/998] Update jQuery.xml
      
      Fixed a small typo
      ---
       entries/jQuery.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/jQuery.xml b/entries/jQuery.xml
      index 014a5fcf..089834f1 100644
      --- a/entries/jQuery.xml
      +++ b/entries/jQuery.xml
      @@ -248,7 +248,7 @@ $( "
      ", { Binds a function to be executed when the DOM has finished loading. -

      This function behaves just like $( document ).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready. While this function is, technically, chainable, there really isn"t much use for chaining against it.

      +

      This function behaves just like $( document ).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready. While this function is, technically, chainable, there really isn't much use for chaining against it.

      Execute the function when the DOM is ready to be used. From 3043a60aaab2755dc1d7b05ba506b7200bc3f1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 14 Apr 2014 11:31:45 -0400 Subject: [PATCH 335/998] Build: Normalize line endings --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..b7ca95b5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# JS files must always use LF for tools to work +*.js eol=lf From 59bcdbd045db6d5fa7c73970e155403b6ffb10df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Apr 2014 09:26:11 -0400 Subject: [PATCH 336/998] load: Don't rely on site content for demo Fixes gh-475 --- entries/load.xml | 8 ++++---- resources/load.html | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 resources/load.html diff --git a/entries/load.xml b/entries/load.xml index 7389800c..f5aea57c 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -56,9 +56,9 @@ $( "#b" ).load( "article.html #target" ); - Load the main page's footer navigation into an ordered list. + Load another page's list items into an ordered list. diff --git a/resources/load.html b/resources/load.html new file mode 100644 index 00000000..659f6044 --- /dev/null +++ b/resources/load.html @@ -0,0 +1,20 @@ + + + + + Sample Page + + + +

      Popular jQuery Projects

      + +
        +
      • jQuery
      • +
      • jQuery UI
      • +
      • jQuery Mobile
      • +
      • QUnit
      • +
      • Sizzle
      • +
      + + + \ No newline at end of file From 102e6130831fde253914a519c9d63894a76f3241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 16 Apr 2014 09:29:39 -0400 Subject: [PATCH 337/998] 1.11.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b2200764..b603cf5d 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": "1.11.5", + "version": "1.11.6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 18706517dc86f07368f5971f252768ad449def33 Mon Sep 17 00:00:00 2001 From: Manuel Strehl Date: Thu, 24 Apr 2014 14:08:53 -0400 Subject: [PATCH 338/998] .get(): Fix description for negative indexes. Closes #481 --- entries/get.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/get.xml b/entries/get.xml index 5698760d..64272cf4 100644 --- a/entries/get.xml +++ b/entries/get.xml @@ -11,7 +11,7 @@ Retrieve one of the elements matched by the jQuery object. -

      The .get() method grants access to the DOM nodes underlying each jQuery object. If the value of index is out of bounds — less than 0 or equal to or greater than the number of elements — it returns undefined. Consider a simple unordered list:

      +

      The .get() method grants access to the DOM nodes underlying each jQuery object. If the value of index is out of bounds — less than the negative number of elements or equal to or greater than the number of elements — it returns undefined. Consider a simple unordered list:

      
       <ul>
         <li id="foo">foo</li>
      
      From fdce4a1a0e27573ceb38d1808c271ce0b51fd825 Mon Sep 17 00:00:00 2001
      From: Mark Amery 
      Date: Wed, 30 Apr 2014 14:46:17 -0400
      Subject: [PATCH 339/998] jQuery.ajax: rewrite Data Types section. Fixes #482
      
      ---
       entries/jQuery.ajax.xml | 17 ++++++++---------
       1 file changed, 8 insertions(+), 9 deletions(-)
      
      diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
      index fa35ac58..3b70d572 100644
      --- a/entries/jQuery.ajax.xml
      +++ b/entries/jQuery.ajax.xml
      @@ -281,15 +281,14 @@ jqxhr.always(function() {
           
       
           

      Data Types

      -

      The $.ajax() function relies on the server to provide information about the retrieved data. If the server reports the return data as XML, the result can be traversed using normal XML methods or jQuery's selectors. If another type is detected, such as HTML in the example above, the data is treated as text.

      -

      Different data handling can be achieved by using the dataType option. Besides plain xml, the dataType can be html, json, jsonp, script, or text.

      -

      The text and xml types return the data with no processing. The data is simply passed on to the success handler, either through the responseText or responseXML property of the jqXHR object, respectively.

      -

      Note: We must ensure that the MIME type reported by the web server matches our choice of dataType. In particular, XML must be declared by the server as text/xml or application/xml for consistent results.

      -

      If html is specified, any embedded JavaScript inside the retrieved data is executed before the HTML is returned as a string. Similarly, script will execute the JavaScript that is pulled back from the server, then return nothing.

      -

      The json type parses the fetched data file as a JavaScript object and returns the constructed object as the result data. To do so, it uses jQuery.parseJSON() when the browser supports it; otherwise it uses a Function constructor. Malformed JSON data will throw a parse error (see json.org for more information). JSON data is convenient for communicating structured data in a way that is concise and easy for JavaScript to parse. If the fetched data file exists on a remote server, specify the jsonp type instead.

      -

      The jsonp type appends a query string parameter of callback=? to the URL. The server should prepend the JSON data with the callback name to form a valid JSONP response. We can specify a parameter name other than callback with the jsonp option to $.ajax().

      -

      Note: JSONP is an extension of the JSON format, requiring some server-side code to detect and handle the query string parameter. More information about it can be found in the original post detailing its use.

      -

      When data is retrieved from remote servers (which is only possible using the script or jsonp data types), the error callbacks and global events will never be fired.

      +

      Different types of response to $.ajax() call are subjected to different kinds of pre-processing before being passed to the success handler. The type of pre-processing depends by default upon the Content-Type of the response, but can be set explicitly using the dataType option. If the dataType option is provided, the Content-Type header of the response will be disregarded.

      +

      The available data types are text, html, xml, json, jsonp, and script.

      +

      If text or html is specified, no pre-processing occurs. The data is simply passed on to the success handler, and made available through the responseText property of the jqXHR object.

      +

      If xml is specified, the response is parsed using jQuery.parseXML before being passed, as an XMLDocument, to the success handler. The XML document is made available through the responseXML property of the jqXHR object.

      +

      If json is specified, the response is parsed using jQuery.parseJSON before being passed, as an object, to the success handler. The parsed JSON object is made available through the responseJSON property of the jqXHR object.

      +

      If script is specified, $.ajax() will execute the JavaScript that is received from the server before passing it on to the success handler as a string.

      +

      If jsonp is specified, $.ajax() will automatically append a query string parameter of (by default) callback=? to the URL. The jsonp and jsonpCallback properties of the settings passed to $.ajax() can be used to specify, respectively, the name of the query string parameter and the name of the JSONP callback function. The server should return valid JavaScript that passes the JSON response into the callback function. $.ajax() will execute the returned JavaScript, calling the JSONP callback function, before passing the JSON object contained in the response to the $.ajax() success handler.

      +

      For more information on JSONP, see the original post detailing its use.

      Sending Data to the Server

      By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.

      The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

      From a92dd1ba0b0ff1f080b769f015311a4084f697f4 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 30 Apr 2014 14:55:06 -0400 Subject: [PATCH 340/998] 1.11.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b603cf5d..d1719340 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": "1.11.6", + "version": "1.11.7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From c137cb36bf96146a6045ffc7a789a2c70a82763a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 5 May 2014 14:07:33 -0400 Subject: [PATCH 341/998] jQuery.getScript: raw.github.com -> raw.githubusercontent.com --- 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 bc86be4b..d519358f 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -91,7 +91,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. Parse a JSON string. +alert( obj.name === "John" ); +]]> From 1b7e2e704b97c5e1415679a8ec4edb2736c228e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 12 May 2014 12:03:06 -0400 Subject: [PATCH 343/998] 1.11.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1719340..0079431e 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": "1.11.7", + "version": "1.11.8", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From e708998f137f531418e18c46117ca62289666b2b Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Wed, 14 May 2014 09:54:06 -0400 Subject: [PATCH 344/998] jQuery.boxModel: removed since 1.8 Closes gh451 --- entries/jQuery.boxModel.xml | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml index 18411216..f260538a 100644 --- a/entries/jQuery.boxModel.xml +++ b/entries/jQuery.boxModel.xml @@ -1,40 +1,13 @@ - + jQuery.boxModel 1.0 - Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. + States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. This property was removed in jQuery 1.8. Please try to use feature detection instead. - - Returns the box model for the iframe. - - - - - - Returns false if the page is in Quirks Mode in Internet Explorer - - - + From 1c2c0f68582bffdafa60cb2ea7ab6680bc986f82 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 14 May 2014 09:57:12 -0400 Subject: [PATCH 345/998] 1.11.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0079431e..47d187f9 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": "1.11.8", + "version": "1.11.9", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 9206d3f53f663d2a973712cdb103169071ed16f2 Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Wed, 14 May 2014 16:34:04 +0200 Subject: [PATCH 346/998] jQuery.type: Argument can be anything Closes gh-494 --- entries/jQuery.type.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml index 690bee10..f77b3139 100644 --- a/entries/jQuery.type.xml +++ b/entries/jQuery.type.xml @@ -3,7 +3,7 @@ jQuery.type() 1.4.3 - + Object to get the internal JavaScript [[Class]] of. From a93a1cc7203d16b6ee01de07c88bb83c9486b54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 15 May 2014 19:03:55 -0400 Subject: [PATCH 347/998] Build: Use vagrant for sample config --- config-sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-sample.json b/config-sample.json index 85f8556b..b26cf9fc 100644 --- a/config-sample.json +++ b/config-sample.json @@ -1,5 +1,5 @@ { - "url": "local.api.jquery.com", + "url": "vagrant.api.jquery.com", "username": "admin", "password": "secret" } From 11c93b9d0639be79bd72020652af92e6c226603e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20Junker=20Kj=C3=A6r?= Date: Sat, 18 Jan 2014 12:44:11 +0100 Subject: [PATCH 348/998] All: Added structured types for higer order function parameters Some function parameters of function type (e.g. handlers, callbacks) was described with the signature in the name-attribute, eg. . This have been modified to used nested -elements to describe the signatures more consistently. Changed some argument type from XMLHttpRequest to jsXHR Some callback functions was indicated to receive XMLHttpRequest rather than jsXHR. Fixed spelling and changed 'ajaxOptions' to 'PlainObject' The ajaxOptions/ajaxSettings options object is not documented as a seperate type, so now changed to PlainObject. Changed misspelling of jsXHR to jqXHR. Changed nargument names to valid identifers to avoid confusion Argument names with whitespace like "jQuery object" are confusing, because it might easily be mistaken for two arguments when reading the signature. Argument names like "-index" are also confusing since they look like an expression rather than a name. I have renamed the argument names to be valid javascript identifiers, just like actual argument names have to be. Also changed argument type "Object" and "PlainObject" to "JQuery" where the prose documentation indicates that the type is a jQuery object. Changed argument name 'jQueryObject' to 'selection' As per discussion on #jquery-content. Also changed type from 'Object' to 'jQuery' where prose indicates a jQuery object. Closes gh-419 --- entries/add.xml | 2 +- entries/addClass.xml | 5 ++++- entries/after.xml | 9 ++++++++- entries/ajaxComplete.xml | 5 ++++- entries/ajaxError.xml | 6 +++++- entries/ajaxSend.xml | 5 ++++- entries/ajaxStart.xml | 2 +- entries/ajaxStop.xml | 2 +- entries/ajaxSuccess.xml | 6 +++++- entries/append.xml | 9 ++++++++- entries/attr.xml | 8 +++++++- entries/before.xml | 7 +++++++ entries/bind.xml | 3 ++- entries/blur.xml | 6 ++++-- entries/change.xml | 6 ++++-- entries/click.xml | 6 ++++-- entries/closest.xml | 2 +- entries/css.xml | 8 +++++++- entries/dblclick.xml | 6 ++++-- entries/delegate.xml | 6 ++++-- entries/each.xml | 4 +++- entries/eq-selector.xml | 2 +- entries/eq.xml | 2 +- entries/error.xml | 6 ++++-- entries/filter.xml | 7 +++++-- entries/find.xml | 2 +- entries/focus.xml | 6 ++++-- entries/focusin.xml | 6 ++++-- entries/focusout.xml | 6 ++++-- entries/gt-selector.xml | 2 +- entries/height.xml | 8 +++++++- entries/hover.xml | 15 +++++++++------ entries/html.xml | 5 ++++- entries/is.xml | 9 ++++++--- entries/jQuery.ajaxPrefilter.xml | 5 ++++- entries/jQuery.ajaxTransport.xml | 5 ++++- entries/jQuery.each.xml | 19 ++++++++++++++++--- entries/jQuery.get.xml | 5 ++++- entries/jQuery.getJSON.xml | 5 ++++- entries/jQuery.getScript.xml | 5 ++++- entries/jQuery.grep.xml | 5 ++++- entries/jQuery.map.xml | 20 ++++++++++++-------- entries/jQuery.post.xml | 5 ++++- entries/jQuery.queue.xml | 2 +- entries/jQuery.xml | 2 +- entries/keydown.xml | 6 ++++-- entries/keypress.xml | 6 ++++-- entries/keyup.xml | 6 ++++-- entries/live.xml | 6 ++++-- entries/load-event.xml | 6 ++++-- entries/load.xml | 5 ++++- entries/lt-selector.xml | 2 +- entries/map.xml | 5 ++++- entries/mousedown.xml | 6 ++++-- entries/mouseenter.xml | 6 ++++-- entries/mouseleave.xml | 6 ++++-- entries/mousemove.xml | 6 ++++-- entries/mouseout.xml | 6 ++++-- entries/mouseover.xml | 6 ++++-- entries/mouseup.xml | 6 ++++-- entries/not.xml | 7 +++++-- entries/off.xml | 3 ++- entries/offset.xml | 5 ++++- entries/on.xml | 3 ++- entries/one.xml | 6 ++++-- entries/prepend.xml | 9 ++++++++- entries/prop.xml | 14 +++++++++++++- entries/queue.xml | 3 ++- entries/removeClass.xml | 5 ++++- entries/resize.xml | 6 ++++-- entries/scroll.xml | 6 ++++-- entries/select.xml | 6 ++++-- entries/submit.xml | 6 ++++-- entries/text.xml | 5 ++++- entries/toggle-event.xml | 9 ++++++--- entries/toggleClass.xml | 6 +++++- entries/unbind.xml | 3 ++- entries/undelegate.xml | 3 ++- entries/unload.xml | 6 ++++-- entries/val.xml | 5 ++++- entries/width.xml | 8 +++++++- entries/wrap.xml | 7 ++++++- entries/wrapInner.xml | 4 +++- 83 files changed, 357 insertions(+), 129 deletions(-) diff --git a/entries/add.xml b/entries/add.xml index e93025df..1bd30426 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -21,7 +21,7 @@ 1.3.2 - + An existing jQuery object to add to the set of matched elements. diff --git a/entries/addClass.xml b/entries/addClass.xml index 7d299dba..238d03e5 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -9,8 +9,11 @@ 1.4 - + A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + + + Adds the specified class(es) to each of the set of matched elements. diff --git a/entries/after.xml b/entries/after.xml index 2c8869c9..8e57cdac 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -20,8 +20,15 @@ 1.4 - + A function that returns an HTML string, DOM element(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 as an argument. Within the function, this refers to the current element in the set. + + + + + + + Insert content, specified by the parameter, after each element in the set of matched elements. diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 3b3fc93e..3ff3b58c 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -3,7 +3,10 @@ .ajaxComplete() 1.0 - + + + + The function to be invoked. diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index 4029c7be..fbee691d 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -3,8 +3,12 @@ .ajaxError() 1.0 - + The function to be invoked. + + + + Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index dd2dc44b..2d609b71 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -3,8 +3,11 @@ .ajaxSend() 1.0 - + The function to be invoked. + + + Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index 854ad019..7747e5b6 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -3,7 +3,7 @@ .ajaxStart() 1.0 - + The function to be invoked. diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 63e14639..76b3bffc 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -4,7 +4,7 @@ Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 1.0 - + The function to be invoked. diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 968350d8..26583e2e 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -3,8 +3,12 @@ .ajaxSuccess() 1.0 - + The function to be invoked. + + + + Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. diff --git a/entries/append.xml b/entries/append.xml index 5903fa05..c1de1420 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -20,8 +20,15 @@ 1.4 - + A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of 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. + + + + + + + Insert content, specified by the parameter, to the end of each element in the set of matched elements. diff --git a/entries/attr.xml b/entries/attr.xml index 5e9dd89c..3e181e67 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -164,8 +164,14 @@ The title of the emphasis is:
      The name of the attribute to set. - + A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + + + + + + Set one or more attributes for the set of matched elements. diff --git a/entries/before.xml b/entries/before.xml index 4aeae8d6..7c2ebb7b 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -21,6 +21,13 @@ 1.4 + + + + + + + A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. diff --git a/entries/bind.xml b/entries/bind.xml index 3b00923b..be20d77c 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -9,8 +9,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/blur.xml b/entries/blur.xml index 3029a6fc..ddb9bf99 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -4,8 +4,9 @@ Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/change.xml b/entries/change.xml index d5f4f4f1..eedea432 100644 --- a/entries/change.xml +++ b/entries/change.xml @@ -4,8 +4,9 @@ Bind an event handler to the "change" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/click.xml b/entries/click.xml index 4715cac3..c6a014c1 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -4,8 +4,9 @@ Bind an event handler to the "click" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/closest.xml b/entries/closest.xml index 9a01fb1e..5f1bb2b4 100644 --- a/entries/closest.xml +++ b/entries/closest.xml @@ -19,7 +19,7 @@ 1.6 - + A jQuery object to match elements against. diff --git a/entries/css.xml b/entries/css.xml index 6a5391cc..178fc326 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -123,8 +123,14 @@ $( "div" ).click(function() { A CSS property name. - + A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + + + + + + diff --git a/entries/dblclick.xml b/entries/dblclick.xml index c08c2915..ec851198 100644 --- a/entries/dblclick.xml +++ b/entries/dblclick.xml @@ -4,8 +4,9 @@ Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/delegate.xml b/entries/delegate.xml index 09d6d7b5..dd57ffee 100644 --- a/entries/delegate.xml +++ b/entries/delegate.xml @@ -10,8 +10,9 @@ A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names. - + A function to execute at the time the event is triggered. + @@ -25,8 +26,9 @@ An object containing data that will be passed to the event handler. - + A function to execute at the time the event is triggered. + diff --git a/entries/each.xml b/entries/each.xml index ea75814e..9a882fb2 100644 --- a/entries/each.xml +++ b/entries/each.xml @@ -3,8 +3,10 @@ .each() 1.0 - + A function to execute for each matched element. + + Iterate over a jQuery object, executing a function for each matched element. diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml index aad654c0..1e48407b 100644 --- a/entries/eq-selector.xml +++ b/entries/eq-selector.xml @@ -11,7 +11,7 @@ :eq(-index) 1.8 - + Zero-based index of the element to match, counting backwards from the last element. diff --git a/entries/eq.xml b/entries/eq.xml index af0b7a72..ddb06c74 100644 --- a/entries/eq.xml +++ b/entries/eq.xml @@ -9,7 +9,7 @@ 1.4 - + An integer indicating the position of the element, counting backwards from the last element in the set. diff --git a/entries/error.xml b/entries/error.xml index e5c0c07d..f93ba9fd 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -4,8 +4,9 @@ Bind an event handler to the "error" JavaScript event. 1.0 - + A function to execute when the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/filter.xml b/entries/filter.xml index 9aa08474..440b4277 100644 --- a/entries/filter.xml +++ b/entries/filter.xml @@ -9,8 +9,11 @@ 1.0 - + A function used as a test for each element in the set. this is the current DOM element. + + + @@ -21,7 +24,7 @@ 1.4 - + An existing jQuery object to match the current set of elements against. diff --git a/entries/find.xml b/entries/find.xml index 9db417af..16c1d799 100644 --- a/entries/find.xml +++ b/entries/find.xml @@ -9,7 +9,7 @@ 1.6 - + A jQuery object to match elements against. diff --git a/entries/focus.xml b/entries/focus.xml index b8398786..0651faab 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -4,8 +4,9 @@ Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/focusin.xml b/entries/focusin.xml index e441a4e4..a692e3bb 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -4,8 +4,9 @@ Bind an event handler to the "focusin" event. 1.4 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/focusout.xml b/entries/focusout.xml index 5528f56a..2d110637 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -4,8 +4,9 @@ Bind an event handler to the "focusout" JavaScript event. 1.4 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/gt-selector.xml b/entries/gt-selector.xml index b4a44f50..303723a9 100644 --- a/entries/gt-selector.xml +++ b/entries/gt-selector.xml @@ -11,7 +11,7 @@ :gt(-index) 1.8 - + Zero-based index, counting backwards from the last element. diff --git a/entries/height.xml b/entries/height.xml index 4d315e46..8808ac6c 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -87,7 +87,13 @@ $( "#getw" ).click(function() { 1.4.1 - + + + + + + + A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. diff --git a/entries/hover.xml b/entries/hover.xml index fcfdd377..3eb38753 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -6,11 +6,13 @@ Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. 1.0 - - A function to execute when the mouse pointer enters the element. + + + A function to execute when the mouse pointer enters the element. - - A function to execute when the mouse pointer leaves the element. + + + A function to execute when the mouse pointer leaves the element. @@ -83,8 +85,9 @@ $( "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 - - A function to execute when the mouse pointer enters or leaves the element. + + + A function to execute when the mouse pointer enters or leaves the element. diff --git a/entries/html.xml b/entries/html.xml index c4160f72..0e9f9dcc 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -74,7 +74,10 @@ $( "p" ).click(function() { 1.4 - + + + + A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; diff --git a/entries/is.xml b/entries/is.xml index 20ebd45d..2a14f6a3 100644 --- a/entries/is.xml +++ b/entries/is.xml @@ -9,13 +9,16 @@ 1.6 - - A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + + A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection. Within the function, this refers to the current DOM element. + + + 1.6 - + An existing jQuery object to match the current set of elements against. diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml index 405811bc..eb762dfb 100644 --- a/entries/jQuery.ajaxPrefilter.xml +++ b/entries/jQuery.ajaxPrefilter.xml @@ -7,8 +7,11 @@ An optional string containing one or more space-separated dataTypes - + A handler to set default values for future Ajax requests. + + + diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml index d44730d3..ccf5151e 100644 --- a/entries/jQuery.ajaxTransport.xml +++ b/entries/jQuery.ajaxTransport.xml @@ -7,8 +7,11 @@ A string identifying the data type to use - + A handler to return the new transport object to use with the data type provided in the first argument. + + + diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index 55cd16f9..f8ab8a64 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -3,10 +3,23 @@ jQuery.each() 1.0 - - The object or array to iterate over. + + The array to iterate over. - + + + + The function that will be executed on every object. + + + + 1.0 + + The object to iterate over. + + + + The function that will be executed on every object. diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index af75af2c..396e58b0 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -11,7 +11,10 @@ A plain object or string that is sent to the server with the request. - + + + + A callback function that is executed if the request succeeds. diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 92adffa6..1485a2a2 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -9,7 +9,10 @@ A plain object or string that is sent to the server with the request. - + + + + A callback function that is executed if the request succeeds. diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index d519358f..488b4525 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -6,7 +6,10 @@ A string containing the URL to which the request is sent. - + + + + A callback function that is executed if the request succeeds. diff --git a/entries/jQuery.grep.xml b/entries/jQuery.grep.xml index 3aa99aae..245a672d 100644 --- a/entries/jQuery.grep.xml +++ b/entries/jQuery.grep.xml @@ -7,7 +7,10 @@ The array to search through. - + + + + The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 8bb6a279..3c499e6c 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -6,19 +6,23 @@ The Array to translate. - - The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + + + + + The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. 1.6 - - - - The Array or Object to translate. + + The Object to translate. - - The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + + + + + The function to process each item against. The first argument to the function is the value; the second argument is the key of the object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. Translate all items in an array or object to new array of items. diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index e32e7e00..c066cbf4 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -11,7 +11,10 @@ A plain object or string that is sent to the server with the request. - + + + + A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. diff --git a/entries/jQuery.queue.xml b/entries/jQuery.queue.xml index 8b620b8f..3921e020 100644 --- a/entries/jQuery.queue.xml +++ b/entries/jQuery.queue.xml @@ -91,7 +91,7 @@ runIt(); A string containing the name of the queue. Defaults to fx, the standard effects queue. - + The new function to add to the queue. diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 014a5fcf..ea052d35 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -34,7 +34,7 @@ 1.0 - + An existing jQuery object to clone. diff --git a/entries/keydown.xml b/entries/keydown.xml index b72e0ad7..893be2a7 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -3,8 +3,9 @@ .keydown() 1.0 - + A function to execute each time the event is triggered. + @@ -12,8 +13,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/keypress.xml b/entries/keypress.xml index b6421b20..0724c1bf 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -4,8 +4,9 @@ Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/keyup.xml b/entries/keyup.xml index f65c6a03..517d94b9 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -4,8 +4,9 @@ Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/live.xml b/entries/live.xml index 4ed78cc8..95f9d5d8 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -7,8 +7,9 @@ A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names. - + A function to execute at the time the event is triggered. + @@ -19,8 +20,9 @@ An object containing data that will be passed to the event handler. - + A function to execute at the time the event is triggered. + diff --git a/entries/load-event.xml b/entries/load-event.xml index 30e7662a..b8e48626 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -4,8 +4,9 @@ Bind an event handler to the "load" JavaScript event. 1.0 - + A function to execute when the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/load.xml b/entries/load.xml index f5aea57c..951c43f6 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -11,7 +11,10 @@ A plain object or string that is sent to the server with the request. - + + + + A callback function that is executed when the request completes. diff --git a/entries/lt-selector.xml b/entries/lt-selector.xml index d301f11d..b85b5f77 100644 --- a/entries/lt-selector.xml +++ b/entries/lt-selector.xml @@ -11,7 +11,7 @@ :lt(-index) 1.8 - + Zero-based index, counting backwards from the last element. diff --git a/entries/map.xml b/entries/map.xml index 6fbe68d7..55a87d83 100644 --- a/entries/map.xml +++ b/entries/map.xml @@ -3,7 +3,10 @@ .map() 1.2 - + + + + A function object that will be invoked for each element in the current set. diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 5f663575..51186203 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -4,8 +4,9 @@ Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml index c90a8a03..72acea07 100644 --- a/entries/mouseenter.xml +++ b/entries/mouseenter.xml @@ -4,8 +4,9 @@ Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml index e7fd4c49..af7f8589 100644 --- a/entries/mouseleave.xml +++ b/entries/mouseleave.xml @@ -4,8 +4,9 @@ Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mousemove.xml b/entries/mousemove.xml index a0e1a46a..56943fd4 100644 --- a/entries/mousemove.xml +++ b/entries/mousemove.xml @@ -4,8 +4,9 @@ Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mouseout.xml b/entries/mouseout.xml index a84b825f..844d886f 100644 --- a/entries/mouseout.xml +++ b/entries/mouseout.xml @@ -4,8 +4,9 @@ Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mouseover.xml b/entries/mouseover.xml index 016ad3d5..1ddfd9e5 100644 --- a/entries/mouseover.xml +++ b/entries/mouseover.xml @@ -4,8 +4,9 @@ Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/mouseup.xml b/entries/mouseup.xml index 018ea304..6006ea69 100644 --- a/entries/mouseup.xml +++ b/entries/mouseup.xml @@ -4,8 +4,9 @@ Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/not.xml b/entries/not.xml index def00389..dec089f6 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -15,13 +15,16 @@ 1.4 - + A function used as a test for each element in the set. this is the current DOM element. + + + 1.4 - + An existing jQuery object to match the current set of elements against. diff --git a/entries/off.xml b/entries/off.xml index 78ab983b..b83e3868 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -10,8 +10,9 @@ A selector which should match the one originally passed to .on() when attaching event handlers. - + A handler function previously attached for the event(s), or the special value false. + diff --git a/entries/offset.xml b/entries/offset.xml index 2b10ef34..9b1a0093 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -87,7 +87,10 @@ $( "*", document.body ).click(function( event ) { 1.4 - + + + + A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. diff --git a/entries/on.xml b/entries/on.xml index a322724e..a875aa37 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -13,8 +13,9 @@ Data to be passed to the handler in event.data when an event is triggered. - + A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + diff --git a/entries/one.xml b/entries/one.xml index 8f55d4aa..f923fe0a 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -10,8 +10,9 @@ An object containing data that will be passed to the event handler. - + A function to execute at the time the event is triggered. + @@ -25,8 +26,9 @@ Data to be passed to the handler in event.data when an event is triggered. - + A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + diff --git a/entries/prepend.xml b/entries/prepend.xml index ca783d51..e1a2b548 100644 --- a/entries/prepend.xml +++ b/entries/prepend.xml @@ -20,7 +20,14 @@ 1.4 - + + + + + + + + A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of 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/prop.xml b/entries/prop.xml index 541f788f..423e2c11 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -3,6 +3,7 @@ Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element. + .prop() @@ -132,7 +133,18 @@ $( "input" ).change(function() { The name of the property to set. - + + + + + + + + + + + + A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. diff --git a/entries/queue.xml b/entries/queue.xml index b5d512af..08c5f09a 100644 --- a/entries/queue.xml +++ b/entries/queue.xml @@ -80,7 +80,8 @@ showIt(); A string containing the name of the queue. Defaults to fx, the standard effects queue. - + + The new function to add to the queue, with a function to call that will dequeue the next item. diff --git a/entries/removeClass.xml b/entries/removeClass.xml index d172f88e..8bb11196 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -9,7 +9,10 @@ 1.4 - + + + + A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. diff --git a/entries/resize.xml b/entries/resize.xml index f7c9c2dd..280ff015 100644 --- a/entries/resize.xml +++ b/entries/resize.xml @@ -4,8 +4,9 @@ Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/scroll.xml b/entries/scroll.xml index 080ecdc9..1f0e6454 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -4,8 +4,9 @@ Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/select.xml b/entries/select.xml index cb0cc4e8..44e51043 100644 --- a/entries/select.xml +++ b/entries/select.xml @@ -4,8 +4,9 @@ Bind an event handler to the "select" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/submit.xml b/entries/submit.xml index ec3c5025..38ee1f06 100644 --- a/entries/submit.xml +++ b/entries/submit.xml @@ -4,8 +4,9 @@ Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. 1.0 - + A function to execute each time the event is triggered. + @@ -13,8 +14,9 @@ An object containing data that will be passed to the event handler. - + A function to execute each time the event is triggered. + diff --git a/entries/text.xml b/entries/text.xml index 8ba40495..3752dd10 100644 --- a/entries/text.xml +++ b/entries/text.xml @@ -61,7 +61,10 @@ $( "p:last" ).html( str ); 1.4 - + + + + A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. diff --git a/entries/toggle-event.xml b/entries/toggle-event.xml index ed329adb..a095eace 100644 --- a/entries/toggle-event.xml +++ b/entries/toggle-event.xml @@ -4,14 +4,17 @@ Bind two or more handlers to the matched elements, to be executed on alternate clicks. 1.0 - + A function to execute every even time the element is clicked. + - + A function to execute every odd time the element is clicked. + - + Additional handlers to cycle through after clicks. + diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index 9fcb5a94..a4516652 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -24,7 +24,11 @@ 1.4 - + + + + + A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. diff --git a/entries/unbind.xml b/entries/unbind.xml index 19a3d8a0..f7f61514 100644 --- a/entries/unbind.xml +++ b/entries/unbind.xml @@ -7,8 +7,9 @@ A string containing a JavaScript event type, such as click or submit. - + The function that is to be no longer executed. + diff --git a/entries/undelegate.xml b/entries/undelegate.xml index 460410d5..842a504a 100644 --- a/entries/undelegate.xml +++ b/entries/undelegate.xml @@ -22,8 +22,9 @@ A string containing a JavaScript event type, such as "click" or "keydown" - + A function to execute at the time the event is triggered. + diff --git a/entries/unload.xml b/entries/unload.xml index 077ec6fc..9fc62283 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -3,8 +3,9 @@ .unload() 1.0 - + A function to execute when the event is triggered. + @@ -12,8 +13,9 @@ A plain object of data that will be passed to the event handler. - + A function to execute each time the event is triggered. + Bind an event handler to the "unload" JavaScript event. diff --git a/entries/val.xml b/entries/val.xml index 9285a546..27cbc392 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -112,7 +112,10 @@ $( "input" ) 1.4 - + + + + A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. diff --git a/entries/width.xml b/entries/width.xml index 27ac3a0d..bbef2fd0 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -86,7 +86,13 @@ $("#getw").click(function() { 1.4.1 - + + + + + + + A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. diff --git a/entries/wrap.xml b/entries/wrap.xml index 1f8f2f91..02bce46c 100644 --- a/entries/wrap.xml +++ b/entries/wrap.xml @@ -13,8 +13,13 @@ 1.4 - + A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + + + + + Wrap an HTML structure around each element in the set of matched elements. diff --git a/entries/wrapInner.xml b/entries/wrapInner.xml index a3e1ef49..6a459161 100644 --- a/entries/wrapInner.xml +++ b/entries/wrapInner.xml @@ -9,8 +9,10 @@ 1.4 - + A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + + Wrap an HTML structure around the content of each element in the set of matched elements. From edf0730d4a5ac67af00ee2f911e1d5a706bdee6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20Junker=20Kj=C3=A6r?= Date: Sat, 17 May 2014 15:17:38 +0200 Subject: [PATCH 349/998] prop: Change values to Anything type Fixes gh-496 Closes gh-497 --- entries/prop.xml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/entries/prop.xml b/entries/prop.xml index 423e2c11..adccbc85 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -2,9 +2,7 @@ Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element. - - - + .prop() 1.6 @@ -115,10 +113,7 @@ $( "input" ).change(function() { The name of the property to set. - - - - + A value to set for the property. @@ -134,17 +129,9 @@ $( "input" ).change(function() { The name of the property to set. - - - - - - - - - - - + + + A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. From 005432107ba30fb140d7cb8b26f12204ae2daaa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 26 May 2014 11:41:57 -0400 Subject: [PATCH 350/998] 1.11.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47d187f9..49b27803 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": "1.11.9", + "version": "1.11.10", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From f0bfb23213dff4e27de020ec3530b138e23f3881 Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Mon, 2 Jun 2014 20:19:28 +0200 Subject: [PATCH 351/998] Types: Document "Anything" virtual type Ref gh-391 Closes gh-504 --- pages/Types.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index 5a4f10d6..073fd0aa 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -35,6 +35,7 @@

      Contents

        +
      1. Anything
      2. String
      +

      Anything

      +

      The Anything virtual type is used in jQuery documentation to indicate that any type can be used or should be expected. +

      +

      String

      A string in JavaScript is an immutable object that contains none, one or many characters.

      From d0f0b6d95a3ee33beac33c7652788b34bd33b221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 27 May 2014 13:43:34 -0400 Subject: [PATCH 352/998] Build: Update license Closes gh-502 --- LICENSE-MIT.txt => LICENSE.txt | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) rename LICENSE-MIT.txt => LICENSE.txt (60%) diff --git a/LICENSE-MIT.txt b/LICENSE.txt similarity index 60% rename from LICENSE-MIT.txt rename to LICENSE.txt index 27ec7f48..01839718 100644 --- a/LICENSE-MIT.txt +++ b/LICENSE.txt @@ -1,9 +1,15 @@ -Copyright (c) 2009 Packt Publishing, http://packtpub.com/ -Copyright (c) 2013 jQuery Foundation, https://jquery.org/ +Copyright 2009 Packt Publishing, http://packtpub.com/ +Copyright 2012, 2014 jQuery Foundation and other contributors, +https://jquery.org/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history -and logs, available at https://github.com/jquery/api.jquery.com +available at https://github.com/jquery/api.jquery.com + +The following license applies to all parts of this software except as +documented below: + +==== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -23,3 +29,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation and all examples and demos. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules directory are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. From 630f90bb079d2bad992cd15358f453b10b0ae9be Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Sat, 5 Jul 2014 17:21:43 -0400 Subject: [PATCH 353/998] jQuery.browser: Mark as removed. Closes gh-513 --- entries/jQuery.browser.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index fe0f3add..e7c690ac 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -48,6 +48,7 @@ $.browser.msie; +
      From 8ad0c6021786795dda56743a435c70ce4beb3ba8 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 5 Jul 2014 17:48:28 -0400 Subject: [PATCH 354/998] .ajaxError(): parameter name in example -> . Closes #439 --- entries/ajaxError.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml index fbee691d..d13f71e6 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -36,7 +36,7 @@ $( "button.trigger" ).on( "click", function() {

      As of jQuery 1.8, the .ajaxError() method should only be attached to document.

      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, exception ) {
      +$( document ).ajaxError(function( event, jqxhr, settings, thrownError ) {
         if ( settings.url == "ajax/missing.html" ) {
           $( "div.log" ).text( "Triggered ajaxError handler." );
         }
      
      From 4418ffc682b1513be5f30ed0fa6f66c06062dba1 Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Sat, 5 Jul 2014 18:43:10 -0400
      Subject: [PATCH 355/998] jQuery.ajax(): data option can also be an Array.
       Closes #480
      
      ---
       entries/jQuery.ajax.xml | 1 +
       1 file changed, 1 insertion(+)
      
      diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
      index 3b70d572..33f985de 100644
      --- a/entries/jQuery.ajax.xml
      +++ b/entries/jQuery.ajax.xml
      @@ -61,6 +61,7 @@ $.ajax({
             
               
               
      +        
               Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
             
             
      
      From 03710c0966cf50d7e7801dc8db49b9f67813b590 Mon Sep 17 00:00:00 2001
      From: John Reilly 
      Date: Sat, 5 Jul 2014 18:46:35 -0400
      Subject: [PATCH 356/998] ajaxComplete(): responseXML -> responseText. Closes
       #483
      
      ---
       entries/ajaxComplete.xml | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml
      index 3ff3b58c..7f045973 100644
      --- a/entries/ajaxComplete.xml
      +++ b/entries/ajaxComplete.xml
      @@ -38,11 +38,11 @@ $( ".trigger" ).click(function() {
       $( document ).ajaxComplete(function( event, xhr, settings ) {
         if ( settings.url === "ajax/test.html" ) {
           $( ".log" ).text( "Triggered ajaxComplete handler. The result is " +
      -      xhr.responseHTML );
      +      xhr.responseText );
         }
       });
           
      -

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

      +

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

      From 517615b8277305af5fd4546d9062ceadaa93c18a Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sat, 5 Jul 2014 18:55:34 -0400 Subject: [PATCH 357/998] jQuery.ajax(): Note settings that could trigger a preflight OPTIONS request. Closes #488 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 33f985de..9ebf3145 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -38,7 +38,7 @@ An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. - When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server. This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so: From cec12dfc344e2ad501db4077ae638055b76665f1 Mon Sep 17 00:00:00 2001 From: Tom Fuertes Date: Sat, 5 Jul 2014 19:53:17 -0400 Subject: [PATCH 358/998] one(): Fix description of behavior for delegated .one() events. Closes #489 --- entries/one.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/one.xml b/entries/one.xml index f923fe0a..3b53235e 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -50,7 +50,7 @@ $( "#foo" ).one( "click", function() { alert( "This will be displayed only once." ); }); $( "body" ).one( "click", "#foo", function() { - alert( "This displays if #foo is the first thing clicked in the body." ); + alert( "This displays the first time #foo is clicked in the body." ); });

      After the code is executed, a click on the element with ID foo will display the alert. Subsequent clicks will do nothing. This code is equivalent to:

      From 7fe431e681ae60fa2effae50c97db0a1f96079ac Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 5 Jul 2014 22:11:25 -0400 Subject: [PATCH 359/998] Types page: add 'hour' to the Date param list. Closes #485 --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 073fd0aa..b003f444 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -433,7 +433,7 @@

      Date

      
       new Date();
       
      -

      To create a Date object for an alternative date and time, pass numeric arguments in the following order: year, month, day, minute, second, millisecond — although note that the month is zero-based, whereas the other arguments are one-based. The following creates a Date object representing January 1st, 2014, at 8:15. +

      To create a Date object for an alternative date and time, pass numeric arguments in the following order: year, month, day, hour, minute, second, millisecond — although note that the month is zero-based, whereas the other arguments are one-based. The following creates a Date object representing January 1st, 2014, at 8:15.

      
       new Date( 2014, 0, 1, 8, 15 );
      
      From bffd21edd5d6fe7addafb7651e5877fad079e318 Mon Sep 17 00:00:00 2001
      From: Nick Bottomley 
      Date: Sat, 5 Jul 2014 22:14:02 -0400
      Subject: [PATCH 360/998] deferred.notifyWith(): second argument takes Array.
       Closes #461
      
      ---
       entries/deferred.notifyWith.xml | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/deferred.notifyWith.xml b/entries/deferred.notifyWith.xml
      index 79c845ef..add312b8 100644
      --- a/entries/deferred.notifyWith.xml
      +++ b/entries/deferred.notifyWith.xml
      @@ -8,9 +8,9 @@
               Context passed to the progressCallbacks as the this object.
             
           
      -    
      +    
             
      -        Optional arguments that are passed to the progressCallbacks.
      +        An optional array of arguments that are passed to the progressCallbacks.
             
           
         
      
      From 6efa8ef5eb09d29492ec9a552ad2cdbee978528a Mon Sep 17 00:00:00 2001
      From: Timo Tijhof 
      Date: Sun, 6 Jul 2014 15:24:46 -0400
      Subject: [PATCH 361/998] attribute-contains-selector: Remove odd word from
       desc Fixes #507. Closes #508
      
      ---
       entries/attribute-contains-selector.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/attribute-contains-selector.xml b/entries/attribute-contains-selector.xml
      index 691b3f4e..8cb21dfc 100644
      --- a/entries/attribute-contains-selector.xml
      +++ b/entries/attribute-contains-selector.xml
      @@ -11,7 +11,7 @@
             An attribute value. Can be either an unquoted single word or a quoted string.
           
         
      -  Selects elements that have the specified attribute with a value containing the a given substring.
      +  Selects elements that have the specified attribute with a value containing a given substring.
         
           

      This is the most generous of the jQuery attribute selectors that match against a value. It will select an element if the selector's string appears anywhere within the element's attribute value. Compare this selector with the Attribute Contains Word selector (e.g. [attr~="word"]), which is more appropriate in many cases.

      From 3306dc702f51fd4748e9e51f55ba05c996909c2a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 6 Jul 2014 15:31:28 -0400 Subject: [PATCH 362/998] jQuery.fx.off(): Remove broken link (error 404). Fixes #457. Closes #516 --- entries/jQuery.fx.off.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index ae9b32d3..74bfd60a 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -9,7 +9,7 @@

      When this property is set to true, all animation methods will immediately set elements to their final state when called, rather than displaying an effect. This may be desirable for a couple reasons:

      • jQuery is being used on a low-resource device.
      • -
      • Users are encountering accessibility problems with the animations (see the article Turn Off Animation for more information).
      • +
      • Users are encountering accessibility problems with the animations.

      Animations can be turned back on by setting the property to false.

      From 08e6cefcd6dff6ddd43d2eb8c95b670bbdb708d3 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 6 Jul 2014 15:36:28 -0400 Subject: [PATCH 363/998] .is(): Refer to 2nd argument of function argument. Fixes #512. Closes #517 --- entries/is.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/is.xml b/entries/is.xml index 2a14f6a3..5595d26a 100644 --- a/entries/is.xml +++ b/entries/is.xml @@ -10,7 +10,7 @@ 1.6 - A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection. Within the function, this refers to the current DOM element. + A function used as a test for every element in the set. It accepts two arguments, index, which is the element's index in the jQuery collection, and element, which is the DOM element. Within the function, this refers to the current DOM element. From 3fc31d08f030a483b5bcd2adf86c5ef5383aab40 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 6 Jul 2014 15:39:35 -0400 Subject: [PATCH 364/998] .not(): Clean up signatures/arguments. Fixes #452. Closes #515 --- entries/not.xml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/entries/not.xml b/entries/not.xml index dec089f6..6b5cf416 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -3,14 +3,11 @@ .not() 1.0 - - A string containing a selector expression to match elements against. - - - - 1.0 - - One or more DOM elements to remove from the matched set. + + A string containing a selector expression, a DOM element, or an array of elements to match against the set. + + + From ebc7dbcf4655d6f39fb661142601c816966620d9 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 6 Jul 2014 15:42:30 -0400 Subject: [PATCH 365/998] .not(): Improve documentation for Function parameter. Closes #518 --- entries/not.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/not.xml b/entries/not.xml index 6b5cf416..059e5e29 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -13,7 +13,7 @@ 1.4 - A function used as a test for each element in the set. this is the current DOM element. + A function used as a test for each element in the set. It accepts two arguments, index, which is the element's index in the jQuery collection, and element, which is the DOM element. Within the function, this refers to the current DOM element. From c08ab1caa1de01a1fee7cb4523051c50b3c8ef0b Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 6 Jul 2014 15:57:29 -0400 Subject: [PATCH 366/998] Types page: improve wording of Element section --- pages/Types.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/Types.html b/pages/Types.html index b003f444..3889f34f 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -582,19 +582,19 @@

      Event

      The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

      Element

      -

      An element in the Document Object Model (DOM) has attributes, text and children. It provides methods to traverse the parent and children and to get access to its attributes. Due to a lot of flaws in DOM API specifications and implementations, those methods are no fun to use. jQuery provides a wrapper around those elements to help interacting with the DOM. But often enough you will be working directly with DOM elements, or see methods that (also) accept DOM elements as arguments. +

      An element in the Document Object Model (DOM) can have attributes, text, and children. It provides methods to traverse the parent and children and to get access to its attributes. Due to inconsistencies in DOM API specifications and implementations, however, those methods can be a challenge to use. jQuery provides a "wrapper" around those elements to help interacting with the DOM. But sometimes you will be working directly with DOM elements, or see methods that (also) accept DOM elements as arguments.

      -

      Whenever you use jQuery's each-method, the context of your callback is set to a DOM element. That is also the case for event handlers. +

      Whenever you call jQuery's .each() method or one of its event methods on a jQuery collection, the context of the callback function — this — is set to a DOM element.

      -

      Some properties of DOM elements are quite consistent among browsers. Consider this example of a simple on-blur-validation: +

      Some properties of DOM elements are quite consistent among browsers. Consider this example of a simple onblur validation:

      -
      $( ":text" ).blur(function() {
      +
      $( "input[type='text']" ).on( "blur", function() {
         if( !this.value ) {
           alert( "Please enter some text!" );
         }
       });
       
      -

      You could replace this.value with $(this).val() to access the value of the text input via jQuery, but in that case you don't gain anything. +

      You could replace this.value with $(this).val() to access the value of the text input via jQuery, but in that case you wouldn't gain anything.

      jQuery

      A jQuery object contains a collection of Document Object Model (DOM) elements that have been created from an HTML string or selected from a document. Since jQuery methods often use CSS selectors to match elements from a document, the set of elements in a jQuery object is often called a set of "matched elements" or "selected elements". From 73f074b4b554633217bd07c91eb52343973917ef Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 6 Jul 2014 16:07:16 -0400 Subject: [PATCH 367/998] 1.11.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49b27803..4a338267 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": "1.11.10", + "version": "1.11.11", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 65733cfd6e7cadf5743d8463c7b12c9750d5142c Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 6 Jul 2014 21:38:49 -0400 Subject: [PATCH 368/998] wrapInner(): Add accepted types for the wrappingElement argument. Closes #520 --- entries/wrapInner.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/entries/wrapInner.xml b/entries/wrapInner.xml index 6a459161..42e0101a 100644 --- a/entries/wrapInner.xml +++ b/entries/wrapInner.xml @@ -3,8 +3,12 @@ .wrapInner() 1.2 - + An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + + + + From a1ddea947b273fb6375b035d0f468b32cd661d23 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 7 Jul 2014 09:07:30 -0400 Subject: [PATCH 369/998] wrapAll(): Add missing documentation of the possibility to pass a function (since jQuery 1.4). Closes #521 --- entries/wrapAll.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/entries/wrapAll.xml b/entries/wrapAll.xml index c4c7c49a..80112ca0 100644 --- a/entries/wrapAll.xml +++ b/entries/wrapAll.xml @@ -11,6 +11,14 @@ A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + + 1.4 + + A function that returns a structure to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + + + + Wrap an HTML structure around all elements in the set of matched elements.

      The .wrapAll() function can take any string or object that could be passed to the $() function to specify a DOM structure. This structure may be nested several levels deep, but should contain only one inmost element. The structure will be wrapped around all of the elements in the set of matched elements, as a single group.

      From c46264705e04b873a28043582a692e2d6e41f7f0 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 7 Jul 2014 09:19:44 -0400 Subject: [PATCH 370/998] 1.11.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a338267..4d3c5a10 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": "1.11.11", + "version": "1.11.12", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 9959d69147ea0a7edba9201055363aacba213bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=2E=20Agust=C3=ADn=20Amenabar=20L?= Date: Tue, 8 Jul 2014 17:33:16 -0400 Subject: [PATCH 371/998] jQuery.inArray(): Note that inArray campares values strictly. Closes #470 --- entries/jQuery.inArray.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.inArray.xml b/entries/jQuery.inArray.xml index 16e43b60..e7a3ca80 100644 --- a/entries/jQuery.inArray.xml +++ b/entries/jQuery.inArray.xml @@ -16,7 +16,9 @@ Search for a specified value within an array and return its index (or -1 if not found).

      The $.inArray() method is similar to JavaScript's native .indexOf() method in that it returns -1 when it doesn't find a match. If the first element within the array matches value, $.inArray() returns 0.

      -

      Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), if we're checking for the presence of value within array, we need to check if it's not equal to (or greater than) -1.

      +

      Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), to check for the presence of value within array, you need to check if it's not equal to (or greater than) -1.

      +

      The comparison between values is strict. The following will return -1 (not found) because a number is being searched in an array of strings:

      +
      $.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );
      Report the index of some elements in the array. From fd3b18b4a5bcc92b57a481245a0f8d48986730e9 Mon Sep 17 00:00:00 2001 From: Tom Fuertes Date: Wed, 9 Jul 2014 22:24:02 -0400 Subject: [PATCH 372/998] one(): Fix description of behavior for delegated .one() events. Closes #519 --- entries/one.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/entries/one.xml b/entries/one.xml index 3b53235e..1327dbf0 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -44,13 +44,10 @@ -

      The first form of this method is identical to .bind(), except that the handler is unbound after its first invocation. The second two forms, introduced in jQuery 1.7, are identical to .on() except that the handler is removed after the first time the event occurs at the delegated element, whether the selector matched anything or not. For example:

      +

      The .one() method is identical to .on(), except that the handler is unbound after its first invocation. For example:

      
       $( "#foo" ).one( "click", function() {
         alert( "This will be displayed only once." );
      -});
      -$( "body" ).one( "click", "#foo", function() {
      -  alert( "This displays the first time #foo is clicked in the body." );
       });
           

      After the code is executed, a click on the element with ID foo will display the alert. Subsequent clicks will do nothing. This code is equivalent to:

      From 07349e4353d9bb629c71894f26e94478bf4f0d17 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 9 Jul 2014 22:24:47 -0400 Subject: [PATCH 373/998] 1.11.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d3c5a10..0611958f 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": "1.11.12", + "version": "1.11.13", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From fd64c7c501235c0324f89828d091df60950be43d Mon Sep 17 00:00:00 2001 From: Mike Spangler Date: Sat, 12 Jul 2014 11:34:32 -0400 Subject: [PATCH 374/998] added missing parameter in example. closes issue #465 --- entries/jQuery.ajaxTransport.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml index ccf5151e..ab8e4d9b 100644 --- a/entries/jQuery.ajaxTransport.xml +++ b/entries/jQuery.ajaxTransport.xml @@ -19,7 +19,7 @@

      Since each request requires its own transport object instance, transports cannot be registered directly. Therefore, you should provide a function that returns a transport instead.

      Transports factories are registered using $.ajaxTransport(). A typical registration looks like this:

      
      -$.ajaxTransport(function( options, originalOptions, jqXHR ) {
      +$.ajaxTransport( dataType, function( options, originalOptions, jqXHR ) {
         if( /* transportCanHandleRequest */ ) {
           return {
             send: function( headers, completeCallback ) {
      
      From e1a33e0e9f046f6deef01711b1afd1b894805770 Mon Sep 17 00:00:00 2001
      From: Matt Lunn 
      Date: Sat, 12 Jul 2014 11:39:58 -0400
      Subject: [PATCH 375/998] Added notes that replaceWith() and replaceAll()
       remove node data
      
      ---
       entries/replaceAll.xml  | 3 ++-
       entries/replaceWith.xml | 1 +
       notes.xsl               | 3 +++
       3 files changed, 6 insertions(+), 1 deletion(-)
      
      diff --git a/entries/replaceAll.xml b/entries/replaceAll.xml
      index 8dd9f191..64759e81 100644
      --- a/entries/replaceAll.xml
      +++ b/entries/replaceAll.xml
      @@ -13,7 +13,7 @@
         
         Replace each target element with the set of matched elements.
         
      -    

      The .replaceAll() method is corollary to .replaceWith(), but with the source and target reversed. Consider this DOM structure:

      +

      The .replaceAll() method is similar to .replaceWith(), but with the source and target reversed. Consider this DOM structure:

      
       <div class="container">
         <div class="inner first">Hello</div>
      @@ -44,6 +44,7 @@ $( ".first" ).replaceAll( ".third" );
           

      From this example, we can see that the selected element replaces the target by being moved from its old location, not by being cloned.

      + Replace all the paragraphs with bold words. Date: Sun, 13 Jul 2014 08:49:38 -0400 Subject: [PATCH 377/998] jQuery(): Fix small typo. Closes #525 --- entries/jQuery.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 9fb438b1..ad58d2c7 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -175,7 +175,7 @@ $( myForm.elements ).hide();

      For explicit parsing of a string to HTML, use the $.parseHTML() method.

      By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript createElement() function.

      -

      When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser"s .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

      +

      When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

      Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

      To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

      $( "<a href='http://jquery.com'></a>" );
      From 03fcbfbd17b494cc1122b6727adfcd8101b0ea9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 18 Jul 2014 10:09:34 -0400 Subject: [PATCH 378/998] Build: Upgrade to grunt-jquery-content 0.11.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ec6f18b..0e6061d4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.11.0", + "grunt-jquery-content": "0.11.2", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 3cb7ccfb21eb842305e8e6f4738a2292147af4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 24 Jul 2014 12:00:19 -0400 Subject: [PATCH 379/998] Build: Upgrade to grunt-jquery-content 0.11.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e6061d4..be48f017 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.11.2", + "grunt-jquery-content": "0.11.3", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From 10f0f86ebc2219a5522ff8e5b6b2fc4ac52670d0 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 5 Aug 2014 08:06:33 -0400 Subject: [PATCH 380/998] visible selector: Add note that option elements are always considered hidden. Closes #522 --- entries/visible-selector.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index 59fc4b42..28a716fb 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -9,8 +9,9 @@

      Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.

      Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

      -

      Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

      -

      During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.

      +

      Elements that are not in a document are considered hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

      +

      All option elements are considered hidden, regardless of their selected state.

      +

      During animations that hide an element, the element is considered visible until the end of the animation. During animations to show an element, the element is considered visible at the start at the animation.

      How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

      From 62e06654e896f53f676020c05dbc6617fdf0d1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Aug 2014 16:56:03 -0400 Subject: [PATCH 381/998] Build: Upgrade to grunt-jquery-content 0.12.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be48f017..c596290b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "grunt": "0.3.17", "grunt-clean": "0.3.0", "grunt-wordpress": "1.0.7", - "grunt-jquery-content": "0.11.3", + "grunt-jquery-content": "0.12.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From b2173569981481cafd0f2f78cea6cc9e62c5f216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Aug 2014 16:56:06 -0400 Subject: [PATCH 382/998] 1.11.15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c596290b..15fce595 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": "1.11.14", + "version": "1.11.15", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 536292ca835a44c20a107894f468bd3cfd8bd8ca Mon Sep 17 00:00:00 2001 From: Andy Li Date: Tue, 19 Aug 2014 22:40:13 -0400 Subject: [PATCH 383/998] innerWidth(): Specify the signature of the function argument. --- entries/innerWidth.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index c2e30f3d..1e5c2bf6 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -50,8 +50,14 @@ $( "p:last" ).text( "innerWidth:" + p.innerWidth() ); 1.8.0 - - A function returning the inner width (including padding but not border) to set. Receives the index position of the element in the set and the old inner width as arguments. Within the function, this refers to the current element in the set. + + + + + + + + A function returning the inner width (including padding but not border) to set. Receives the index position of the element in the set and the old inner width as arguments. Within the function, this refers to the current element in the set. Set the CSS inner width of each element in the set of matched elements. From 9d78f2d17b3083c323c406273e07b4962334358a Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 19 Aug 2014 22:42:28 -0400 Subject: [PATCH 384/998] innerHeight(): Add documentation for innerHeight as setter --- entries/innerHeight.xml | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index d8b71770..a7cd3eec 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -1,4 +1,7 @@ + + Get the current computed inner height (including padding but not border) for the first element in the set of matched elements or set the inner height of every matched element. + .innerHeight() @@ -36,3 +39,69 @@ $( "p:last" ).text( "innerHeight:" + p.innerHeight() ); + + + + 1.8.0 + + + + A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + + + 1.8.0 + + + + + + + + A function returning the inner height (including padding but not border) to set. Receives the index position of the element in the set and the old inner height as arguments. Within the function, this refers to the current element in the set. + + +Set the CSS inner height of each element in the set of matched elements. + +

      When calling .innerHeight("value"), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used for the height (such as 100px, 50%, or auto). Note that in modern browsers, the CSS height property does not include padding, border, or margin, unless the box-sizing CSS property is used.

      +

      If no explicit unit is specified (like "em" or "%") then "px" is assumed.

      +
      + + Change the inner height of each div the first time it is clicked (and change its color). + + + + + + + + +
      + +
      From d8ee9fa661c543f8e74bfb0b50f021aa9a0062c5 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 19 Aug 2014 22:44:12 -0400 Subject: [PATCH 385/998] 1.11.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15fce595..dc01a78e 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": "1.11.15", + "version": "1.11.16", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 821f0199223d82a1d8d6cec3bd924e0477792c1b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Wed, 20 Aug 2014 10:47:37 -0400 Subject: [PATCH 386/998] jQuery.ajax(): Uppercase 'JSONP' --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 9ebf3145..fd4d1878 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -95,7 +95,7 @@ $.ajax({ Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. - Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } From 7f5293d8a5cc257009d8cd05e30c8bcc2696ad4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 21 Aug 2014 08:19:03 -0400 Subject: [PATCH 387/998] innerHeight: Fix typo --- entries/innerHeight.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index a7cd3eec..cf9bb667 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -53,7 +53,7 @@ $( "p:last" ).text( "innerHeight:" + p.innerHeight() ); 1.8.0 - + From a1e3a17bbad3c2d01f3f26ec73644bfcb19d8a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 21 Aug 2014 08:19:33 -0400 Subject: [PATCH 388/998] 1.11.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc01a78e..53e488d4 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": "1.11.16", + "version": "1.11.17", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 6f40df9ce96abfaca77f052b494102b302eac1a5 Mon Sep 17 00:00:00 2001 From: John Ryding Date: Sun, 24 Aug 2014 14:13:33 -0400 Subject: [PATCH 389/998] callbacks.has(): Make argument optional and clarify description. Closes #453 --- entries/callbacks.has.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/callbacks.has.xml b/entries/callbacks.has.xml index 44c65247..401c9d85 100644 --- a/entries/callbacks.has.xml +++ b/entries/callbacks.has.xml @@ -3,11 +3,11 @@ callbacks.has() 1.7 - + The callback to search for. - Determine whether a supplied callback is in a list + Determine whether or not the list has any callbacks attached. If a callback is provided as an argument, determine whether it is in a list. Use callbacks.has() to check if a callback list contains a specific callback: From 51636241f0dfe953b3d9a088e46a85f492cbefaf Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 24 Aug 2014 14:17:03 -0400 Subject: [PATCH 390/998] find(): Merge two similar signatures introduced in the same version. Closes #555. --- entries/find.xml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/entries/find.xml b/entries/find.xml index 16c1d799..b6a82654 100644 --- a/entries/find.xml +++ b/entries/find.xml @@ -9,14 +9,10 @@ 1.6 - - A jQuery object to match elements against. - - - - 1.6 - - An element to match elements against. + + An element or a jQuery object to match elements against. + + Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. From d408dd2ea8c6ce8f7bd1a0c87cb805865d1179de Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 24 Aug 2014 14:33:48 -0400 Subject: [PATCH 391/998] Event docs: eventData argument can accept "Anything." Fixes #556 --- entries/bind.xml | 4 ++-- entries/blur.xml | 2 +- entries/change.xml | 2 +- entries/click.xml | 2 +- entries/dblclick.xml | 2 +- entries/delegate.xml | 2 +- entries/error.xml | 2 +- entries/focus.xml | 2 +- entries/focusin.xml | 2 +- entries/focusout.xml | 2 +- entries/keydown.xml | 2 +- entries/keypress.xml | 2 +- entries/keyup.xml | 2 +- entries/load-event.xml | 2 +- entries/mousedown.xml | 2 +- entries/mouseenter.xml | 2 +- entries/mouseleave.xml | 2 +- entries/mousemove.xml | 2 +- entries/mouseout.xml | 2 +- entries/mouseover.xml | 2 +- entries/mouseup.xml | 2 +- entries/resize.xml | 2 +- entries/scroll.xml | 2 +- entries/select.xml | 2 +- entries/submit.xml | 2 +- entries/unload.xml | 2 +- 26 files changed, 27 insertions(+), 27 deletions(-) diff --git a/entries/bind.xml b/entries/bind.xml index be20d77c..a81e46a8 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -6,7 +6,7 @@ A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - + An object containing data that will be passed to the event handler. @@ -19,7 +19,7 @@ A string containing one or more DOM event types, such as "click" or "submit," or custom event names. - + An object containing data that will be passed to the event handler. diff --git a/entries/blur.xml b/entries/blur.xml index ddb9bf99..747a7d1e 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/change.xml b/entries/change.xml index eedea432..4884ff1e 100644 --- a/entries/change.xml +++ b/entries/change.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/click.xml b/entries/click.xml index c6a014c1..9be0e863 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/dblclick.xml b/entries/dblclick.xml index ec851198..7db082fe 100644 --- a/entries/dblclick.xml +++ b/entries/dblclick.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/delegate.xml b/entries/delegate.xml index dd57ffee..e1670e84 100644 --- a/entries/delegate.xml +++ b/entries/delegate.xml @@ -23,7 +23,7 @@ A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names. - + An object containing data that will be passed to the event handler. diff --git a/entries/error.xml b/entries/error.xml index f93ba9fd..ff4a0ccf 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/focus.xml b/entries/focus.xml index 0651faab..96957219 100644 --- a/entries/focus.xml +++ b/entries/focus.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/focusin.xml b/entries/focusin.xml index a692e3bb..dd273e67 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/focusout.xml b/entries/focusout.xml index 2d110637..b8ac4373 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/keydown.xml b/entries/keydown.xml index 893be2a7..d18b6011 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -10,7 +10,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/keypress.xml b/entries/keypress.xml index 0724c1bf..bd4fcbf2 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/keyup.xml b/entries/keyup.xml index 517d94b9..2d523041 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/load-event.xml b/entries/load-event.xml index b8e48626..d95f81bc 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 51186203..98f03d33 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml index 72acea07..ae59e888 100644 --- a/entries/mouseenter.xml +++ b/entries/mouseenter.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml index af7f8589..25ed2dc7 100644 --- a/entries/mouseleave.xml +++ b/entries/mouseleave.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mousemove.xml b/entries/mousemove.xml index 56943fd4..240f92c3 100644 --- a/entries/mousemove.xml +++ b/entries/mousemove.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mouseout.xml b/entries/mouseout.xml index 844d886f..664e2164 100644 --- a/entries/mouseout.xml +++ b/entries/mouseout.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mouseover.xml b/entries/mouseover.xml index 1ddfd9e5..d8e8b0b0 100644 --- a/entries/mouseover.xml +++ b/entries/mouseover.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/mouseup.xml b/entries/mouseup.xml index 6006ea69..80d0f619 100644 --- a/entries/mouseup.xml +++ b/entries/mouseup.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/resize.xml b/entries/resize.xml index 280ff015..53b2a4cf 100644 --- a/entries/resize.xml +++ b/entries/resize.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/scroll.xml b/entries/scroll.xml index 1f0e6454..372d6c64 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/select.xml b/entries/select.xml index 44e51043..597c0f1d 100644 --- a/entries/select.xml +++ b/entries/select.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/submit.xml b/entries/submit.xml index 38ee1f06..28666420 100644 --- a/entries/submit.xml +++ b/entries/submit.xml @@ -11,7 +11,7 @@ 1.4.3 - + An object containing data that will be passed to the event handler. diff --git a/entries/unload.xml b/entries/unload.xml index 9fc62283..e7c12492 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -10,7 +10,7 @@ 1.4.3 - + A plain object of data that will be passed to the event handler. From 500f05eccd7c5a48803db6dba19f592fef34cc36 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Aug 2014 09:03:04 -0400 Subject: [PATCH 392/998] jQuery(): Document change in jQuery( html ) behavior as of 1.9. Minor style fixes. Closes #531 --- entries/jQuery.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index ad58d2c7..fc13219d 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -173,8 +173,8 @@ $( myForm.elements ).hide();

      If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with <tag ... >). If not, the string is interpreted as a selector expression, as explained above. But if the string appears to be an HTML snippet, jQuery attempts to create new DOM elements as described by the HTML. Then a jQuery object is created and returned that refers to these elements. You can perform any of the usual jQuery methods on this object:

      $( "<p id='test'>My <em>new</em> text</p>" ).appendTo( "body" );

      For explicit parsing of a string to HTML, use the $.parseHTML() method.

      -

      By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

      -

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript createElement() function.

      +

      By default, elements are created with an .ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

      +

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's .innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function.

      When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

      Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

      To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

      @@ -184,14 +184,14 @@ $( myForm.elements ).hide(); $( "<img>" ); $( "<input>" );
      -

      When passing HTML to jQuery(), please also note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally otherwise ignored or removed. E.g:

      +

      When passing HTML to jQuery(), note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally ignored or removed. E.g:

      
      -var el = $( "1<br>2<br>3" ); // returns [<br>, "2", <br>]
      -el = $( "1<br>2<br>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]
      +var el = $( "<br>2<br>3" ); // returns [<br>, "2", <br>]
      +el = $( "<br>2<br>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]
             
      -

      This behavior is expected.

      -

      As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

      -

      Important: If the second argument is passed, the HTML string in the first argument must represent a a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

      +

      This behavior is expected. As of jQuery 1.9.0 (and unless using the jQuery Migrate plugin), jQuery() requires the HTML string to start with a < (i.e text nodes cannot appear at the front of the HTML string).

      +

      As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

      +

      Important: If the second argument is passed, the HTML string in the first argument must represent a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

      As of jQuery 1.8, any jQuery instance method (a method of jQuery.fn) can be used as a property of the object passed to the second parameter:

      
       $( "
      ", { From 1b41725878f0c5b3a0c1872204cb04c272799059 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 28 Aug 2014 09:27:12 -0400 Subject: [PATCH 393/998] 1.11.18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 53e488d4..478553bd 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": "1.11.17", + "version": "1.11.18", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 44c1990c3a69a174f28a758a842a6ff8b24d414d Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Thu, 11 Sep 2014 15:02:37 -0500 Subject: [PATCH 394/998] Types page: Remove extra space from beginning of 'load' DOM event --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 3889f34f..e30e97e2 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -579,7 +579,7 @@

      Event

      Those properties are all documented, and accompanied by examples, on the Event object page.

      -

      The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any. +

      The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

      Element

      An element in the Document Object Model (DOM) can have attributes, text, and children. It provides methods to traverse the parent and children and to get access to its attributes. Due to inconsistencies in DOM API specifications and implementations, however, those methods can be a challenge to use. jQuery provides a "wrapper" around those elements to help interacting with the DOM. But sometimes you will be working directly with DOM elements, or see methods that (also) accept DOM elements as arguments. From 8592feba7790c8b6195298192f00f119fdeb3dc0 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 11 Sep 2014 15:37:06 -0500 Subject: [PATCH 395/998] jQuery.when(): Clarify multiple deferred behavior and provide example. Closes #545 --- entries/jQuery.when.xml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index 3a147ab2..e28819e3 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -9,20 +9,48 @@ Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. -

      If a single Deferred is passed to jQuery.when, its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise and can be used this way:

      +

      If a single Deferred is passed to jQuery.when(), its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise and can be used this way:

      
       $.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {
         alert( jqXHR.status ); // Alerts 200
       });
           
      -

      If a single argument is passed to jQuery.when and it is not a Deferred or a Promise, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. The doneCallbacks are passed the original argument. In this case any failCallbacks you might set are never called since the Deferred is never rejected. For example:

      +

      If a single argument is passed to jQuery.when() and it is not a Deferred or a Promise, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. The doneCallbacks are passed the original argument. In this case any failCallbacks you might set are never called since the Deferred is never rejected. For example:

      
       $.when( { testing: 123 } ).done(function( x ) {
         alert( x.testing ); // Alerts "123"
       });
           
      -

      In the case where multiple Deferred objects are passed to jQuery.when, the method returns the Promise from a new "master" Deferred object that tracks the aggregate state of all the Deferreds it has been passed. The method will resolve its master Deferred as soon as all the Deferreds resolve, or reject the master Deferred as soon as one of the Deferreds is rejected. If the master Deferred is resolved, it is passed the resolved values of all the Deferreds that were passed to jQuery.when. For example, when the Deferreds are jQuery.ajax() requests, the arguments will be the jqXHR objects for the requests, in the order they were given in the argument list.

      -

      In the multiple-Deferreds case where one of the Deferreds is rejected, jQuery.when immediately fires the failCallbacks for its master Deferred. Note that some of the Deferreds may still be unresolved at that point. If you need to perform additional processing for this case, such as canceling any unfinished ajax requests, you can keep references to the underlying jqXHR objects in a closure and inspect/cancel them in the failCallback.

      +

      In the case where multiple Deferred objects are passed to jQuery.when(), the method returns the Promise from a new "master" Deferred object that tracks the aggregate state of all the Deferreds it has been passed. The method will resolve its master Deferred as soon as all the Deferreds resolve, or reject the master Deferred as soon as one of the Deferreds is rejected. If the master Deferred is resolved, the doneCallbacks for the master Deferred are executed. The arguments passed to the doneCallbacks provide the resolved values for each of the Deferreds, and matches the order the Deferreds were passed to jQuery.when(). For example:

      +
      
      +var d1 = new $.Deferred();
      +var d2 = new $.Deferred();
      +
      +$.when( d1, d2 ).done(function ( v1, v2 ) {
      +    console.log( v1 ); // "Fish"
      +    console.log( v2 ); // "Pizza"
      +});
      +
      +d1.resolve( "Fish" );
      +d2.resolve( "Pizza" );
      +    
      +

      In the event a Deferred was resolved with no value, the corresponding doneCallback argument will be undefined. If a Deferred resolved to a single value, the corresponding argument will hold that value. In the case where a Deferred resolved to multiple values, the corresponding argument will be an array of those values. For example:

      +
      
      +var d1 = new $.Deferred();
      +var d2 = new $.Deferred();
      +var d3 = new $.Deferred();
      +
      +$.when( d1, d2, d3 ).done(function ( v1, v2, v3 ) {
      +    console.log( v1 ); // v1 is undefined
      +    console.log( v2 ); // v2 is "abc"
      +    console.log( v3 ); // v3 is an array [ 1, 2, 3, 4, 5 ]
      +});
      +
      +d1.resolve();
      +d2.resolve( "abc" );
      +d3.resolve( 1, 2, 3, 4, 5 );
      +    
      +

      In the multiple-Deferreds case where one of the Deferreds is rejected, jQuery.when() immediately fires the failCallbacks for its master Deferred. Note that some of the Deferreds may still be unresolved at that point. The arguments passed to the failCallbacks match the signature of the failCallback for the Deferred that was rejected. If you need to perform additional processing for this case, such as canceling any unfinished ajax requests, you can keep references to the underlying jqXHR objects in a closure and inspect/cancel them in the failCallback.

      Execute a function after two ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). From bb5a21d6215d229190182b52bd77ffc98d046e23 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 11 Sep 2014 15:59:02 -0500 Subject: [PATCH 396/998] Remove recommendation that removeData() is the same as data("key", undefined). Closes #542. --- entries/data.xml | 7 ++++--- entries/jQuery.data.xml | 7 ++++--- entries/removeData.xml | 9 ++++++--- notes.xsl | 9 ++++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/entries/data.xml b/entries/data.xml index 560f49d5..67fa35be 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -8,8 +8,8 @@ A string naming the piece of data to set. - - The new data value; it can be any Javascript type including Array or Object. + + The new data value; this can be any Javascript type except undefined. @@ -30,10 +30,11 @@ $( "body" ).data( "foo" ); // 52 $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }

      In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element. jQuery itself uses the .data() method to save information under the names 'events' and 'handle', and also reserves any data name starting with an underscore ('_') for internal use.

      -

      Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

      +

      Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

      Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

      + Store then retrieve a value from the div element. Note: Although style and script tags will report a value for .width() or height() when absolutely positioned and given display:block, it is strongly discouraged to call those methods on these tags. In addition to being a bad practice, the results may also prove unreliable.

      - + + Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. Encode a set of form elements as an array of names and values. -

      The .serializeArray() method creates a JavaScript array of objects, ready to be encoded as a JSON string. It operates on a jQuery object representing a set of form elements. The form elements can be of several types:

      +

      The .serializeArray() method creates a JavaScript array of objects, ready to be encoded as a JSON string. It operates on a jQuery collection of forms and/or form controls. The controls can be of several types:

      
       <form>
         <div><input type="text" name="a" value="1" id="a"></div>
      @@ -29,7 +29,7 @@
       </form>
           

      The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized.

      -

      This method can act on a jQuery object that has selected individual form elements, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> tag itself for serialization:

      +

      This method can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> element itself for serialization:

      
       $( "form" ).submit(function( event ) {
         console.log( $( this ).serializeArray() );
      
      From 8b84cc453e52a2b16c7c11642a2bba48693c35af Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Thu, 11 Sep 2014 16:27:00 -0500
      Subject: [PATCH 399/998] 1.11.19
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index 478553bd..6a3fe702 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": "1.11.18",
      +  "version": "1.11.19",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (https://jquery.org/)"
      
      From c2c633afcd8bd4704afcc951afb904e1cc473e9b Mon Sep 17 00:00:00 2001
      From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
      Date: Sat, 13 Sep 2014 14:17:17 -0500
      Subject: [PATCH 400/998] Build: Upgrade to grunt-wordpress 1.1.0 and
       grunt-jquery-content 0.12.1
      
      ---
       package.json | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/package.json b/package.json
      index 6a3fe702..f6960c5a 100644
      --- a/package.json
      +++ b/package.json
      @@ -23,8 +23,8 @@
         "dependencies": {
           "grunt": "0.3.17",
           "grunt-clean": "0.3.0",
      -    "grunt-wordpress": "1.0.7",
      -    "grunt-jquery-content": "0.12.0",
      +    "grunt-wordpress": "1.1.0",
      +    "grunt-jquery-content": "0.12.1",
           "grunt-check-modules": "0.1.0"
         },
         "devDependencies": {},
      
      From 95f96adc190342d32213cc5367c651bd261386a3 Mon Sep 17 00:00:00 2001
      From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
      Date: Sat, 13 Sep 2014 16:37:28 -0500
      Subject: [PATCH 401/998] 1.11.20
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index f6960c5a..930b7619 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": "1.11.19",
      +  "version": "1.11.20",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (https://jquery.org/)"
      
      From 8d5ed5bc77e86a31897d8e58fa1f3c26eb586bfb Mon Sep 17 00:00:00 2001
      From: Matt 
      Date: Fri, 12 Sep 2014 09:25:56 -0500
      Subject: [PATCH 402/998] on(): Document that on() accepts .trigger() args.
       Fixes #472. Closes #538.
      
      ---
       entries/on.xml | 31 +++++++++++++++++++++++++------
       1 file changed, 25 insertions(+), 6 deletions(-)
      
      diff --git a/entries/on.xml b/entries/on.xml
      index a875aa37..eeab0009 100644
      --- a/entries/on.xml
      +++ b/entries/on.xml
      @@ -16,6 +16,7 @@
           
             A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
             
      +      
           
         
         
      @@ -63,7 +64,7 @@ function notify() {
       }
       $( "button" ).on( "click", notify );
           
      -

      When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

      +

      When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an Event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

      By default, most events bubble up from the original event target to the document element. At each element along the way, jQuery calls any matching event handlers that have been attached. A handler can prevent the event from bubbling further up the document tree (and thus prevent handlers on those elements from running) by calling event.stopPropagation(). Any other handlers attached on the current element will run however. To prevent that, call event.stopImmediatePropagation(). (Event handlers bound to an element are called in the same order that they were bound.)

      Similarly, a handler can call event.preventDefault() to cancel any default action that the browser may have for this event; for example, the default action on a click event is to follow the link. Not all browser events have default actions, and not all default actions can be canceled. See the W3C Events Specification for details.

      Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $( "a.disabled" ).on( "click", false ); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

      @@ -83,7 +84,7 @@ $( "button" ).on( "click", { }, greet );

      The above code will generate two different alerts when the button is clicked.

      -

      As an alternative or in addition to the data argument provided to the .on() method, you can also pass data to an event handler using a second argument to .trigger() or .triggerHandler().

      +

      As an alternative or in addition to the data argument provided to the .on() method, you can also pass data to an event handler using a second argument to .trigger() or .triggerHandler(). Data provided this way is passed to the event handler as further parameters after the Event object. If an array was passed to the second argument of .trigger() or .triggerHandler(), each element in the array will be presented to the event handler as an individual parameter.

      Event performance

      In most cases, an event such as click occurs infrequently and performance is not a significant concern. However, high frequency events such as mousemove or scroll can fire dozens of times per second, and in those cases it becomes more important to use events judiciously. Performance can be increased by reducing the amount of work done in the handler itself, caching information needed by the handler rather than recalculating it, or by rate-limiting the number of actual page updates using setTimeout.

      Attaching many delegated event handlers near the top of the document tree can degrade performance. Each time the event occurs, jQuery must compare all selectors of all attached events of that type to every element in the path from the event target up to the top of the document. For best performance, attach delegated events at a document location as close as possible to the target elements. Avoid excessive use of document or document.body for delegated events on large documents.

      @@ -120,7 +121,7 @@ $( "form" ).on( "submit", false ); ]]>
      - Cancel only the default action by using .preventDefault(). + Cancel only the default action by using .preventDefault(). - Stop submit events from bubbling without preventing form submit, using .stopPropagation(). + Stop submit events from bubbling without preventing form submit, using .stopPropagation(). + + + Pass data to the event handler using the second argument to .trigger() + + + + Use the the second argument of .trigger() to pass an array of data to the event handler + @@ -196,7 +215,7 @@ $( "div.test" ).on({ ]]>
      - Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. + Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. - Cancel a link's default action using the preventDefault method. + Cancel a link's default action using the .preventDefault() method. + diff --git a/entries/deferred.isResolved.xml b/entries/deferred.isResolved.xml index fa1a9392..b5941322 100644 --- a/entries/deferred.isResolved.xml +++ b/entries/deferred.isResolved.xml @@ -13,4 +13,5 @@ + diff --git a/entries/selector.xml b/entries/selector.xml index 74ea2326..971a2535 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -12,4 +12,5 @@ + From 9cf8d5f5ba537bb461d94659753097a07f4d18ad Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 24 Sep 2014 15:01:56 -0400 Subject: [PATCH 404/998] 1.11.21 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 930b7619..d1152a05 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": "1.11.20", + "version": "1.11.21", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 21cc6b608b3c22349cc57a5cac5ae418ea6fda4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 30 Sep 2014 15:02:50 -0400 Subject: [PATCH 405/998] Build: Upgrade to grunt-wordpress 1.2.1 and grunt-jquery-content 0.13.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d1152a05..ca70c3a8 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "dependencies": { "grunt": "0.3.17", "grunt-clean": "0.3.0", - "grunt-wordpress": "1.1.0", - "grunt-jquery-content": "0.12.1", + "grunt-wordpress": "1.2.1", + "grunt-jquery-content": "0.13.0", "grunt-check-modules": "0.1.0" }, "devDependencies": {}, From ae9390d2185b6ef0a53032af8aa4911719878d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 30 Sep 2014 15:06:01 -0400 Subject: [PATCH 406/998] 1.11.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca70c3a8..1b998f3f 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": "1.11.21", + "version": "1.11.22", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From f9b6ff0fa5e1bba629dc38b39aeb1cd09b49cb5a Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 30 Sep 2014 14:33:41 -0400 Subject: [PATCH 407/998] add: Make it more obvious that add() doesn't mutate Fixes gh-565 Closes gh-566 --- entries/add.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/add.xml b/entries/add.xml index 1bd30426..04b4a3bc 100644 --- a/entries/add.xml +++ b/entries/add.xml @@ -34,7 +34,7 @@ The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. - Add elements to the set of matched elements. + Create a new jQuery object with elements added to the set of matched elements.

      Given a jQuery object that represents a set of DOM elements, the .add() method constructs a new jQuery object from the union of those elements and the ones passed into the method. The argument to .add() can be pretty much anything that $() accepts, including a jQuery selector expression, references to DOM elements, or an HTML snippet.

      Do not assume that this method appends the elements to the existing collection in the order they are passed to the .add() method. When all elements are members of the same document, the resulting collection from .add() will be sorted in document order; that is, in order of each element's appearance in the document. If the collection consists of elements from different documents or ones not in any document, the sort order is undefined. To create a jQuery object with elements in a well-defined order and without sorting overhead, use the $(array_of_DOM_elements) signature.

      From 72035197dcd1fc10004f556919a296b806546f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 1 Oct 2014 08:04:07 -0400 Subject: [PATCH 408/998] 1.11.23 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b998f3f..31fe4466 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": "1.11.22", + "version": "1.11.23", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 4b2558184e561cc9bd7bb817cd4720e4dbaef02f Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 3 Oct 2014 08:44:38 -0400 Subject: [PATCH 409/998] jQuery.each(): Add note about length prop in objects. * Fixes #473. Closes #527. --- entries/jQuery.each.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index f8ab8a64..67fe70cc 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -26,6 +26,7 @@ A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

      The $.each() function is not the same as $(selector).each(), which is used to iterate, exclusively, over a jQuery object. The $.each() function can be used to iterate over any collection, whether it is an object or an array. In the case of an array, the callback is passed an array index and a corresponding array value each time. (The value can also be accessed through the this keyword, but Javascript will always wrap the this value as an Object even if it is a simple string or number value.) The method returns its first argument, the object that was iterated.

      +

      Note: The $.each() function internally retrieves and uses the length property of the passed collection. So, if the collection has a property called length — e.g. {bar: 'foo', length: 10} — the function might not work as expected.

      
       $.each([ 52, 97 ], function( index, value ) {
         alert( index + ": " + value );
      
      From aad41f24fc7f33edcb89fb3e4aa4bd681209bb4f Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Fri, 3 Oct 2014 08:52:08 -0400
      Subject: [PATCH 410/998] data(): Add description of camel-case-to-dash
       conversion.
      
      * Fixes #427. Closes #534.
      ---
       entries/data.xml | 7 ++++---
       1 file changed, 4 insertions(+), 3 deletions(-)
      
      diff --git a/entries/data.xml b/entries/data.xml
      index 67fa35be..bdd69604 100644
      --- a/entries/data.xml
      +++ b/entries/data.xml
      @@ -101,10 +101,11 @@ $( "div" ).data( "lastValue" ) === 43;
       $( "div" ).data( "hidden" ) === true;
       $( "div" ).data( "options" ).name === "John";
             
      +

      The second statement of the code above correctly refers to the data-last-value attribute of the element. In case no data is stored with the passed key, jQuery searches among the attributes of the element, converting a camel-cased string into a dashed string and then prepending data- to the result. So, the string lastValue is converted to data-last-value.

      Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

      -

      When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

      -

      To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

      -

      The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

      +

      When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

      +

      To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

      +

      The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

      Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

      
       var mydata = $( "#mydiv" ).data();
      
      From 4d5f1fca836a941d7eac1ceb7355409919ba7df2 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Fri, 3 Oct 2014 08:53:15 -0400
      Subject: [PATCH 411/998] 1.11.24
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index 31fe4466..647df5a9 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": "1.11.23",
      +  "version": "1.11.24",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation (https://jquery.org/)"
      
      From ad3e554b097253e4acbca3db1dc2db5b97544472 Mon Sep 17 00:00:00 2001
      From: Usman Akeju 
      Date: Fri, 3 Oct 2014 10:20:53 -0400
      Subject: [PATCH 412/998] jQuery.support(): Mark as deprecated as of version
       1.9
      
      ---
       categories.xml             | 5 +++++
       entries/jQuery.support.xml | 3 ++-
       2 files changed, 7 insertions(+), 1 deletion(-)
      
      diff --git a/categories.xml b/categories.xml
      index 8db3b46b..40a34dd9 100644
      --- a/categories.xml
      +++ b/categories.xml
      @@ -56,6 +56,11 @@
               

      For more information, see the Release Notes/Changelog at http://blog.jquery.com/2012/08/09/jquery-1-8-released/

      ]]> + + + Date: Sun, 5 Oct 2014 21:57:26 -0400 Subject: [PATCH 414/998] jQuery.Deferred(): Change "Deferred-compatible" to "Promise-compatible". Thanks @AurelioDeRosa. Fixes #567. --- entries/jQuery.Deferred.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.Deferred.xml b/entries/jQuery.Deferred.xml index 5bf4ca60..fa9455c0 100644 --- a/entries/jQuery.Deferred.xml +++ b/entries/jQuery.Deferred.xml @@ -25,7 +25,7 @@

      In JavaScript it is common to invoke functions that optionally accept callbacks that are called within that function. For example, in versions prior to jQuery 1.5, asynchronous processes such as jQuery.ajax() accept callbacks to be invoked some time in the near-future upon success, error, and completion of the ajax request.

      jQuery.Deferred() introduces several enhancements to the way callbacks are managed and invoked. In particular, jQuery.Deferred() provides flexible ways to provide multiple callbacks, and these callbacks can be invoked regardless of whether the original callback dispatch has already occurred. jQuery Deferred is based on the CommonJS Promises/A design.

      One model for understanding Deferred is to think of it as a chain-aware function wrapper. The deferred.then(), deferred.always(), deferred.done(), and deferred.fail() methods specify the functions to be called and the deferred.resolve(args) or deferred.reject(args) methods "call" the functions with the arguments you supply. Once the Deferred has been resolved or rejected it stays in that state; a second call to deferred.resolve(), for example, is ignored. If more functions are added by deferred.then(), for example, after the Deferred is resolved, they are called immediately with the arguments previously provided.

      -

      In most cases where a jQuery API call returns a Deferred or Deferred-compatible object, such as jQuery.ajax() or jQuery.when(), you will only want to use the deferred.then(), deferred.done(), and deferred.fail() methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke deferred.resolve() or deferred.reject() on the deferred at some point, causing the appropriate callbacks to run.

      +

      In most cases where a jQuery API call returns a Deferred or Promise-compatible object, such as jQuery.ajax() or jQuery.when(), you will only want to use the deferred.then(), deferred.done(), and deferred.fail() methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke deferred.resolve() or deferred.reject() on the deferred at some point, causing the appropriate callbacks to run.

      From 4b45436b4948a891f2a009d565dde7995c0dca27 Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Mon, 6 Oct 2014 08:17:06 -0400 Subject: [PATCH 415/998] jQuery.parseJSON: Function has multiple return types, not just Object. Closes #490 --- entries/jQuery.parseJSON.xml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index 1f13da91..bc9dcc78 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -1,5 +1,10 @@ - + + + + + + jQuery.parseJSON() 1.4.1 @@ -7,16 +12,20 @@ The JSON string to parse. - Takes a well-formed JSON string and returns the resulting JavaScript object. + Takes a well-formed JSON string and returns the resulting JavaScript value. -

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

      +

      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).
      • -
      • {'test': 1} ('test' is using single quotes instead of double quotes).
      • +
      • "{test: 1}" (test does not have double quotes around it).
      • +
      • "{'test': 1}" ('test' is using single quotes instead of double quotes).
      • +
      • "'test'" ('test' is using single quotes instead of double quotes).
      • +
      • ".1" (a number must start with a digit; "0.1" would be valid).
      • +
      • "undefined" (undefined cannot be represented in a JSON string; null, however, can be).
      • +
      • "NaN" (NaN cannot be represented in a JSON string; direct representation of Infinity is also not permitted).

      The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

      Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

      -

      Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

      +

      Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

      Parse a JSON string. From edbc98ab58a9c81643ee96768dcc64f42f4423e7 Mon Sep 17 00:00:00 2001 From: Usman Akeju Date: Mon, 6 Oct 2014 08:54:26 -0400 Subject: [PATCH 416/998] jQuery.ajax: callback and signatures should use Anything type. Closes #492 --- entries/jQuery.ajax.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index fd4d1878..93e8aaaa 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -67,8 +67,8 @@ $.ajax({ - - A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + + A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: @@ -130,10 +130,10 @@ $.ajax({ - + - A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. From 5f7fa2b79009cf4ef9ca4b736f63ee142c6c75b8 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Mon, 6 Oct 2014 08:57:00 -0400 Subject: [PATCH 417/998] 1.11.26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 19334aca..f93bcb3f 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": "1.11.25", + "version": "1.11.26", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From bdb9c9360e03edf4cfaf09cb25728933dbf6d90c Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Oct 2014 21:45:24 +0200 Subject: [PATCH 418/998] README: Link to Github Issues instead of bugs.jquery.com Closes gh-571 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c25bb24..e33d9099 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Referencing Bug Tracker Tickets -* Pull requests for changes that were requested or recommended via the [jQuery Bug Tracker](http://bugs.jquery.com) should include a link back to the relevant ticket. +* Pull requests for changes that were requested or recommended via the [jQuery Issue Tracker](https://github.com/jquery/jquery/issues) should include a link back to the relevant ticket. ## Building From c21b7879e89e24673e9047371dc2d484b03976e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Fri, 17 Oct 2014 12:11:04 -0400 Subject: [PATCH 419/998] Types: Add entry for QUnit's Assert type Ref jquery/api.qunitjs.com#58 --- pages/Types.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index e30e97e2..4e49174b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -639,3 +639,5 @@

      Callbacks Object

      A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

      XML Document

      A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

      +

      Assert

      +

      A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

      From 55cb98ca3d5cfca59728eb927596f24357a50bd5 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 18 Oct 2014 12:27:25 -0400 Subject: [PATCH 420/998] has-attribute selector: Make use of ".one()" explicit for example --- entries/has-attribute-selector.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entries/has-attribute-selector.xml b/entries/has-attribute-selector.xml index facceca4..1bd8b4d8 100644 --- a/entries/has-attribute-selector.xml +++ b/entries/has-attribute-selector.xml @@ -11,8 +11,10 @@ Selects elements that have the specified attribute, with any value. - Bind a single click that adds the div id to its text. + Bind a single click to divs with an id that adds the id to the div's text. Date: Sat, 18 Oct 2014 12:33:41 -0400 Subject: [PATCH 421/998] 1.11.27 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f93bcb3f..b14fda16 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": "1.11.26", + "version": "1.11.27", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From c881b2bf3fbcd462582d89423386ec137f910735 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 29 Oct 2014 21:20:01 -0400 Subject: [PATCH 422/998] before(), after(): Document new callback signature since jQuery version 1.10 Closes gh-580 --- entries/after.xml | 14 +++++++++++++- entries/before.xml | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index 8e57cdac..f6c52bf4 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -23,13 +23,25 @@ A function that returns an HTML string, DOM element(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 as an argument. Within the function, this refers to the current element in the set. - + + + 1.10 + + A function that returns an HTML string, DOM element(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. + + + + + + + + Insert content, specified by the parameter, after each element in the set of matched elements. diff --git a/entries/before.xml b/entries/before.xml index 7c2ebb7b..5d1bc1aa 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -22,7 +22,6 @@ 1.4 - @@ -31,6 +30,20 @@ A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + + + 1.10 + + + + + + + + + A function that returns an HTML string, DOM element(s), or jQuery object to insert before 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. + + Insert content, specified by the parameter, before each element in the set of matched elements. From 18285f27fd5a27e5bde93f55c7eb802b90e6b6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rn=20Zaefferer?= Date: Wed, 29 Oct 2014 21:27:46 -0400 Subject: [PATCH 423/998] Types: Add assert to ToC Closes gh-582 --- package.json | 2 +- pages/Types.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b14fda16..a2e9bf1c 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": "1.11.27", + "version": "1.11.28", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" diff --git a/pages/Types.html b/pages/Types.html index 4e49174b..c2b9d219 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -94,6 +94,7 @@
    • Promise Object
    • Callbacks Object
    • XML Document
    • +
    • Qunit's Assert Object
    • Anything

      From a30e119728abe17d7f921c54d6061652c4042ebf Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Wed, 29 Oct 2014 21:28:34 -0400 Subject: [PATCH 424/998] 1.11.29 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2e9bf1c..1655c634 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": "1.11.28", + "version": "1.11.29", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 44fb8212e00dc2f0afaa9f377351b249fada84b8 Mon Sep 17 00:00:00 2001 From: Omar Meky Date: Thu, 30 Oct 2014 08:42:46 -0400 Subject: [PATCH 425/998] jQuery.ajax(): Removed repeated sentence Closes gh-576 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 93e8aaaa..7f8b7d3b 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -294,7 +294,7 @@ jqxhr.always(function() {

      By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.

      The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

      Advanced Options

      -

      The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details. See the descriptions of these methods below for more details.

      +

      The global option prevents handlers registered using .ajaxSend(), .ajaxError(), and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with .ajaxSend() if the requests are frequent and brief. With cross-domain script and JSONP requests, the global option is automatically set to false. See the descriptions of these methods below for more details.

      If the server performs HTTP authentication before providing a response, the user name and password pair can be sent via the username and password options.

      Ajax requests are time-limited, so errors can be caught and handled to provide a better user experience. Request timeouts are usually either left at their default or set as a global default using $.ajaxSetup() rather than being overridden for specific requests with the timeout option.

      By default, requests are always issued, but the browser may serve results out of its cache. To disallow use of the cached results, set cache to false. To cause the request to report failure if the asset has not been modified since the last request, set ifModified to true.

      From 20095344621e719519c7943f1209ae33d53d600a Mon Sep 17 00:00:00 2001 From: phistuck Date: Thu, 30 Oct 2014 08:56:28 -0400 Subject: [PATCH 426/998] .trigger(): invoking the on(event-type) property of an object note that calling .trigger(event-type) on an object invokes the on(event-type) property of that object Closes gh-509 --- entries/trigger.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/trigger.xml b/entries/trigger.xml index 6a1f1288..a377c0f5 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -45,6 +45,7 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );

      Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

      The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

      Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      +
      Note: As with .triggerHandler(), when calling .trigger() with an event name matches the name of a property on the object, prefixed by on (e.g. triggering click on window that has a non null onclick method), jQuery will attempt to invoke that property as a method.
      Clicks to button #2 also trigger a click for button #1. From 98b2b386a6c861e800b45cae19fe1e3f04975ae5 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Fri, 31 Oct 2014 10:05:13 -0400 Subject: [PATCH 427/998] 1.11.30 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1655c634..63e25860 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": "1.11.29", + "version": "1.11.30", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From d70ba7556380e9a8090da0879e4c21b5837cfe44 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 4 Nov 2014 08:13:25 -0500 Subject: [PATCH 428/998] after(): Remove section regarding disconnected DOM nodes Fixes gh-559 --- entries/after.xml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index f6c52bf4..0fc251d3 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -26,7 +26,7 @@ - +
      @@ -80,25 +80,6 @@ $( ".container" ).after( $( "h2" ) ); <h2>Greetings</h2>

      Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

      -

      Inserting Disconnected DOM nodes

      -

      As of jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes. For example, given the following code:

      -
      $( "<div></div>" ).after( "<p></p>" );
      -

      The result is a jQuery set containing a div and a paragraph, in that order. That set can be further manipulated, even before it is inserted in the document.

      -
      
      -$( "<div></div>" )
      -  .after( "<p></p>" )
      -  .addClass( "foo" )
      -  .filter( "p" )
      -    .attr( "id", "bar" )
      -    .html( "hello" )
      -  .end()
      -  .appendTo( "body" );
      -    
      -

      This results in the following elements inserted just before the closing </body> tag:

      -
      
      -<div class="foo"></div>
      -<p class="foo" id="bar">hello</p>
      -    

      Passing a Function

      As of jQuery 1.4, .after() supports passing a function that returns the elements to insert.

      
      
      From 8b4faabb8445debc34d0dc9fc973f3df133812e8 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Tue, 4 Nov 2014 08:51:39 -0500
      Subject: [PATCH 429/998] after(): Improve first paragraph of long description
      
      ---
       entries/after.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/after.xml b/entries/after.xml
      index 0fc251d3..1e195510 100644
      --- a/entries/after.xml
      +++ b/entries/after.xml
      @@ -45,7 +45,7 @@
         
         Insert content, specified by the parameter, after each element in the set of matched elements.
         
      -    

      The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

      +

      The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .after(), the content to be inserted comes from the method's argument: $(target).after(contentToBeInserted). With .insertAfter(), on the other hand, the content precedes the method and is inserted after the target, which in turn is passed as the .insertAfter() method's argument: $(contentToBeInserted).insertAfter(target).

      Using the following HTML:

      
       <div class="container">
      
      From 76a2669570bea9bf10473afc6c1503d6432a0f96 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Tue, 4 Nov 2014 09:19:58 -0500
      Subject: [PATCH 430/998] before(): Remove note about disconnected DOM nodes
       and improve some wording.
      
      Refs gh-559
      ---
       entries/before.xml | 11 +++--------
       1 file changed, 3 insertions(+), 8 deletions(-)
      
      diff --git a/entries/before.xml b/entries/before.xml
      index 5d1bc1aa..cba817a9 100644
      --- a/entries/before.xml
      +++ b/entries/before.xml
      @@ -25,8 +25,8 @@
             
               
               
      -                
      -            
      +        
      +      
             A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
             
           
      @@ -47,7 +47,7 @@
         
         Insert content, specified by the parameter, before each element in the set of matched elements.
         
      -    

      The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .before(), the selector expression preceding the method is the container before which the content is inserted. With .insertBefore(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted before the target container.

      +

      The .before() and .insertBefore() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .before(), the content to be inserted comes from the method's argument: $(target).before(contentToBeInserted). With .insertBefore(), on the other hand, the content precedes the method and is inserted before the target, which in turn is passed as the .insertBefore() method's argument: $(contentToBeInserted).insertBefore(target).

      Consider the following HTML:

      
       <div class="container">
      @@ -83,11 +83,6 @@ $( ".container" ).before( $( "h2" ) );
       </div>
           

      Important: If there is more than one target element, however, cloned copies of the inserted element will be created for each target except for the last one.

      -

      In jQuery 1.4, .before() and .after() will also work on disconnected DOM nodes:

      -
      
      -$( "<div>" ).before( "<p></p>" );
      -    
      -

      The result is a jQuery set that contains a paragraph and a div (in that order).

      Additional Arguments

      Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

      For example, the following will insert two new <div>s and an existing <div> before the first paragraph:

      From ced7160e8500b750b54500b0b6f91f9f1dd3e269 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 4 Nov 2014 09:23:14 -0500 Subject: [PATCH 431/998] 1.11.31 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63e25860..adda6fa7 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": "1.11.30", + "version": "1.11.31", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From f9531d8233b465657dc85998dc1951e93faa79c7 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 6 Nov 2014 08:20:41 -0500 Subject: [PATCH 432/998] jQuery.getScript: Fix external link to jquery-color. Point the link to the file on code.jquery.com, not GitHub. Fixes #583. --- 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 488b4525..7579f713 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -94,7 +94,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: Thu, 6 Nov 2014 11:42:08 -0500 Subject: [PATCH 434/998] jQuery.getScript: Change jquery-color script reference to latest stable. Refs gh-583 Refs gh-584 --- entries/jQuery.getScript.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index 7579f713..d942a51c 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -9,7 +9,7 @@ - + A callback function that is executed if the request succeeds. @@ -94,7 +94,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: Thu, 13 Nov 2014 22:11:07 -0500 Subject: [PATCH 436/998] Remove prevValue from copied properties prevValue was never copied, not sure how it got onto this list. --- categories.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/categories.xml b/categories.xml index 40a34dd9..d89d5580 100644 --- a/categories.xml +++ b/categories.xml @@ -143,7 +143,7 @@ jQuery( "body" ).trigger( e );

    The following properties are also copied to the event object, though some of their values may be undefined depending on the event:

    -

    altKey, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, prevValue, relatedTarget, screenX, screenY, shiftKey, target, view, which

    +

    altKey, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, view, which

    OtherProperties

    Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

    Example:

    @@ -406,7 +406,7 @@ jQuery.event.props.push( "dataTransfer" );

    For more information, see the Release Notes/Changelog at http://blog.jquery.com/2012/08/09/jquery-1-8-released/


    ]]> - + p For more information, see the Release Notes/Changelog at http://blog.jquery.com/2012/08/09/jquery-1-8-released/


    ]]>
    -
    p +

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

    -
    
    -$( ".result" ).html( "<p>Lorem ipsum dolor sit amet.</p>" );
    -    

    Scripts are included and run by referencing the file name:

    
     $.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {
    
    From 5c84fb5c49731dab4c1cf6a45a6b9a167f0a9895 Mon Sep 17 00:00:00 2001
    From: Chris Rebert 
    Date: Sat, 15 Nov 2014 11:42:04 -0500
    Subject: [PATCH 439/998] :text selector: Clarify that it is for s, not
     DOM text nodes
    
    Closes gh-587
    ---
     entries/text-selector.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/text-selector.xml b/entries/text-selector.xml
    index b6fbb228..9af4dc44 100644
    --- a/entries/text-selector.xml
    +++ b/entries/text-selector.xml
    @@ -5,7 +5,7 @@
       
         1.0
       
    -  Selects all elements of type text.
    +  Selects all input elements of type text.
       
         

    $( ":text" ) allows us to select all <input type="text"> elements. As with other pseudo-class selectors (those that begin with a ":") it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ( "*" ) is implied. In other words, the bare $( ":text" ) is equivalent to $( "*:text" ), so $( "input:text" ) should be used instead.

    Note: As of jQuery 1.5.2, :text selects input elements that have no specified type attribute (in which case type="text" is implied).

    From 444039c491992338ba50b8bed7675d8c5f31202c Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 15 Nov 2014 11:44:10 -0500 Subject: [PATCH 440/998] 1.11.34 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d0f1cb0..9ed57519 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": "1.11.33", + "version": "1.11.34", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From 1029bf307dfe53468994c522eee342e6291d6056 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 18 Nov 2014 13:05:21 -0500 Subject: [PATCH 441/998] live(): The parameter is optional. Closes gh-589. --- entries/live.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/live.xml b/entries/live.xml index 95f9d5d8..049322e2 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -17,7 +17,7 @@ A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names. - + An object containing data that will be passed to the event handler. From bf15a22f2926e92b9dc2bf6d01c897d797ac9284 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 18 Nov 2014 13:08:12 -0500 Subject: [PATCH 442/998] triggerHandler(): Add plainObject type to extraParameters argument Closes gh-590 --- entries/triggerHandler.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index df6fb8af..2167142e 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -7,8 +7,10 @@ A string containing a JavaScript event type, such as click or submit. - - An array of additional parameters to pass along to the event handler. + + + + Additional parameters to pass along to the event handler. From 4e8e8dcb7773004bda308dd9e57ff8b86f342766 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 18 Nov 2014 13:08:52 -0500 Subject: [PATCH 443/998] 1.11.35 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ed57519..ea892b16 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": "1.11.34", + "version": "1.11.35", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation (https://jquery.org/)" From a3cc9b422c5c245a1f334f65de82275dda048084 Mon Sep 17 00:00:00 2001 From: tym-network Date: Wed, 19 Nov 2014 08:27:14 -0500 Subject: [PATCH 444/998] contents(): Add a missing space Closes gh-591 --- entries/contents.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/contents.xml b/entries/contents.xml index 833aea25..d10defc0 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -6,7 +6,7 @@ Get the children of each element in the set of matched elements, including text and comment nodes. -

    Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search throughthe immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes as well as HTML elements in the resulting jQuery object.

    +

    Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes as well as HTML elements in the resulting jQuery object.

    The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

    Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br>):

    
    
    From f0466fb5fc4fcd686e608f1b47aaeb5d467aacf2 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Tue, 2 Dec 2014 09:50:19 -0500
    Subject: [PATCH 445/998] removeProp: Fix errors in code example
    
    Fixes #604
    ---
     entries/removeProp.xml | 9 +++++----
     1 file changed, 5 insertions(+), 4 deletions(-)
    
    diff --git a/entries/removeProp.xml b/entries/removeProp.xml
    index 0f4b7790..987ab339 100644
    --- a/entries/removeProp.xml
    +++ b/entries/removeProp.xml
    @@ -17,11 +17,12 @@
       
         Set a numeric property on a paragraph and then remove it. 
         
         
    Date: Tue, 2 Dec 2014 15:57:59 -0500
    Subject: [PATCH 447/998] Build: Replace grunt-clean with rimraf
    
    ---
     grunt.js     | 10 ++++++----
     package.json |  4 ++--
     2 files changed, 8 insertions(+), 6 deletions(-)
    
    diff --git a/grunt.js b/grunt.js
    index ea16b469..0be80090 100644
    --- a/grunt.js
    +++ b/grunt.js
    @@ -1,18 +1,16 @@
    +var rimraf = require( "rimraf" );
    +
     /*jshint node:true */
     module.exports = function( grunt ) {
     "use strict";
     
     var entryFiles = grunt.file.expandFiles( "entries/*.xml" );
     
    -grunt.loadNpmTasks( "grunt-clean" );
     grunt.loadNpmTasks( "grunt-wordpress" );
     grunt.loadNpmTasks( "grunt-jquery-content" );
     grunt.loadNpmTasks( "grunt-check-modules" );
     
     grunt.initConfig({
    -	clean: {
    -		folder: "dist"
    -	},
     	lint: {
     		grunt: "grunt.js"
     	},
    @@ -36,6 +34,10 @@ grunt.initConfig({
     	}, grunt.file.readJSON( "config.json" ) )
     });
     
    +grunt.registerTask( "clean", function() {
    +	rimraf.sync( "dist" );
    +});
    +
     grunt.registerTask( "default", "build-wordpress" );
     grunt.registerTask( "build", "build-pages build-xml-entries build-xml-categories build-xml-full build-resources" );
     grunt.registerTask( "build-wordpress", "check-modules clean lint xmllint build" );
    diff --git a/package.json b/package.json
    index 43f1c399..f421d5ad 100644
    --- a/package.json
    +++ b/package.json
    @@ -22,10 +22,10 @@
       ],
       "dependencies": {
         "grunt": "0.3.17",
    -    "grunt-clean": "0.3.0",
         "grunt-wordpress": "1.2.1",
         "grunt-jquery-content": "0.13.0",
    -    "grunt-check-modules": "0.1.0"
    +    "grunt-check-modules": "0.1.0",
    +    "rimraf": "2.2.8"
       },
       "devDependencies": {},
       "keywords": []
    
    From f0afafb380377f537a0fc7b412081c23ac4d7a52 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Tue, 2 Dec 2014 16:00:41 -0500
    Subject: [PATCH 448/998] Build: Remove unused tasks
    
    ---
     grunt.js | 16 +++-------------
     1 file changed, 3 insertions(+), 13 deletions(-)
    
    diff --git a/grunt.js b/grunt.js
    index 0be80090..dbe79fd3 100644
    --- a/grunt.js
    +++ b/grunt.js
    @@ -1,25 +1,17 @@
     var rimraf = require( "rimraf" );
     
    -/*jshint node:true */
     module.exports = function( grunt ) {
    -"use strict";
     
     var entryFiles = grunt.file.expandFiles( "entries/*.xml" );
     
    -grunt.loadNpmTasks( "grunt-wordpress" );
    -grunt.loadNpmTasks( "grunt-jquery-content" );
     grunt.loadNpmTasks( "grunt-check-modules" );
    +grunt.loadNpmTasks( "grunt-jquery-content" );
    +grunt.loadNpmTasks( "grunt-wordpress" );
     
     grunt.initConfig({
    -	lint: {
    -		grunt: "grunt.js"
    -	},
     	xmllint: {
     		all: [].concat( entryFiles, "categories.xml", "entries2html.xsl", "notes.xsl" )
     	},
    -	xmltidy: {
    -		all: [].concat( entryFiles, "categories.xml" )
    -	},
     	"build-pages": {
     		all: grunt.file.expandFiles( "pages/**" )
     	},
    @@ -38,9 +30,7 @@ grunt.registerTask( "clean", function() {
     	rimraf.sync( "dist" );
     });
     
    -grunt.registerTask( "default", "build-wordpress" );
     grunt.registerTask( "build", "build-pages build-xml-entries build-xml-categories build-xml-full build-resources" );
    -grunt.registerTask( "build-wordpress", "check-modules clean lint xmllint build" );
    -grunt.registerTask( "tidy", "xmllint xmltidy" );
    +grunt.registerTask( "build-wordpress", "check-modules clean xmllint build" );
     
     };
    
    From 04f42c47bfa8a3236b76dd69a332359384a1a4b5 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Tue, 2 Dec 2014 16:06:50 -0500
    Subject: [PATCH 449/998] README: Cleanup
    
    ---
     README.md | 15 ++++++---------
     1 file changed, 6 insertions(+), 9 deletions(-)
    
    diff --git a/README.md b/README.md
    index e33d9099..67260550 100644
    --- a/README.md
    +++ b/README.md
    @@ -1,18 +1,15 @@
    -## Referencing Bug Tracker Tickets
    +# api.jquery.com
     
    -* Pull requests for changes that were requested or recommended via the [jQuery Issue Tracker](https://github.com/jquery/jquery/issues) should include a link back to the relevant ticket.
    +## Building and Deploying
     
    -## Building
    +To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
     
     ### Requirements
    -* libxml2
    -* libxslt
     
    -The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com.
    +* [libxml2](http://xmlsoft.org/)
    +* [libxslt](http://xmlsoft.org/libxslt/)
     
    -### Build
    -
    -To build and deploy your changes for previewing in a [jquery-wp-content](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
    +The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from GnuWin32.
     
     ## Style Guidelines
     
    
    From 1af30ac254c825907de2cbeb9a1f0f28fe8cc24e Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Tue, 2 Dec 2014 20:03:07 -0500
    Subject: [PATCH 450/998] jQuery.ajax: Remove warning about PUT and DELETE
    
    Fixes gh-412
    ---
     entries/jQuery.ajax.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index 7f8b7d3b..94e223cc 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -142,7 +142,7 @@ $.ajax({
             Set this to true if you wish to use the traditional style of param serialization.
           
           
    -        The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
    +        The type of request to make (e.g. "POST", "GET", "PUT"); default is "GET". 
           
           
              A string containing the URL to which the request is sent.
    
    From c797af05d9ecb509f1b829642abe2fb20a28fc1b Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Tue, 2 Dec 2014 20:14:09 -0500
    Subject: [PATCH 451/998] 1.11.37
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index f421d5ad..db8831d3 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": "1.11.36",
    +  "version": "1.11.37",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation (https://jquery.org/)"
    
    From d39fb3dcba61ef3f56ba3a0e82c4143ee3427cfa Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Fri, 5 Dec 2014 09:00:06 -0500
    Subject: [PATCH 452/998] Build: Upgrade to Grunt 0.4.5
    
    * Upgrade to grunt-check-modules 0.2.0
    * Upgrade to grunt-jquery-content 1.0.0
    ---
     .gitignore   | 13 +++----------
     Gruntfile.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
     grunt.js     | 36 -----------------------------------
     package.json |  7 +++----
     4 files changed, 59 insertions(+), 50 deletions(-)
     create mode 100644 Gruntfile.js
     delete mode 100644 grunt.js
    
    diff --git a/.gitignore b/.gitignore
    index 2dc8b339..633f1bde 100644
    --- a/.gitignore
    +++ b/.gitignore
    @@ -1,10 +1,3 @@
    -dist
    -entries_tmp
    -node_modules
    -config.json
    -.project
    -*~
    -*.diff
    -*.patch
    -.DS_Store
    -.settings
    \ No newline at end of file
    +/dist/
    +/node_modules/
    +config.js*
    diff --git a/Gruntfile.js b/Gruntfile.js
    new file mode 100644
    index 00000000..f6bc20df
    --- /dev/null
    +++ b/Gruntfile.js
    @@ -0,0 +1,53 @@
    +var rimraf = require( "rimraf" );
    +
    +module.exports = function( grunt ) {
    +
    +grunt.loadNpmTasks( "grunt-check-modules" );
    +grunt.loadNpmTasks( "grunt-jquery-content" );
    +
    +grunt.initConfig({
    +	xmllint: {
    +		all: [
    +			"entries/**",
    +			"includes/**",
    +			"categories.xml",
    +			"entries2html.xsl",
    +			"notes.xsl"
    +		]
    +	},
    +	"build-pages": {
    +		all: "pages/**"
    +	},
    +	"build-xml-entries": {
    +		all: "entries/**"
    +	},
    +	"build-resources": {
    +		all: "resources/**"
    +	},
    +	wordpress: (function() {
    +		var config = require( "./config" );
    +		config.dir = "dist/wordpress";
    +		return config;
    +	})()
    +});
    +
    +grunt.registerTask( "clean", function() {
    +	rimraf.sync( "dist" );
    +});
    +
    +grunt.registerTask( "build", [
    +	"build-pages",
    +	"build-resources",
    +	"build-xml-entries",
    +	"build-xml-categories",
    +	"build-xml-full"
    +]);
    +
    +grunt.registerTask( "build-wordpress", [
    +	"check-modules",
    +	"xmllint",
    +	"clean",
    +	"build"
    +]);
    +
    +};
    diff --git a/grunt.js b/grunt.js
    deleted file mode 100644
    index dbe79fd3..00000000
    --- a/grunt.js
    +++ /dev/null
    @@ -1,36 +0,0 @@
    -var rimraf = require( "rimraf" );
    -
    -module.exports = function( grunt ) {
    -
    -var entryFiles = grunt.file.expandFiles( "entries/*.xml" );
    -
    -grunt.loadNpmTasks( "grunt-check-modules" );
    -grunt.loadNpmTasks( "grunt-jquery-content" );
    -grunt.loadNpmTasks( "grunt-wordpress" );
    -
    -grunt.initConfig({
    -	xmllint: {
    -		all: [].concat( entryFiles, "categories.xml", "entries2html.xsl", "notes.xsl" )
    -	},
    -	"build-pages": {
    -		all: grunt.file.expandFiles( "pages/**" )
    -	},
    -	"build-xml-entries": {
    -		all: entryFiles
    -	},
    -	"build-resources": {
    -		all: grunt.file.expandFiles( "resources/**" )
    -	},
    -	wordpress: grunt.utils._.extend({
    -		dir: "dist/wordpress"
    -	}, grunt.file.readJSON( "config.json" ) )
    -});
    -
    -grunt.registerTask( "clean", function() {
    -	rimraf.sync( "dist" );
    -});
    -
    -grunt.registerTask( "build", "build-pages build-xml-entries build-xml-categories build-xml-full build-resources" );
    -grunt.registerTask( "build-wordpress", "check-modules clean xmllint build" );
    -
    -};
    diff --git a/package.json b/package.json
    index db8831d3..41f1592d 100644
    --- a/package.json
    +++ b/package.json
    @@ -21,10 +21,9 @@
         }
       ],
       "dependencies": {
    -    "grunt": "0.3.17",
    -    "grunt-wordpress": "1.2.1",
    -    "grunt-jquery-content": "0.13.0",
    -    "grunt-check-modules": "0.1.0",
    +    "grunt": "0.4.5",
    +    "grunt-check-modules": "0.2.0",
    +    "grunt-jquery-content": "1.0.0",
         "rimraf": "2.2.8"
       },
       "devDependencies": {},
    
    From 622226edc7b9b91ba190f54ea88ccffef0c0612c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Fri, 5 Dec 2014 09:04:58 -0500
    Subject: [PATCH 453/998] Build: Remove dates from copyright notice
    
    ---
     LICENSE.txt | 5 ++---
     1 file changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/LICENSE.txt b/LICENSE.txt
    index 01839718..19a9bad2 100644
    --- a/LICENSE.txt
    +++ b/LICENSE.txt
    @@ -1,6 +1,5 @@
    -Copyright 2009 Packt Publishing, http://packtpub.com/
    -Copyright 2012, 2014 jQuery Foundation and other contributors,
    -https://jquery.org/
    +Copyright Packt Publishing (http://packtpub.com/),
    +jQuery Foundation (https://jquery.org/), and other contributors.
     
     This software consists of voluntary contributions made by many
     individuals. For exact contribution history, see the revision history
    
    From 6d2054fc066cb7019be831eff76bd1c05b2270a1 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Fri, 5 Dec 2014 09:05:55 -0500
    Subject: [PATCH 454/998] Build: package.json cleanup
    
    ---
     package.json | 8 +++-----
     1 file changed, 3 insertions(+), 5 deletions(-)
    
    diff --git a/package.json b/package.json
    index 41f1592d..bc682bf5 100644
    --- a/package.json
    +++ b/package.json
    @@ -5,7 +5,7 @@
       "version": "1.11.37",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
    -    "name": "jQuery Foundation (https://jquery.org/)"
    +    "name": "jQuery Foundation and other contributors"
       },
       "repository": {
         "type": "git",
    @@ -17,7 +17,7 @@
       "licenses": [
         {
           "type": "MIT",
    -      "url": "http://www.opensource.org/licenses/MIT"
    +      "url": "https://github.com/jquery/api.jquery.com/blob/master/LICENSE.txt"
         }
       ],
       "dependencies": {
    @@ -25,7 +25,5 @@
         "grunt-check-modules": "0.2.0",
         "grunt-jquery-content": "1.0.0",
         "rimraf": "2.2.8"
    -  },
    -  "devDependencies": {},
    -  "keywords": []
    +  }
     }
    
    From 001d725dba78a4e00d8e1e3a352cb27c41bb7cde Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Fri, 5 Dec 2014 15:12:16 -0500
    Subject: [PATCH 455/998] 1.11.38
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index bc682bf5..258fe004 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": "1.11.37",
    +  "version": "1.11.38",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 82daaa0fded99c2a92fcba1f31b1cf0d9594fae5 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Mon, 8 Dec 2014 12:17:18 -0500
    Subject: [PATCH 456/998] Build: Upgrade to grunt-jquery-content 2.0.0
    
    ---
     Gruntfile.js | 20 ++++----------------
     package.json |  4 +---
     2 files changed, 5 insertions(+), 19 deletions(-)
    
    diff --git a/Gruntfile.js b/Gruntfile.js
    index f6bc20df..cc71e7be 100644
    --- a/Gruntfile.js
    +++ b/Gruntfile.js
    @@ -1,8 +1,5 @@
    -var rimraf = require( "rimraf" );
    -
     module.exports = function( grunt ) {
     
    -grunt.loadNpmTasks( "grunt-check-modules" );
     grunt.loadNpmTasks( "grunt-jquery-content" );
     
     grunt.initConfig({
    @@ -15,8 +12,8 @@ grunt.initConfig({
     			"notes.xsl"
     		]
     	},
    -	"build-pages": {
    -		all: "pages/**"
    +	"build-posts": {
    +		page: "pages/**"
     	},
     	"build-xml-entries": {
     		all: "entries/**"
    @@ -31,23 +28,14 @@ grunt.initConfig({
     	})()
     });
     
    -grunt.registerTask( "clean", function() {
    -	rimraf.sync( "dist" );
    -});
    +grunt.registerTask( "lint", [ "xmllint" ]);
     
     grunt.registerTask( "build", [
    -	"build-pages",
    +	"build-posts",
     	"build-resources",
     	"build-xml-entries",
     	"build-xml-categories",
     	"build-xml-full"
     ]);
     
    -grunt.registerTask( "build-wordpress", [
    -	"check-modules",
    -	"xmllint",
    -	"clean",
    -	"build"
    -]);
    -
     };
    diff --git a/package.json b/package.json
    index 258fe004..9c4b386c 100644
    --- a/package.json
    +++ b/package.json
    @@ -22,8 +22,6 @@
       ],
       "dependencies": {
         "grunt": "0.4.5",
    -    "grunt-check-modules": "0.2.0",
    -    "grunt-jquery-content": "1.0.0",
    -    "rimraf": "2.2.8"
    +    "grunt-jquery-content": "2.0.0"
       }
     }
    
    From 0a5bd237f3c77c7b55efd50ba1b7b5a2d00498db Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= 
    Date: Mon, 8 Dec 2014 12:22:24 -0500
    Subject: [PATCH 457/998] 1.11.39
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 9c4b386c..f955be2e 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": "1.11.38",
    +  "version": "1.11.39",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 5a0192c0a4c89725dd69bb4b67cfb2c91ab68ae7 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sun, 7 Dec 2014 12:12:50 +0100
    Subject: [PATCH 458/998] add: Fix element type
    
    Closes gh-606
    Fixes gh-309
    ---
     entries/add.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/add.xml b/entries/add.xml
    index 04b4a3bc..6f1d7870 100644
    --- a/entries/add.xml
    +++ b/entries/add.xml
    @@ -9,7 +9,7 @@
       
       
         1.0
    -    
    +    
           One or more elements to add to the set of matched elements.
         
       
    
    From 891500f6de5b05748fd633da604561f489dc4f51 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sun, 21 Dec 2014 15:00:18 +0100
    Subject: [PATCH 459/998] toggleClass: rename 'switch' variable
    
    Closes gh-610
    Fixes gh-581
    ---
     entries/toggleClass.xml | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml
    index a4516652..1d034d86 100644
    --- a/entries/toggleClass.xml
    +++ b/entries/toggleClass.xml
    @@ -12,13 +12,13 @@
         
           One or more class names (separated by spaces) to be toggled for each element in the matched set.
         
    -    
    +    
           A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
         
       
       
         1.4
    -    
    +    
           A boolean value to determine whether the class should be added or removed.
         
       
    @@ -27,15 +27,15 @@
         
           
           
    -      
    +      
             
    -      A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
    +      A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments.
         
    -    
    +    
           A boolean value to determine whether the class should be added or removed.
         
       
    -  Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
    +  Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument.
       
         

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    
    
    From e77a192cdc3691596a87a1b50a85babbdb32cce8 Mon Sep 17 00:00:00 2001
    From: Corey Frang 
    Date: Mon, 22 Dec 2014 13:59:58 -0500
    Subject: [PATCH 460/998] jQuery.ajax: Document contentType false
    
    Added Boolean as a type for contentType.
    Added a sentance about what passing false does for contentType
    
    Ref gh-547
    Ref gh-369
    ---
     entries/jQuery.ajax.xml | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index 94e223cc..21463bb8 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -37,8 +37,10 @@
           
             An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type.
           
    -      
    -        When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server.
    +      
    +        
    +        
    +        When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases.  If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent).  As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header.  Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server.
           
           
             This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example,  specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
    
    From eb7611d91dbd93f262a9a8ddb2b8d9573d1c7736 Mon Sep 17 00:00:00 2001
    From: Corey Frang 
    Date: Mon, 22 Dec 2014 14:10:59 -0500
    Subject: [PATCH 461/998] parent: Clarify wording about behavior
    
    Fixes gh-537
    Ref gh-543
    ---
     entries/parent.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/parent.xml b/entries/parent.xml
    index 0fdf5b73..4c375255 100644
    --- a/entries/parent.xml
    +++ b/entries/parent.xml
    @@ -9,8 +9,8 @@
       
       Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
       
    -    

    Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.

    -

    The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $( "html" ).parent() method returns a set containing document whereas $( "html" ).parents() returns an empty set.

    +

    Given a jQuery object that represents a set of DOM elements, the parent() method traverses to the immediate parent of each of these elements in the DOM tree and constructs a new jQuery object from the matching elements.

    +

    This method is similar to .parents(), except .parent() only travels a single level up the DOM tree. Also, $( "html" ).parent() method returns a set containing document whereas $( "html" ).parents() returns an empty set.

    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.

    Consider a page with a basic nested list on it:

    
    
    From 918bdef49502c4e7206f3284f409e47748581227 Mon Sep 17 00:00:00 2001
    From: Corey Frang 
    Date: Mon, 22 Dec 2014 11:11:55 -0500
    Subject: [PATCH 462/998] trigger: add some links to triggerHandler
    
    ---
     entries/trigger.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/trigger.xml b/entries/trigger.xml
    index a377c0f5..c840b058 100644
    --- a/entries/trigger.xml
    +++ b/entries/trigger.xml
    @@ -44,8 +44,8 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );
         

    The event object is always passed as the first parameter to an event handler. An array of arguments can also be passed to the .trigger() call, and these parameters will be passed along to the handler as well following the event object. As of jQuery 1.6.2, single string or numeric argument can be passed without being wrapped in an array.

    Note the difference between the extra parameters passed here and the eventData parameter to the .on() method. Both are mechanisms for passing information to an event handler, but the extraParameters argument to .trigger() allows information to be determined at the time the event is triggered, while the eventData argument to .on() requires the information to be already computed at the time the handler is bound.

    The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

    -
    Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
    -
    Note: As with .triggerHandler(), when calling .trigger() with an event name matches the name of a property on the object, prefixed by on (e.g. triggering click on window that has a non null onclick method), jQuery will attempt to invoke that property as a method.
    +
    Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
    +
    Note: As with .triggerHandler(), when calling .trigger() with an event name matches the name of a property on the object, prefixed by on (e.g. triggering click on window that has a non null onclick method), jQuery will attempt to invoke that property as a method.
    Clicks to button #2 also trigger a click for button #1. From 41fc7513bd8b186bab24483443c1dc5a4faad5d0 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Mon, 22 Dec 2014 11:12:28 -0500 Subject: [PATCH 463/998] triggerHandler: Rephrase description and differences from trigger --- entries/triggerHandler.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index 2167142e..e174311f 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -14,9 +14,9 @@ -

    The .triggerHandler() method behaves similarly to .trigger(), with the following exceptions:

    +

    .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

      -
    • The .triggerHandler() method does not cause the default behavior of an event to occur (such as a form submission).
    • +
    • The .triggerHandler( "event" ) method will not call .event() on the element it is triggered on. This means .triggerHandler( "submit" ) on a form will not call .submit() on the form.
    • While .trigger() will operate on all elements matched by the jQuery object, .triggerHandler() only affects the first matched element.
    • Events triggered with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.
    • Instead of returning the jQuery object (to allow chaining), .triggerHandler() returns whatever value was returned by the last handler it caused to be executed. If no handlers are triggered, it returns undefined
    • From d443d9610abed4a28712602b3b918be25ca0d87e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 6 Oct 2014 02:24:42 +0100 Subject: [PATCH 464/998] deferred.progress: Accepts multiple arguments Closes gh-568 --- entries/deferred.progress.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/entries/deferred.progress.xml b/entries/deferred.progress.xml index fd7635a1..3a827a24 100644 --- a/entries/deferred.progress.xml +++ b/entries/deferred.progress.xml @@ -10,10 +10,17 @@ A function, or array of functions, to be called when the Deferred generates progress notifications. + + + + + Optional additional function, or array of functions, to be called when the Deferred generates progress notifications. + + Add handlers to be called when the Deferred object generates progress notifications. -

      The argument can be either a single function or an array of functions. When the Deferred generates progress notifications by calling notify or notifyWith, the progressCallbacks are called. Since deferred.progress() returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any progressCallbacks added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the .notify() or notifyWith() call. For more information, see the documentation for jQuery.Deferred().

      +

      The deferred.progress() method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred generates progress notifications by calling notify or notifyWith, the progressCallbacks are called. Since deferred.progress() returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any progressCallbacks added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the .notify() or notifyWith() call. For more information, see the documentation for jQuery.Deferred().

      From 0c7e90bc8d00d95d0f9526a8b886e525514a266a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 10 Oct 2014 20:19:27 +0100 Subject: [PATCH 465/998] jQuery.when: Update to "Promise-Compatible" Based on gh-567 the returned value of $.ajax() is actually a Promise-compatible object and not a Promise object. Closes gh-574 Ref gh-567 --- entries/jQuery.when.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index e28819e3..310613e7 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -9,7 +9,7 @@ Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. -

      If a single Deferred is passed to jQuery.when(), its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise and can be used this way:

      +

      If a single Deferred is passed to jQuery.when(), its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise-compatible object and can be used this way:

      
       $.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {
         alert( jqXHR.status ); // Alerts 200
      
      From d2c4f7a2cad3c14b4930a82ce9a680c31cb73a83 Mon Sep 17 00:00:00 2001
      From: Arthur Verschaeve 
      Date: Fri, 2 Jan 2015 18:25:49 +0100
      Subject: [PATCH 466/998] finish: clarify .finish() defaults to .finish("fx")
      
      Closes gh-615
      Fixes gh-464
      ---
       entries/finish.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/finish.xml b/entries/finish.xml
      index 96975750..506d53f2 100644
      --- a/entries/finish.xml
      +++ b/entries/finish.xml
      @@ -4,7 +4,7 @@
         Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
         
           1.9
      -    
      +    
             The name of the queue in which to stop animations.
           
         
      
      From a6b3b6ffcb6e6366fd1dfc92d43950f74647a987 Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Sun, 11 Jan 2015 20:12:10 -0500
      Subject: [PATCH 467/998] jQuery.getJSON: Update data argument. Can take
       string.
      
      ---
       entries/jQuery.getJSON.xml | 4 +++-
       1 file changed, 3 insertions(+), 1 deletion(-)
      
      diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
      index 1485a2a2..97c8b0a9 100644
      --- a/entries/jQuery.getJSON.xml
      +++ b/entries/jQuery.getJSON.xml
      @@ -6,7 +6,9 @@
           
             A string containing the URL to which the request is sent.
           
      -    
      +    
      +      
      +      
             A plain object or string that is sent to the server with the request.
           
           
      
      From 4730880526de7b8fc3e9cf76803a6716105b3bb5 Mon Sep 17 00:00:00 2001
      From: Karl Swedberg 
      Date: Sun, 11 Jan 2015 21:21:06 -0500
      Subject: [PATCH 468/998] 1.11.40
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index f955be2e..6c608d92 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": "1.11.39",
      +  "version": "1.11.40",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation and other contributors"
      
      From 1373b93d9bdf774782c6c14d0522ab0933498ce5 Mon Sep 17 00:00:00 2001
      From: Arthur Verschaeve 
      Date: Thu, 15 Jan 2015 07:15:31 +0100
      Subject: [PATCH 469/998] attr: move parenthesis outside code element
      
      Closes gh-612
      ---
       entries/attr.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/attr.xml b/entries/attr.xml
      index 3e181e67..f0f1408b 100644
      --- a/entries/attr.xml
      +++ b/entries/attr.xml
      @@ -206,7 +206,7 @@ $( "#greatphoto" ).attr( "title", function( i, val ) {
       });
             

      This use of a function to compute attribute values can be particularly useful when modifying the attributes of multiple elements at once.

      -

      Note: If nothing is returned in the setter function (ie. function(index, attr){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

      +

      Note: If nothing is returned in the setter function (ie. function(index, attr){}), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

      Set some attributes for all <img>s in the page. From 50ce24477abf3a5156a02296427092c8f6975123 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Sat, 17 Jan 2015 10:23:00 +0000 Subject: [PATCH 470/998] Image-selector: Fix incorrect closing tag Closes gh-626 --- entries/image-selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/image-selector.xml b/entries/image-selector.xml index 461c438c..8af0a351 100644 --- a/entries/image-selector.xml +++ b/entries/image-selector.xml @@ -42,7 +42,7 @@ $( "form" ).submit(function( event ) { From 95a9b6591549cec0e1b07b8ee6baa1d625071262 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 18 Jan 2015 17:38:42 -0500 Subject: [PATCH 471/998] on(): Remove ambiguous information about event handlers on detached DOM elements. Fixes gh-548 --- entries/on.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entries/on.xml b/entries/on.xml index eeab0009..0f2f9474 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -41,18 +41,18 @@

      The majority of browser events bubble, or propagate, from the deepest, innermost element (the event target) in the document where they occur all the way up to the body and the document element. In Internet Explorer 8 and lower, a few events such as change and submit do not natively bubble but jQuery patches these to bubble and create consistent cross-browser behavior.

      If selector is omitted or is null, the event handler is referred to as direct or directly-bound. The handler is called every time an event occurs on the selected elements, whether it occurs directly on the element or bubbles from a descendant (inner) element.

      When a selector is provided, the event handler is referred to as delegated. The handler is not called when the event occurs directly on the bound element, but only for descendants (inner elements) that match the selector. jQuery bubbles the event from the event target up to the element where the handler is attached (i.e., innermost to outermost element) and runs the handler for any elements along that path matching the selector.

      -

      Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on(). To ensure the elements are present and can be selected, perform event binding inside a document ready handler for elements that are in the HTML markup on the page. If new HTML is being injected into the page, select the elements and attach event handlers after the new HTML is placed into the page. Or, use delegated events to attach an event handler, as described next.

      -

      Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

      +

      Event handlers are bound only to the currently selected elements; they must exist at the time your code makes the call to .on(). To ensure the elements are present and can be selected, place scripts after the elements in the HTML markup or perform event binding inside a document ready handler. Alternatively, use delegated events to attach event handlers.

      +

      Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

      In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored. On a data table with 1,000 rows in its tbody, this example attaches a handler to 1,000 elements:

      
       $( "#dataTable tbody tr" ).on( "click", function() {
      -  alert( $( this ).text() );
      +  console.log( $( this ).text() );
       });
           
      -

      A delegated-events approach attaches an event handler to only one element, the tbody, and the event only needs to bubble up one level (from the clicked tr to tbody):

      +

      An event-delegation approach attaches an event handler to only one element, the tbody, and the event only needs to bubble up one level (from the clicked tr to tbody):

      
       $( "#dataTable tbody" ).on( "click", "tr", function() {
      -  alert( $( this ).text() );
      +  console.log( $( this ).text() );
       });
           

      Note: Delegated events do not work for SVG.

      From b19ce2a46f6fccee8b9b8334a3ecc26f2ac30a22 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 18 Jan 2015 17:38:59 -0500 Subject: [PATCH 472/998] 1.11.41 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c608d92..3f4c81e4 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": "1.11.40", + "version": "1.11.41", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1bf56e3d650b398e80f64f189304f50d81cfc996 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Sun, 18 Jan 2015 10:59:59 +0000 Subject: [PATCH 473/998] Submit-selector: Fix indentation for closing style tag Closes gh-627 --- entries/submit-selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/submit-selector.xml b/entries/submit-selector.xml index dfb9ca72..a4c9aa01 100644 --- a/entries/submit-selector.xml +++ b/entries/submit-selector.xml @@ -39,7 +39,7 @@ $( "#exampleTable" ).find( "td" ).each(function( i, el ) { textarea { height: 45px; } - ]]> +]]> Date: Sat, 10 Jan 2015 17:16:10 +0100 Subject: [PATCH 475/998] Data: remove mention to `.data( "events" )` Fixes gh-346 Closes gh-623 --- entries/data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/data.xml b/entries/data.xml index bdd69604..944efa14 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -29,7 +29,7 @@ $( "body" ).data( { baz: [ 1, 2, 3 ] } ); $( "body" ).data( "foo" ); // 52 $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }
    -

    In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element. jQuery itself uses the .data() method to save information under the names 'events' and 'handle', and also reserves any data name starting with an underscore ('_') for internal use.

    +

    In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

    Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

    Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

    From c24d60b33a3a62187addb85731d1eee0bb71e9d6 Mon Sep 17 00:00:00 2001 From: George Mauer Date: Thu, 8 Jan 2015 23:12:52 -0600 Subject: [PATCH 476/998] jQuery.get, jQuery post: add new config object signature Fixes gh-620 Closes gh-622 --- entries/jQuery.get.xml | 6 ++++++ entries/jQuery.post.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 396e58b0..411a5889 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -1,6 +1,12 @@ jQuery.get() + + 3.0 + + 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 POST. + + 1.0 diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index c066cbf4..2300cbe7 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -1,6 +1,12 @@ jQuery.post() + + 3.0 + + 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. + + 1.0 From 12c4d7e52300cb723e6e11aaea401cb8ab0a6d85 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 20 Jan 2015 21:48:12 +0100 Subject: [PATCH 477/998] 1.11.43 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58e7ae6f..4618da73 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": "1.11.42", + "version": "1.11.43", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 7852b046241d2f3f4d571e2f6b534b91b077e0c6 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 22 Jan 2015 05:50:38 +0000 Subject: [PATCH 478/998] nth-last-of-type-selector: correct description Fixes gh-603 Closes gh-629 --- entries/nth-last-of-type-selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/nth-last-of-type-selector.xml b/entries/nth-last-of-type-selector.xml index 91b3db02..eb96db43 100644 --- a/entries/nth-last-of-type-selector.xml +++ b/entries/nth-last-of-type-selector.xml @@ -8,7 +8,7 @@ The index of each child to match, starting with the last one (1), the string even or odd, or an equation ( eg. :nth-last-of-type(even), :nth-last-of-type(4n) ) - Selects all elements that are the nth-child of their parent, counting from the last element to the first. + Selects all the elements that are the nth-child of their parent in relation to siblings with the same element name, counting from the last element to the first.

    Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing three <li>s, $('li:nth-last-of-type(1)') selects the third, last, <li>.

    Further discussion of this usage can be found in the W3C CSS specification.

    From 4f1bd2b871d3b2e221bd729f4b95bdb2af0c19ce Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 22 Jan 2015 15:01:11 +0000 Subject: [PATCH 479/998] jQuery.param: add jQuery collection as possible type Fixes gh-598 Closes gh-631 --- entries/jQuery.param.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 56d88fc6..bc715497 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -6,7 +6,8 @@ - An array or object to serialize. + + An array, a plain object, or a jQuery object to serialize.
    @@ -14,13 +15,14 @@ - An array or object to serialize. + + An array, a plain object, or a jQuery object to serialize. A Boolean indicating whether to perform a traditional "shallow" serialization. - Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain <input> elements with name/value properties.

    This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

    As of jQuery 1.3, the return value of a function is used instead of the function as a String.

    From 2f2a30a8ee4f9fb5c3e35c99c2207da809f12e80 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 22 Jan 2015 19:48:19 +0100 Subject: [PATCH 480/998] 1.11.44 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4618da73..aa4a7722 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": "1.11.43", + "version": "1.11.44", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 52a1b7d7cbba2645f72f78f945f0ac150ddbd50b Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 3 Jan 2015 14:20:22 +0100 Subject: [PATCH 481/998] change: note that JS-initiated change does not trigger change event Fixes gh-345 Closes gh-617 --- entries/change.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entries/change.xml b/entries/change.xml index 4884ff1e..97a9b5e7 100644 --- a/entries/change.xml +++ b/entries/change.xml @@ -52,6 +52,9 @@ $( "#other" ).click(function() {

    After this code executes, clicks on Trigger the handler will also alert the message. The message will display twice, because the handler has been bound to the change event on both of the form elements.

    As of jQuery 1.4, the change event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.

    +
    +

    Note: Changing the value of an input element using JavaScript, using .val() for example, won't fire the event.

    +
    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. From baef2154dccfb55c68b90da70d4eca94391e84e4 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 23 Jan 2015 14:18:25 +0000 Subject: [PATCH 482/998] off: add `.off(Event_object)` signature Fixes gh-384 Closes gh-634 --- entries/off.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entries/off.xml b/entries/off.xml index b83e3868..2c711a68 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -24,6 +24,12 @@ A selector which should match the one originally passed to .on() when attaching event handlers.
    + + 1.7 + + A jQuery.Event object. + + 1.7 From 860f822b19b08cb3f2331efe751e0befbf6a95fe Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 25 Jan 2015 21:56:40 +0100 Subject: [PATCH 483/998] 1.11.45 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa4a7722..79654d03 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": "1.11.44", + "version": "1.11.45", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 8642d2e4a6a54f25b54bf04998d6db108b1fee0e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 23 Jan 2015 23:50:14 +0000 Subject: [PATCH 484/998] unbind: update the signature to take a jQuery.Event object --- entries/unbind.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/unbind.xml b/entries/unbind.xml index f7f61514..e6be9a13 100644 --- a/entries/unbind.xml +++ b/entries/unbind.xml @@ -23,8 +23,8 @@ 1.0 - - A JavaScript event object as passed to an event handler. + + A jQuery.Event object. From 3a5ff1550bce6e0879f65d0bf67906753d4f6662 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 31 Jan 2015 17:52:07 +0100 Subject: [PATCH 485/998] 1.11.46 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 79654d03..6e48a8e8 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": "1.11.45", + "version": "1.11.46", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3282ee5bc0473ab2b414865eb71a5752d48c9ca6 Mon Sep 17 00:00:00 2001 From: LaurentBarbareau Date: Thu, 20 Nov 2014 15:49:46 +0100 Subject: [PATCH 486/998] jQuery.ajax: remove misplaced word Closes gh-595 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 21463bb8..d7362cb2 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -43,7 +43,7 @@ When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server.
    - This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so: + This object will be the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
    
     $.ajax({
       url: "test.html",
    
    From 881570d8fb901e0724d0ce17d8b6b5d3bab53bff Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sat, 31 Jan 2015 18:05:43 +0100
    Subject: [PATCH 487/998] 1.11.47
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 6e48a8e8..9521f6f8 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": "1.11.46",
    +  "version": "1.11.47",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 76c6268061695b515ae7151aecab1a8f2af38efa Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Thu, 29 Jan 2015 17:38:02 +0100
    Subject: [PATCH 488/998] jQuery.get: fix default for `type` option
    
    Closes gh-640
    ---
     entries/jQuery.get.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
    index 411a5889..aefc58fa 100644
    --- a/entries/jQuery.get.xml
    +++ b/entries/jQuery.get.xml
    @@ -4,7 +4,7 @@
       
         3.0
         
    -      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 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. The type option will automatically be set to GET.
         
       
       
    
    From 0e02309cbd780a5ff1885ff68931e55ebedacc31 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sun, 1 Feb 2015 00:24:57 +0100
    Subject: [PATCH 489/998] 1.11.48
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 9521f6f8..99e2e45e 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": "1.11.47",
    +  "version": "1.11.48",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 91d4fa56916c7d5cf03296bd8c55e7bfc0b6bf3d Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Mon, 26 Jan 2015 17:09:07 +0000
    Subject: [PATCH 490/998] jQuery.param: remove code in summary
    
    Fixes gh-636
    Closes gh-637
    ---
     entries/jQuery.param.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml
    index bc715497..468b6db9 100644
    --- a/entries/jQuery.param.xml
    +++ b/entries/jQuery.param.xml
    @@ -22,7 +22,7 @@
           A Boolean indicating whether to perform a traditional "shallow" serialization.
         
       
    -  Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain <input> elements with name/value properties.
    +  Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties.
       
         

    This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

    As of jQuery 1.3, the return value of a function is used instead of the function as a String.

    From 996e73b0fd0f0a6845e7f1054d7eb0174606f8f9 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 1 Feb 2015 20:04:31 +0100 Subject: [PATCH 491/998] 1.11.49 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99e2e45e..a8c1981f 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": "1.11.48", + "version": "1.11.49", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e82e9db30568ee50474e5d2251d19aa87d6e043d Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 28 Jan 2015 16:52:15 +0100 Subject: [PATCH 492/998] Unload: update examples using `alert()` Fixes gh-388 Closes gh-639 --- entries/unload.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/entries/unload.xml b/entries/unload.xml index e7c12492..e33dc639 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -28,18 +28,16 @@

    Any unload event handler should be bound to the window object:

    
     $( window ).unload(function() {
    -  alert( "Handler for .unload() called." );
    +  return "Handler for .unload() called.";
     });
         
    -

    After this code executes, the alert will be displayed whenever the browser leaves the current page. -It is not possible to cancel the unload event with .preventDefault(). This event is available so that scripts can perform cleanup when the user leaves the page. -

    +

    This event is available so that scripts can perform cleanup when the user leaves the page. Most browsers will ignore calls to alert(), confirm() and prompt() inside the event handler. The string you return may be used in a confirmation dialog, but not all browsers support this. It is not possible to cancel the unload event with .preventDefault().

    To display an alert when a page is unloaded: From 2213245a65baad50a0cf31023c8e0b84bf6ad6eb Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 2 Feb 2015 22:14:27 +0100 Subject: [PATCH 493/998] 1.11.50 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8c1981f..390c9b3d 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": "1.11.49", + "version": "1.11.50", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3cbcc98ce3e1185c72687e1949d1773280b78db6 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 13 Jul 2014 16:10:29 +0100 Subject: [PATCH 494/998] css: document passing an empty string as a second parameter Closes gh-528 --- entries/css.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/css.xml b/entries/css.xml index 178fc326..1f441945 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -143,7 +143,7 @@ $( "div" ).click(function() {

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    -

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    +

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    
    
    From f348efd916559081f0acdcd0b55508ca680bd697 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Tue, 3 Feb 2015 20:58:02 +0100
    Subject: [PATCH 495/998] 1.11.51
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 390c9b3d..ae302c92 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": "1.11.50",
    +  "version": "1.11.51",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From b4b273fa0ca113037f8c42e26a117aea06dd3624 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Thu, 5 Feb 2015 23:46:04 +0000
    Subject: [PATCH 496/998] val: mention support for numbers
    
    Fixes gh-624
    Closes gh-645
    ---
     entries/val.xml | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/entries/val.xml b/entries/val.xml
    index 27cbc392..bb5f03e2 100644
    --- a/entries/val.xml
    +++ b/entries/val.xml
    @@ -106,8 +106,9 @@ $( "input" )
           1.0
           
             
    +        
             
    -        A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
    +        A string of text, a number, or an array of strings corresponding to the value of each matched element to set as selected/checked.
           
         
         
    
    From fe4e1b848cf8f9ca58de36c40bada8f85575d9c9 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Fri, 6 Feb 2015 07:18:34 +0100
    Subject: [PATCH 497/998] 1.11.52
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index ae302c92..84c9e073 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": "1.11.51",
    +  "version": "1.11.52",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 3aeb4c237861831b0ddc5da3034e56f32f466e71 Mon Sep 17 00:00:00 2001
    From: Ian MacIntosh 
    Date: Fri, 21 Nov 2014 11:30:25 -0500
    Subject: [PATCH 498/998] jQuery.ajax: Add request status 'nocontent'
    
    Closes gh-596
    ---
     entries/jQuery.ajax.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index d7362cb2..af8c2cd7 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -32,7 +32,7 @@
           
             
             
    -        A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
    +        A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "nocontent", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
           
           
             An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type.
    
    From 2ce5e66788612dcd7ee72ebc34119c6c2a968fd9 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Fri, 6 Feb 2015 20:45:34 +0100
    Subject: [PATCH 499/998] 1.11.53
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 84c9e073..ec105d55 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": "1.11.52",
    +  "version": "1.11.53",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From da211e93e0a9322c8853e45df76f18dfd77ce2b5 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Tue, 6 Jan 2015 22:16:20 +0100
    Subject: [PATCH 500/998] css: add info on automatic prefixing since 1.8
    
    Fixes gh-339
    Closes gh-621
    ---
     entries/css.xml | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 1f441945..c2e0ae50 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -144,6 +144,7 @@ $( "div" ).click(function() {
           

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    +

    As of jQuery 1.8, the .css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    
    
    From 8d907790537c98a0bd401b01725e2de78488384f Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sat, 7 Feb 2015 09:44:08 +0100
    Subject: [PATCH 501/998] 1.11.54
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index ec105d55..24c75964 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": "1.11.53",
    +  "version": "1.11.54",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 1fc9603a29a9d0f8f0fdcd7a03a6da68c5dc1ae7 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Fri, 6 Feb 2015 20:01:09 +0100
    Subject: [PATCH 502/998] css: clarify getter returns computed value
    
    Fixes gh-326
    Closes gh-646
    ---
     entries/css.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index c2e0ae50..7778699f 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -1,6 +1,6 @@
     
     
    -  Get the value of a style property for the first element in the set of matched elements or set one or more CSS properties for every matched element.
    +  Get the value of a computed style property for the first element in the set of matched elements or set one or more CSS properties for every matched element.
       
         .css()
         
    @@ -17,7 +17,7 @@
         
         Get the computed style properties for the first element in the set of matched elements.
         
    -      

    The .css() method is a convenient way to get a style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    +

    The .css() method is a convenient way to get a computed style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ).

    Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    From 7eeea9584ead9339b2b56bc5ea0e2e0a71931be2 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 7 Feb 2015 23:45:29 +0100 Subject: [PATCH 503/998] 1.11.55 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24c75964..10a7c84c 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": "1.11.54", + "version": "1.11.55", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From c64b9904930610da21710afac66be48fd87cef34 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 8 Feb 2015 16:32:29 +0100 Subject: [PATCH 504/998] outerHeight: document the method as a setter Closes gh-647 Ref gh-98 --- entries/outerHeight.xml | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml index 302de40d..38b8816d 100644 --- a/entries/outerHeight.xml +++ b/entries/outerHeight.xml @@ -1,4 +1,6 @@ + + Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements. .outerHeight() @@ -41,3 +43,63 @@ $( "p:last" ).text( + + + + 1.8.0 + + + + A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + + + 1.8.0 + + A function returning the outer height to set. Receives the index position of the element in the set and the old outer height as arguments. Within the function, this refers to the current element in the set. + + + Set the CSS outer Height of each element in the set of matched elements. + +

    When calling .outerHeight(value), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used (such as 100px, 50%, or auto).

    +
    + + + Change the outer height of each div the first time it is clicked (and change its color). + + + + + + + + + +
    +
    From aaea07c7e885ffd7b65e7c8907784788001eaf8c Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 9 Feb 2015 17:41:57 +0100 Subject: [PATCH 505/998] 1.11.56 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 10a7c84c..98c84f0c 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": "1.11.55", + "version": "1.11.56", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 80d53f0433fabb30ea069d011e0587bf2b6bb180 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 9 Feb 2015 21:42:10 +0100 Subject: [PATCH 506/998] outerWidth: document method as a setter Fixes gh-98 Closes gh-648 --- entries/outerWidth.xml | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index d9cda5a7..f5ac7b0d 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -1,4 +1,6 @@ + + Get the current computed width for the first element in the set of matched elements, including padding and border. .outerWidth() @@ -42,3 +44,62 @@ $( "p:last" ).text( + + + 1.8.0 + + + + A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string). + + + + 1.8.0 + + A function returning the outer width to set. Receives the index position of the element in the set and the old outer width as arguments. Within the function, this refers to the current element in the set. + + + Set the CSS outer width of each element in the set of matched elements. + +

    When calling .outerWidth(value), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used (such as 100px, 50%, or auto).

    +
    + + + Change the outer width of each div the first time it is clicked (and change its color). + + + + + + + + + +
    +
    From 14d39448abfadfd2625090ec8cb47d32b15349e7 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 10 Feb 2015 07:06:21 +0100 Subject: [PATCH 507/998] 1.11.57 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98c84f0c..ca407be9 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": "1.11.56", + "version": "1.11.57", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From fa97019e2d8a71b1d2dde1ec6ffe9263600f1e1c Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 10 Feb 2015 21:11:10 +0100 Subject: [PATCH 508/998] Types: add `progress` to list of methods on a Promise Fixes gh-355 Closes gh-649 --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index c2b9d219..cd66dd4d 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -634,7 +634,7 @@

    Deferred Object

    As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

    Promise Object

    -

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, and state) to prevent users from changing the state of the Deferred. +

    This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, and state) to prevent users from changing the state of the Deferred.

    Callbacks Object

    A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

    From 7ed6ab885d51af1f427d93118410f3d0f54d96bd Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 11 Feb 2015 07:01:52 +0100 Subject: [PATCH 509/998] 1.11.58 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca407be9..0c2c1e89 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": "1.11.57", + "version": "1.11.58", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a6f6b373488782538bd6ff0905efb6a679e918cb Mon Sep 17 00:00:00 2001 From: Eric Mill Date: Sun, 1 Feb 2015 22:24:37 -0500 Subject: [PATCH 510/998] All: replace protocol-relative URLs Fixes gh-613 Closes gh-641 --- entries/jQuery.getScript.xml | 2 +- entries/jQuery.noConflict.xml | 2 +- entries2html.xsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index e36d021c..be884042 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -91,7 +91,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: Mon, 16 Feb 2015 23:30:15 +0100 Subject: [PATCH 512/998] toggle: renamed toggle(showOrHide) to toggle(setShown) To make it clear that passing true shows and passing false hides. Otherwise if you take showOrHide at its word, it would do nothing if you pass false and would call the regular toggle() if you pass true ;-) Closes gh-654 --- entries/toggle.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entries/toggle.xml b/entries/toggle.xml index 76d95f42..8fe34ab7 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -24,8 +24,8 @@ 1.3 - - A Boolean indicating whether to show or hide the elements. + + Use true to show the element or false to hide it. @@ -75,13 +75,13 @@ $( "#clickme" ).click(function() {

    The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:

    
    -$( "#foo" ).toggle( showOrHide );
    +$( "#foo" ).toggle( setShown );
         

    is equivalent to:

    
    -if ( showOrHide === true ) {
    +if ( setShown === true ) {
       $( "#foo" ).show();
    -} else if ( showOrHide === false ) {
    +} else if ( setShown === false ) {
       $( "#foo" ).hide();
     }
         
    From 6c6858c3c4016f6b44e471967ba72d5fafccef06 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Tue, 17 Feb 2015 09:37:49 -0500 Subject: [PATCH 513/998] 1.11.60 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac3c3d0a..1c20ffa8 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": "1.11.59", + "version": "1.11.60", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ce73bb3c3d0ed1b8dfb157b07ff2a3e48c09b2fa Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 18 Feb 2015 16:36:16 +0100 Subject: [PATCH 514/998] css: add note about `px` being the default unit Fixes gh-656 Closes gh-657 --- entries/css.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/css.xml b/entries/css.xml index 7778699f..53ae097d 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -143,6 +143,7 @@ $( "div" ).click(function() {

    As with the .prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    +

    When a number is passed as the value, jQuery will convert it to a string and add px to the end of that string. If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    As of jQuery 1.8, the .css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    From f896bf48e8b0898f6f9d6692f70e182f9abf8729 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 18 Feb 2015 17:16:39 +0100 Subject: [PATCH 515/998] 1.11.61 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c20ffa8..ea142389 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": "1.11.60", + "version": "1.11.61", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 94cf3d4975bf01b78af2cef88fa71ccdda86c8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 24 Feb 2015 10:07:54 -0500 Subject: [PATCH 516/998] Effects: Don't refer to objects as maps Closes gh-664 --- includes/options-argument.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/options-argument.xml b/includes/options-argument.xml index 110456cd..f62a8585 100644 --- a/includes/options-argument.xml +++ b/includes/options-argument.xml @@ -15,7 +15,7 @@ - A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. + An object containing one or more of the CSS properties defined by the properties argument and their corresponding easing functions. From 241c51f4a1c6ada8054ac803f31e48348116b5ed Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 25 Feb 2015 13:38:11 +0100 Subject: [PATCH 517/998] 1.11.62 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea142389..4c8c48b8 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": "1.11.61", + "version": "1.11.62", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 6ba2a3fb0e8583e223091a09c9f7644a1bded34f Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 23 Feb 2015 22:00:47 +0100 Subject: [PATCH 518/998] jQuery.extend: simplify way of logging objects Fixes gh-658 Closes gh-661 --- entries/jQuery.extend.xml | 43 ++++++++------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 958e9d14..ee6fb4a7 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -56,17 +56,8 @@ var object2 = { // Merge object2 into object1 $.extend( object1, object2 ); -var printObj = typeof JSON !== "undefined" ? JSON.stringify : function( obj ) { - var arr = []; - $.each( obj, function( key, val ) { - var next = key + ": "; - next += $.isPlainObject( val ) ? printObj( val ) : val; - arr.push( next ); - }); - return "{ " + arr.join( ", " ) + " }"; -}; - -$( "#log" ).append( printObj( object1 ) ); +// Assuming JSON.stringify - not available in IE<8 +$( "#log" ).append( JSON.stringify( object1 ) ); ]]>
    defaults -- " + printObj( defaults ) + "" ); -$( "#log" ).append( "
    options -- " + printObj( options ) + "
    " ); -$( "#log" ).append( "
    settings -- " + printObj( settings ) + "
    " ); +// Assuming JSON.stringify - not available in IE<8 +$( "#log" ).append( "
    defaults -- " + JSON.stringify( defaults ) + "
    " ); +$( "#log" ).append( "
    options -- " + JSON.stringify( options ) + "
    " ); +$( "#log" ).append( "
    settings -- " + JSON.stringify( settings ) + "
    " ); ]]> 1.3 - + Use true to show the element or false to hide it. @@ -75,13 +75,13 @@ $( "#clickme" ).click(function() {

    The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:

    
    -$( "#foo" ).toggle( setShown );
    +$( "#foo" ).toggle( display );
         

    is equivalent to:

    
    -if ( setShown === true ) {
    +if ( display === true ) {
       $( "#foo" ).show();
    -} else if ( setShown === false ) {
    +} else if ( display === false ) {
       $( "#foo" ).hide();
     }
         
    From e196de1ce926b033de7b6f5a62df013f86b8807f Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 25 Feb 2015 14:38:45 +0100 Subject: [PATCH 520/998] 1.11.63 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c8c48b8..372ec0f5 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": "1.11.62", + "version": "1.11.63", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 19b38fb1b3c736403313a31ae1fdb80d1650d6ab Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 28 Feb 2015 23:29:08 +0000 Subject: [PATCH 521/998] data: Removed trailing space Closes gh-672 --- entries/data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/data.xml b/entries/data.xml index 944efa14..f54a229c 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -21,7 +21,7 @@ Store arbitrary data associated with the matched elements.

    The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks.

    -

    We can set several distinct values for a single element and retrieve them later:

    +

    We can set several distinct values for a single element and retrieve them later:

    
     $( "body" ).data( "foo", 52 );
     $( "body" ).data( "bar", { myType: "test", count: 40 } );
    
    From 46bdad0e5d11d6925f7deb5c01f9c6841dce7fb6 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Sun, 1 Mar 2015 11:56:34 +0100
    Subject: [PATCH 522/998] css: add note about special meaning of mixed case
    
    Fixes gh-357
    Closes gh-674
    ---
     entries/css.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 53ae097d..e7a2891a 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -18,7 +18,7 @@
         Get the computed style properties for the first element in the set of matched elements.
         
           

    The .css() method is a convenient way to get a computed style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    -

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ).

    +

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). This means mixed case has a special meaning, .css( "WiDtH" ) won't do the same as .css( "width" ), for example.

    Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

    From 578de69a455656b63ad78ed161765532d89b7016 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 1 Mar 2015 12:18:08 +0100 Subject: [PATCH 523/998] html: warn about using `.html()` to insert scripts Fixes gh-618 Closes gh-675 --- entries/html.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/html.xml b/entries/html.xml index 0e9f9dcc..2fb32ea1 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -119,6 +119,7 @@ $( "div.demo-container" ).html(function() {

    Given a document with six paragraphs, this example will set the HTML of <div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.

    This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

    +

    To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

    Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

    From a2672e88a587b5e5004cb2f9bec03135f94043d7 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 1 Mar 2015 20:32:42 +0100 Subject: [PATCH 524/998] 1.11.64 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 372ec0f5..5083da11 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": "1.11.63", + "version": "1.11.64", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b6fb719f93aa932dcb95424b98a8e9115d93a866 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 23 Feb 2015 21:40:30 +0100 Subject: [PATCH 525/998] css: add note about retrieving styles for detached elements Fixes gh-653 Closes gh-660 --- entries/css.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/css.xml b/entries/css.xml index e7a2891a..8fe89b20 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -21,6 +21,7 @@

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). This means mixed case has a special meaning, .css( "WiDtH" ) won't do the same as .css( "width" ), for example.

    Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    +

    An element should be connected to the DOM when calling .css() on it. If it isn't, jQuery may throw an error.

    As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

    From be016ae1d0785684f469f03948d680c874734455 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 2 Mar 2015 18:20:08 +0100 Subject: [PATCH 526/998] 1.11.65 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5083da11..6808cf77 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": "1.11.64", + "version": "1.11.65", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 65ccd2d874532abca8e23f2174bf02d126f40046 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 1 Mar 2015 15:45:49 +0100 Subject: [PATCH 527/998] README: fix link for getting xmllint and xsltproc Fixes gh-668 Closes gh-676 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67260550..f720120c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ To build and deploy your changes for previewing in a [`jquery-wp-content`](https * [libxml2](http://xmlsoft.org/) * [libxslt](http://xmlsoft.org/libxslt/) -The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from GnuWin32. +The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com. ## Style Guidelines From ce0cb62258f149f8758583952aa3483967a13c2b Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 4 Mar 2015 07:02:33 +0100 Subject: [PATCH 528/998] 1.11.66 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6808cf77..e369ba64 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": "1.11.65", + "version": "1.11.66", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From f161bb0f3cd79ba4d00920dbb170e94bda57d86e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 28 Feb 2015 22:41:25 +0000 Subject: [PATCH 529/998] on: add note about removing a listener during the event Fixes gh-665 Closes gh-670 --- entries/on.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/entries/on.xml b/entries/on.xml index 0f2f9474..9a7e66ed 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -96,6 +96,21 @@ $( "button" ).on( "click", {

    The focus and blur events are specified by the W3C to not bubble, but jQuery defines cross-browser focusin and focusout events that do bubble. When focus and blur are used to attach delegated event handlers, jQuery maps the names and delivers them as focusin and focusout respectively. For consistency and clarity, use the bubbling event type names.

    In all browsers, the load, scroll, and error events (e.g., on an <img> element) do not bubble. In Internet Explorer 8 and lower, the paste and reset events do not bubble. Such events are not supported for use with delegation, but they can be used when the event handler is directly attached to the element generating the event.

    The error event on the window object uses nonstandard arguments and return value conventions, so it is not supported by jQuery. Instead, assign a handler function directly to the window.onerror property.

    +

    The handler list for an element is set when the event is first delivered. Adding or removing event handlers on the current element won't take effect until the next time the event is handled. To prevent any further event handlers from executing on an element within an event handler, call event.stopImmediatePropagation(). This behavior goes against the W3C events specification. To better understand this case, consider the following code:

    +
    var $test = $( "#test" );
    +
    +function handler1() {
    +  console.log( "handler1" );
    +  $test.off( "click", handler2 );
    +}
    +
    +function handler2() {
    +  console.log( "handler2" );
    +}
    +
    +$test.on( "click", handler1 );
    +$test.on( "click", handler2 );
    +

    In the code above, handler2 will be executed anyway the first time even if it's removed using .off(). However, the handler will not be executed the following times the click event is triggered.

    Display a paragraph's text in an alert when it is clicked: From 2a93e015e81b8acd40357a094b2f6b036508a053 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 6 Mar 2015 22:39:58 +0100 Subject: [PATCH 530/998] 1.11.67 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e369ba64..c2afc6fd 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": "1.11.66", + "version": "1.11.67", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ac8f3e1d1df5217f6e319aa624298fb92c5a2dee Mon Sep 17 00:00:00 2001 From: Chad Killingsworth Date: Thu, 15 Jan 2015 10:41:01 -0600 Subject: [PATCH 531/998] Deferred: Refer to the method as a factory, not a constructor. Closes gh-625 --- entries/jQuery.Deferred.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.Deferred.xml b/entries/jQuery.Deferred.xml index fa9455c0..2884ad87 100644 --- a/entries/jQuery.Deferred.xml +++ b/entries/jQuery.Deferred.xml @@ -14,10 +14,10 @@ - A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + A factory function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. -

    The jQuery.Deferred() constructor creates a new Deferred object. The new operator is optional.

    -

    The jQuery.Deferred method can be passed an optional function, which is called just before the constructor returns and is passed the constructed deferred object as both the this object and as the first argument to the function. The called function can attach callbacks using deferred.then(), for example.

    +

    The jQuery.Deferred() factory creates a new deferred object.

    +

    The jQuery.Deferred method can be passed an optional function, which is called just before the method returns and is passed the new deferred object as both the this object and as the first argument to the function. The called function can attach callbacks using deferred.then(), for example.

    A Deferred object starts in the pending state. Any callbacks added to the object with deferred.then(), deferred.always(), deferred.done(), or deferred.fail() are queued to be executed later. Calling deferred.resolve() or deferred.resolveWith() transitions the Deferred into the resolved state and immediately executes any doneCallbacks that are set. Calling deferred.reject() or deferred.rejectWith() transitions the Deferred into the rejected state and immediately executes any failCallbacks that are set. Once the object has entered the resolved or rejected state, it stays in that state. Callbacks can still be added to the resolved or rejected Deferred — they will execute immediately.

    Enhanced Callbacks with jQuery Deferred From 6ce2c3a69f17a3822c1c65853789b757444b7875 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 9 Mar 2015 07:09:38 +0100 Subject: [PATCH 532/998] 1.11.68 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c2afc6fd..57b9de89 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": "1.11.67", + "version": "1.11.68", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From cc962b2c26ef717f5440aa20c7e6640a0c16d21a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 28 Feb 2015 23:24:18 +0000 Subject: [PATCH 533/998] jQuery.ajax: add `method` option and update examples to use it Fixes gh-609 Closes gh-671 --- entries/jQuery.ajax.xml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index af8c2cd7..428108d4 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -8,7 +8,7 @@ A string containing the URL to which the request is sent. - A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. + A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. @@ -82,7 +82,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." 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." 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. 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. @@ -94,7 +94,7 @@ $.ajax({ Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. - Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } @@ -102,7 +102,10 @@ $.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. + 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"). A mime type to override the XHR mime type. @@ -144,7 +147,7 @@ $.ajax({ Set this to true if you wish to use the traditional style of param serialization. - The type of request to make (e.g. "POST", "GET", "PUT"); default is "GET". + An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. A string containing the URL to which the request is sent. @@ -346,7 +349,7 @@ $.ajaxSetup({ Save some data to the server and notify the user once it's complete. Date: Thu, 26 Mar 2015 12:22:19 +0000 Subject: [PATCH 535/998] deferred.resolve(): Add note about promise Make consistent with other methods like: * `resolveWith` * `notify`, `notifyWith` * `reject`, `rejectWith` Closes gh-681 --- entries/deferred.resolve.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/deferred.resolve.xml b/entries/deferred.resolve.xml index 8ed34680..3aea3599 100644 --- a/entries/deferred.resolve.xml +++ b/entries/deferred.resolve.xml @@ -11,6 +11,7 @@ Resolve a Deferred object and call any doneCallbacks with the given args. +

    Normally, only the creator of a Deferred should call this method; you can prevent other code from changing the Deferred's state by returning a restricted Promise object through deferred.promise().

    When the Deferred is resolved, any doneCallbacks added by deferred.then() or deferred.done() are called. Callbacks are executed in the order they were added. Each callback is passed the args from the deferred.resolve(). Any doneCallbacks added after the Deferred enters the resolved state are executed immediately when they are added, using the arguments that were passed to the deferred.resolve() call. For more information, see the documentation for jQuery.Deferred().

    From 2e73a313c2a66bfeb7481400a178e271c28d0362 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 26 Mar 2015 14:04:44 +0100 Subject: [PATCH 536/998] 1.11.70 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d58dae0e..9a17a4d8 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": "1.11.69", + "version": "1.11.70", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1f2d27ff76459385e6cf7bbeacfbfaa00f9731a9 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 17 Jul 2014 13:50:43 +0100 Subject: [PATCH 537/998] attr: fix note about changing the `type` of an input element in IE8 or older Closes gh-533 --- entries/attr.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/entries/attr.xml b/entries/attr.xml index f0f1408b..203c61c8 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -20,9 +20,6 @@

    Note: Attribute values are strings with the exception of a few attributes such as value and tabindex.

    -
    -

    Note: Attempting to change the type attribute (or property) of an input element created via HTML or already in an HTML document will result in an error being thrown by Internet Explorer 6, 7, or 8.

    -

    As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. To retrieve and change DOM properties such as the checked, selected, or disabled state of form elements, use the .prop() method.

    Attributes vs. Properties

    @@ -197,7 +194,9 @@ $( "#greatphoto" ).attr({

    When setting multiple attributes, the quotes around attribute names are optional.

    WARNING: When setting the 'class' attribute, you must always use quotes!

    -

    Note: jQuery prohibits changing the type attribute on an <input> or <button> element and will throw an error in all browsers. This is because the type attribute cannot be changed in Internet Explorer.

    +
    +

    Note: Attempting to change the type attribute on an input or button element created via document.createElement() will throw an exception on Internet Explorer 8 or older.

    +

    Computed attribute values

    By using a function to set attributes, you can compute the value based on other properties of the element. For example, to concatenate a new value with an existing value:

    
    
    From 165bc3991a0150ec58dea238ee87608a3c23b151 Mon Sep 17 00:00:00 2001
    From: Manuel Strehl 
    Date: Wed, 18 Mar 2015 21:36:13 +0100
    Subject: [PATCH 538/998] siblings: explain that original elements might be
     returned as well
    
    Ref jquery/jquery#2149
    Closes gh-678
    ---
     entries/siblings.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/siblings.xml b/entries/siblings.xml
    index d6b1be02..cb9e6e0b 100644
    --- a/entries/siblings.xml
    +++ b/entries/siblings.xml
    @@ -26,7 +26,7 @@
     $( "li.third-item" ).siblings().css( "background-color", "red" );
         

    The result of this call is a red background behind items 1, 2, 4, and 5. Since we do not supply a selector expression, all of the siblings are part of the object. If we had supplied one, only the matching items among these four would be included.

    -

    The original element is not included among the siblings, which is important to remember when we wish to find all elements at a particular level of the DOM tree.

    +

    The original element is not included among the siblings, which is important to remember when we wish to find all elements at a particular level of the DOM tree. However, if the original collection contains more than one element, they might be mutual siblings and will both be found. If you need an exclusive list of siblings, use $collection.siblings().not($collection).

    Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate). From a91102507b0ce390261791f92e32c7a2ea822dc0 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 26 Mar 2015 14:37:54 +0100 Subject: [PATCH 539/998] 1.11.71 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a17a4d8..49f3155e 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": "1.11.70", + "version": "1.11.71", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 26006aaf79d093784924b614414f1458bbf6af7c Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Thu, 26 Mar 2015 14:13:22 +0000 Subject: [PATCH 540/998] jQuery.when: remove unnecessary `new` operator This is more consistent with other entries. Closes gh-683 --- entries/deferred.promise.xml | 2 +- entries/jQuery.when.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/deferred.promise.xml b/entries/deferred.promise.xml index bcd18815..d2a4c12d 100644 --- a/entries/deferred.promise.xml +++ b/entries/deferred.promise.xml @@ -18,7 +18,7 @@ Create a Deferred and set two timer-based functions to either resolve or reject the Deferred after a random interval. Whichever one fires first "wins" and will call one of the callbacks. The second timeout has no effect since the Deferred is already complete (in a resolved or rejected state) from the first timeout action. Also set a timer-based progress notification function, and call a progress handler that adds "working..." to the document body. Date: Fri, 27 Mar 2015 20:55:25 +0100 Subject: [PATCH 542/998] jQuery.when: passing no arguments returns a resolved promise Fixes gh-342 Closes gh-684 --- entries/jQuery.when.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index 7e88f37d..7f053618 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -19,6 +19,12 @@ $.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {
    
     $.when( { testing: 123 } ).done(function( x ) {
       alert( x.testing ); // Alerts "123"
    +});
    +    
    +

    If you don't pass it any arguments at all, jQuery.when() will return a resolved promise.

    +
    
    +$.when().then(function( x ) {
    +  alert( "I fired immediately" );
     });
         

    In the case where multiple Deferred objects are passed to jQuery.when(), the method returns the Promise from a new "master" Deferred object that tracks the aggregate state of all the Deferreds it has been passed. The method will resolve its master Deferred as soon as all the Deferreds resolve, or reject the master Deferred as soon as one of the Deferreds is rejected. If the master Deferred is resolved, the doneCallbacks for the master Deferred are executed. The arguments passed to the doneCallbacks provide the resolved values for each of the Deferreds, and matches the order the Deferreds were passed to jQuery.when(). For example:

    From b73cf4bb20d3fdfb55dfa03fb9ea951f0f3cf103 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 27 Mar 2015 21:35:42 +0100 Subject: [PATCH 543/998] 1.11.73 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c36c822..e4b490ff 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": "1.11.72", + "version": "1.11.73", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b40db8ade7dd05de8e96d7048c3a5706edf8e428 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 28 Mar 2015 14:46:54 +0100 Subject: [PATCH 544/998] appendTo/prependTo: correct note about appending multiple elements Fixes gh-318 Closes gh-687 --- entries/appendTo.xml | 2 +- entries/prependTo.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/appendTo.xml b/entries/appendTo.xml index f3e5da64..562b870d 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -53,7 +53,7 @@ $( "h2" ).appendTo( $( ".container" ) ); <h2>Greetings</h2> </div>
    -

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

    +

    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.

    diff --git a/entries/prependTo.xml b/entries/prependTo.xml index f51db248..5a8c66df 100644 --- a/entries/prependTo.xml +++ b/entries/prependTo.xml @@ -53,7 +53,7 @@ $( "h2" ).prependTo( $( ".container" ) ); <div class="inner">Goodbye</div> </div>
    -

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

    +

    If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last.

    From edb7aa3e8778d5f472b6317a340aa18b8567fe39 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 28 Mar 2015 18:11:34 +0100 Subject: [PATCH 545/998] 1.11.74 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4b490ff..e7149716 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": "1.11.73", + "version": "1.11.74", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From d0d0e0286fe9a263e1763bb84b23d88f45a12a9b Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 28 Mar 2015 18:19:15 +0100 Subject: [PATCH 546/998] All: fix some broken links Closes gh-688 --- entries/contents.xml | 2 +- entries/delay.xml | 2 +- entries/html.xml | 2 +- entries/id-selector.xml | 2 +- entries/jQuery.ajax.xml | 2 +- entries/odd-selector.xml | 2 +- entries/triggerHandler.xml | 2 +- entries/val.xml | 2 +- pages/Types.html | 10 +++++----- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/entries/contents.xml b/entries/contents.xml index d10defc0..9f4d8b2f 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -33,7 +33,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 94c9d83d..c94b2a0b 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/html.xml b/entries/html.xml index 2fb32ea1..7a4f2594 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -119,7 +119,7 @@ $( "div.demo-container" ).html(function() {

    Given a document with six paragraphs, this example will set the HTML of <div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.

    This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

    -

    To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

    +

    To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

    Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

    diff --git a/entries/id-selector.xml b/entries/id-selector.xml index 0bff7166..20aab992 100644 --- a/entries/id-selector.xml +++ b/entries/id-selector.xml @@ -13,7 +13,7 @@

    For id selectors, jQuery uses the JavaScript function document.getElementById(), which is extremely efficient. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match.

    Calling jQuery() (or $()) with an id selector as its argument will return a jQuery object containing a collection of either zero or one DOM element.

    Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.

    -

    If the id contains characters like periods or colons you have to escape those characters with backslashes.

    +

    If the id contains characters like periods or colons you have to escape those characters with backslashes.

    Select the element with the id "myDiv" and give it a red border. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 428108d4..d7b49447 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -74,7 +74,7 @@ $.ajax({ The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: -
    • "xml": Returns a XML document that can be processed via jQuery.
    • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
    • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • "text": A plain text string.
    • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. +
      • "xml": Returns a XML document that can be processed via jQuery.
      • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
      • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
      • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • "text": A plain text string.
      • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
      diff --git a/entries/odd-selector.xml b/entries/odd-selector.xml index a2520812..12a75cb8 100644 --- a/entries/odd-selector.xml +++ b/entries/odd-selector.xml @@ -5,7 +5,7 @@ 1.0 - Selects odd elements, zero-indexed. See also even. + Selects odd elements, zero-indexed. See also even.

      In particular, note that the 0-based indexing means that, counter-intuitively, :odd selects the second element, fourth element, and so on within the matched set.

      diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index e174311f..ac6c34ba 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -14,7 +14,7 @@ -

      .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

      +

      .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

      • The .triggerHandler( "event" ) method will not call .event() on the element it is triggered on. This means .triggerHandler( "submit" ) on a form will not call .submit() on the form.
      • While .trigger() will operate on all elements matched by the jQuery object, .triggerHandler() only affects the first matched element.
      • diff --git a/entries/val.xml b/entries/val.xml index bb5f03e2..184abdad 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -12,7 +12,7 @@ Get the current value of the first element in the set of matched elements.

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present.

        -

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        +

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        
         // Get the value from a dropdown select
         $( "select.foo option:selected").val();
        diff --git a/pages/Types.html b/pages/Types.html
        index cd66dd4d..422f6bd6 100644
        --- a/pages/Types.html
        +++ b/pages/Types.html
        @@ -11,7 +11,7 @@
         
         

        JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and all and everything you wanted to know about Functions.

        -

        You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox). +

        You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox).

        Whenever an example mentions that a type defaults to a boolean value, the result is good to know when using that type in a boolean context:

        @@ -296,7 +296,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:

        @@ -412,7 +412,7 @@

        Array<Type> Notation

        This indicates that the method doesn't only expect an array as the argument, but also specifies the expected type. The notation is borrowed from Java 5's generics notation (or C++ templates).

        PlainObject

        -

        The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below: +

        The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below:

        
           var a = [];
        @@ -621,7 +621,7 @@ 

        XMLHttpRequest

        @@ -641,4 +641,4 @@

        Callbacks Object

        XML Document

        A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

        Assert

        -

        A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

        +

        A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

        From 1d5f56a09a5f23e29bdb2a2a7986cfa0ad8db7cb Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 29 Mar 2015 14:56:27 +0200 Subject: [PATCH 547/998] 1.11.75 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7149716..ea1c4f94 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": "1.11.74", + "version": "1.11.75", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e0fac2acfadd0d0f41ca88f43fa9ed23854755cc Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 26 Mar 2015 15:01:21 +0100 Subject: [PATCH 548/998] hidden/visible-selector: add note about performance Fixes gh-679 Closes gh-682 --- entries/hidden-selector.xml | 1 + entries/visible-selector.xml | 1 + notes.xsl | 3 +++ 3 files changed, 5 insertions(+) diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index 2daf20e6..6712c736 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -20,6 +20,7 @@

        How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

        + Shows all hidden divs and counts hidden inputs. Date: Fri, 27 Mar 2015 21:13:43 +0100 Subject: [PATCH 550/998] jQuery.parseHTML: add note about leading/trailing text nodes Fixes gh-462 Closes gh-685 --- entries/jQuery.parseHTML.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index b0d245e6..06f59937 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -15,7 +15,7 @@ -

        jQuery.parseHTML uses a native DOM element creation function to convert the string to a set of DOM elements, which can then be inserted into the document.

        +

        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.

        Security Considerations

        Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run script in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute script 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.

        From e84239c26b2cee444ce25e6795f01fa487325b12 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 31 Mar 2015 17:15:42 +0200 Subject: [PATCH 551/998] 1.11.77 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d27acf4..322ee085 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": "1.11.76", + "version": "1.11.77", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1b2f86aa1984584fcbdb7dab6bc08c641813b8e4 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 31 Mar 2015 16:46:29 +0200 Subject: [PATCH 552/998] triggerHandler: add signature for `.triggerHandler( event, extra )` Fixes gh-393 Closes gh-690 --- entries/triggerHandler.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index ac6c34ba..d72516a8 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -13,6 +13,17 @@ Additional parameters to pass along to the event handler. + + 1.3 + + A jQuery.Event object. + + + + + Additional parameters to pass along to the event handler. + +

        .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

          From c3dd5433f76802b0a1caef52d7c207343dcdf162 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 31 Mar 2015 17:38:07 +0200 Subject: [PATCH 553/998] 1.11.78 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 322ee085..159c7d10 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": "1.11.77", + "version": "1.11.78", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 0c6b0fb6da443beed9b94a1e827d9863821652b4 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 2 Apr 2015 18:17:23 +0200 Subject: [PATCH 554/998] jQuery.cssNumber: add new entry Fixes gh-164 Closes gh-693 --- entries/jQuery.cssHooks.xml | 2 +- entries/jQuery.cssNumber.xml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 entries/jQuery.cssNumber.xml diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml index 8252bfa5..f7ecb170 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.cssNumber.xml b/entries/jQuery.cssNumber.xml new file mode 100644 index 00000000..ce5af886 --- /dev/null +++ b/entries/jQuery.cssNumber.xml @@ -0,0 +1,33 @@ + + + jQuery.cssNumber + + 1.4.3 + + An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values. + +

        You can think about jQuery.cssNumber as a list of all CSS properties you might use without a unit. It's used by .css() to determine if it needs to add px to unitless values.

        +

        The keys of the jQuery.cssNumber object are camel-cased and the values are all set to true. If you want to prevent the .css() method from automatically adding the px unit for a specific CSS property, you can add an extra property to the jQuery.cssNumber object.

        +
        
        +jQuery.cssNumber.someCSSProp = true;
        +    
        +

        By default the object contains the following properties:

        +
          +
        • zIndex
        • +
        • fontWeight
        • +
        • opacity
        • +
        • zoom
        • +
        • lineHeight
        • +
        • widows (added in jQuery 1.6)
        • +
        • orphans (added in jQuery 1.6)
        • +
        • fillOpacity (added in jQuery 1.6.2)
        • +
        • columnCount (added in jQuery 1.9)
        • +
        • order (added in jQuery 1.10.2)
        • +
        • flexGrow (added in jQuery 1.11.1)
        • +
        • flexShrink (added in jQuery 1.11.1)
        • +
        +
        + + + +
        From 3b2f209c4b296781fa0e4f778cc0cb611e72c638 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 2 Apr 2015 19:50:11 +0200 Subject: [PATCH 555/998] 1.11.79 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 159c7d10..1f11b9f9 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": "1.11.78", + "version": "1.11.79", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 043079ed01671d2893fd8a412143391f4a13b43a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 5 Apr 2015 15:22:04 +0100 Subject: [PATCH 556/998] addClass: Minor description improvement Closes gh-697 --- entries/addClass.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/addClass.xml b/entries/addClass.xml index 238d03e5..476251d8 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -16,7 +16,7 @@ - Adds the specified class(es) to each of the set of matched elements. + Adds the specified class(es) to each element in the set of matched elements.

        It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

        More than one class may be added at a time, separated by a space, to the set of matched elements, like so:

        From 55d856827e27b58c28a3b878062cc19d571e55d2 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 5 Apr 2015 16:23:55 +0200 Subject: [PATCH 557/998] 1.11.80 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f11b9f9..c1e60b7e 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": "1.11.79", + "version": "1.11.80", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 626b12bcaff2aa97513755cf1f4aba1563134f38 Mon Sep 17 00:00:00 2001 From: Eric Atienza Date: Mon, 6 Apr 2015 10:40:18 +0200 Subject: [PATCH 558/998] deferred.progress: Clarify that the second argument is optional Closes gh-694 --- entries/deferred.progress.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/deferred.progress.xml b/entries/deferred.progress.xml index 3a827a24..d1f18cc7 100644 --- a/entries/deferred.progress.xml +++ b/entries/deferred.progress.xml @@ -10,7 +10,7 @@ A function, or array of functions, to be called when the Deferred generates progress notifications. - + From 36ebfed0363d9acc742dd4255872fbeb50abb5d1 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 6 Apr 2015 10:51:21 +0200 Subject: [PATCH 559/998] 1.11.81 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1e60b7e..1e29dc72 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": "1.11.80", + "version": "1.11.81", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a5faca00164c88eb6dd45d55fdd0c0721b38fd01 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 6 Apr 2015 10:57:30 +0200 Subject: [PATCH 560/998] Wrap: Clarify that passing a collection uses the first element Fixes gh-698 Closes gh-700 --- entries/wrap.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/wrap.xml b/entries/wrap.xml index 02bce46c..1cd67a04 100644 --- a/entries/wrap.xml +++ b/entries/wrap.xml @@ -8,7 +8,7 @@ - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. When you pass a jQuery collection containing more than one element the first element will be used. From e31c339f3e675b100470421280970b5eee81bbc9 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 6 Apr 2015 15:32:42 +0200 Subject: [PATCH 561/998] 1.11.82 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1e29dc72..a2c4d4c8 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": "1.11.81", + "version": "1.11.82", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 0a4b6fb89fac9d217a31d45681428e56d1ed0661 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 5 Apr 2015 23:18:33 +0100 Subject: [PATCH 562/998] wrapAll: Update return type of callback function The return value of the the callback function can be a jQuery object as well. This is the same as `wrap()`. Closes gh-699 --- entries/wrapAll.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/entries/wrapAll.xml b/entries/wrapAll.xml index 80112ca0..c6dc02ca 100644 --- a/entries/wrapAll.xml +++ b/entries/wrapAll.xml @@ -14,9 +14,12 @@ 1.4 - A function that returns a structure to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - + + + + Wrap an HTML structure around all elements in the set of matched elements. From d289cf47165e4371953b498322cbb87863b94175 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 6 Apr 2015 15:42:54 +0200 Subject: [PATCH 563/998] Wrap: correction to note about multiple elements Ref gh-700 Closes gh-701 --- entries/wrap.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/wrap.xml b/entries/wrap.xml index 1cd67a04..d6258d70 100644 --- a/entries/wrap.xml +++ b/entries/wrap.xml @@ -8,7 +8,7 @@ - A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. When you pass a jQuery collection containing more than one element the first element will be used. + A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. When you pass a jQuery collection containing more than one element, or a selector matching more than one element, the first element will be used. From eefe1720ed78f5d85c21fb2edde5cffb5b2e3e8f Mon Sep 17 00:00:00 2001 From: Eric Lee Carraway Date: Mon, 6 Apr 2015 16:58:51 -0500 Subject: [PATCH 564/998] Ajax Events: Fix space before a comma Closes gh-704 --- pages/Ajax_Events.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Ajax_Events.html b/pages/Ajax_Events.html index 9ba25ff7..26a59f0f 100644 --- a/pages/Ajax_Events.html +++ b/pages/Ajax_Events.html @@ -33,7 +33,7 @@

        Global Events

        });

        Events

        -

        This is the full list of Ajax events , and in the order in which they are triggered. The indented events are triggered for each and every Ajax request (unless a global option has been set). The ajaxStart and ajaxStop events are events that relate to all Ajax requests together. +

        This is the full list of Ajax events, and in the order in which they are triggered. The indented events are triggered for each and every Ajax request (unless a global option has been set). The ajaxStart and ajaxStop events are events that relate to all Ajax requests together.

        • ajaxStart (Global Event)
          This event is triggered if an Ajax request is started and no other Ajax requests are currently running. From 2c4233f3eaaa9c38ee10967b1ce56da823f239d7 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 7 Apr 2015 09:30:59 +0200 Subject: [PATCH 565/998] 1.11.83 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2c4d4c8..6c18d258 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": "1.11.82", + "version": "1.11.83", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From bad3340c8335505516f26f93ee8aaa0b72b75a18 Mon Sep 17 00:00:00 2001 From: Eric Lee Carraway Date: Tue, 7 Apr 2015 18:23:01 -0500 Subject: [PATCH 566/998] callbacks.fire: add a missing period Closes gh-706 --- entries/callbacks.fire.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/callbacks.fire.xml b/entries/callbacks.fire.xml index 00ec03f3..daae9b1f 100644 --- a/entries/callbacks.fire.xml +++ b/entries/callbacks.fire.xml @@ -7,7 +7,7 @@ The argument or list of arguments to pass back to the callback list. - Call all of the callbacks with the given arguments + Call all of the callbacks with the given arguments.

          This method returns the Callbacks object onto which it is attached (this).

          From d622e1244802cd55670265698f0d66383e3dedaa Mon Sep 17 00:00:00 2001 From: Eric Lee Carraway Date: Tue, 7 Apr 2015 18:13:18 -0500 Subject: [PATCH 567/998] jQuery.isFunction: capitalize S in JavaScript Closes gh-705 --- entries/jQuery.isFunction.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml index 2ceed224..689cdbf7 100644 --- a/entries/jQuery.isFunction.xml +++ b/entries/jQuery.isFunction.xml @@ -7,7 +7,7 @@ Object to test whether or not it is a function. - Determine if the argument passed is a Javascript function object. + Determine if the argument passed is a JavaScript function object.

          Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

          From fdaa71085ce665d9a2d9d8129d2bcfee1e2a0f68 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 12:53:32 +0200 Subject: [PATCH 568/998] 1.11.84 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c18d258..7085f9f6 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": "1.11.83", + "version": "1.11.84", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From feac99a0174a071b20c1ab9b312c00c9c832d504 Mon Sep 17 00:00:00 2001 From: Alexander Robert Angas Date: Wed, 8 Apr 2015 14:57:42 +0930 Subject: [PATCH 569/998] focusin/focusout: use consistent categories Fixes gh-619 Closes gh-707 --- entries/focusin.xml | 1 + entries/focusout.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/entries/focusin.xml b/entries/focusin.xml index dd273e67..251acaaf 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -42,6 +42,7 @@ $( "p" ).focusin(function() { ]]> + diff --git a/entries/focusout.xml b/entries/focusout.xml index b8ac4373..6161919b 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -62,8 +62,8 @@ $( "p" )
          blur fire
          ]]> - - + + From 89d7028945cbf9a5898b8c986d9a7be1254ea2fb Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 12:55:36 +0200 Subject: [PATCH 570/998] 1.11.85 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7085f9f6..3b924585 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": "1.11.84", + "version": "1.11.85", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9f29995d4a2ba064f34474f627d96c867858f25c Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 31 Mar 2015 13:27:26 +0200 Subject: [PATCH 571/998] jQuery.get: note required callback arg if `dataType` is provided Fixes gh-351 Closes gh-691 --- entries/jQuery.get.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index aefc58fa..51b50c64 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -21,7 +21,7 @@ - A callback function that is executed if the request succeeds. + A callback function that is executed if the request succeeds. Required if dataType is provided, but you can use null or jQuery.noop as a placeholder. The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). From 8517c54ce71cd59ce388a9914320d791886ddbcc Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 14:14:16 +0200 Subject: [PATCH 572/998] 1.11.86 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b924585..00081c82 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": "1.11.85", + "version": "1.11.86", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a10fe84a0fde13164a87132e87938d6a55311d02 Mon Sep 17 00:00:00 2001 From: Eric Atienza Date: Mon, 6 Apr 2015 18:54:14 +0200 Subject: [PATCH 573/998] innerWidth: use `Number` return type Closes gh-703 --- entries/innerWidth.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index 3356884d..a04640d4 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -1,7 +1,7 @@ Get the current computed inner width (including padding but not border) for the first element in the set of matched elements or set the inner width of every matched element. - + .innerWidth() 1.2.6 From c214dd395a7f9b73f892cec0e147a528f8f5a8e6 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 19:11:13 +0200 Subject: [PATCH 574/998] 1.11.87 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00081c82..982763b4 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": "1.11.86", + "version": "1.11.87", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 14060437b8e6eae97b2fcb726c7afcb228d4a9e8 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 11 Apr 2015 17:31:37 +0100 Subject: [PATCH 575/998] jQuery.ajax: Fixed a typo Closes gh-713 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index d7b49447..51bdb838 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -43,7 +43,7 @@ When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server. - This object will be the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so: + This object will be the context of all Ajax-related callbacks. By default, the context is an object that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). For example, specifying a DOM element as the context will make that the context for the complete callback of a request, like so:
          
           $.ajax({
             url: "test.html",
          
          From 21a91138b77737ca3019a203d5158e62b265677d Mon Sep 17 00:00:00 2001
          From: Aurelio De Rosa 
          Date: Sat, 11 Apr 2015 17:44:07 +0100
          Subject: [PATCH 576/998] jQuery.ajax: surround `data` by ``
          
          Closes gh-714
          ---
           entries/jQuery.ajax.xml | 2 +-
           1 file changed, 1 insertion(+), 1 deletion(-)
          
          diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
          index 51bdb838..f2db327d 100644
          --- a/entries/jQuery.ajax.xml
          +++ b/entries/jQuery.ajax.xml
          @@ -114,7 +114,7 @@ $.ajax({
                   A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
                 
                 
          -        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.
          +        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.
                 
                 
                   Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
          
          From 5b04f937be9e8df0dc93b32a3940721ad2b19469 Mon Sep 17 00:00:00 2001
          From: Aurelio De Rosa 
          Date: Sun, 12 Apr 2015 19:55:40 +0100
          Subject: [PATCH 577/998] jQuery.animate: remove misplaced parenthesis
          
          Closes gh-715
          ---
           entries/animate.xml | 2 +-
           1 file changed, 1 insertion(+), 1 deletion(-)
          
          diff --git a/entries/animate.xml b/entries/animate.xml
          index d05f366e..2cbec644 100644
          --- a/entries/animate.xml
          +++ b/entries/animate.xml
          @@ -22,7 +22,7 @@
             
               

          The .animate() method allows us to create animation effects on any numeric CSS property. The only required parameter is a plain object of CSS properties. This object is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive.

          Animation Properties and Values

          -

          All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used). Property values are treated as a number of pixels unless otherwise specified. The units em and % can be specified where applicable.

          +

          All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color plugin is used). Property values are treated as a number of pixels unless otherwise specified. The units em and % can be specified where applicable.

          In addition to style properties, some non-style properties such as scrollTop and scrollLeft, as well as custom properties, can be animated.

          Shorthand CSS properties (e.g. font, background, border) are not fully supported. For example, if you want to animate the rendered border width, at least a border style and border width other than "auto" must be set in advance. Or, if you want to animate font size, you would use fontSize or the CSS equivalent 'font-size' rather than simply 'font'.

          In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element. In order to use jQuery's built-in toggle state tracking, the 'toggle' keyword must be consistently given as the value of the property being animated.

          From 473613debe97676a56853453bde5c382625af9f4 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 16 Apr 2015 10:29:34 +0200 Subject: [PATCH 578/998] 1.11.88 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 982763b4..d184215d 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": "1.11.87", + "version": "1.11.88", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 929f9e2472ec0da31446860f3e6a34f35321a6a2 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 14:30:44 +0200 Subject: [PATCH 579/998] Types: add new type `array-like object` Fixes gh-708 Closes gh-710 --- pages/Types.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/Types.html b/pages/Types.html index 422f6bd6..feab0a76 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -73,6 +73,7 @@
        • Array<Type> Notation
        +
      • Array-Like Objects
      • PlainObject
      • Date
      • Function @@ -411,6 +412,9 @@

        Array<Type> Notation

        This indicates that the method doesn't only expect an array as the argument, but also specifies the expected type. The notation is borrowed from Java 5's generics notation (or C++ templates).

        +

        Array-Like Objects

        +

        Either a true JavaScript Array or a JavaScript Object that contains a nonnegative integer length property and index properties from 0 up to length - 1. This latter case includes array-like objects commonly encountered in web-based code such as the arguments object and the NodeList object returned by many DOM methods.

        +

        When a jQuery API accepts either plain Objects or Array-Like objects, a plain Object with a numeric length property will trigger the Array-Like behavior.

        PlainObject

        The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below:

        From e0f1e222950c9dcf9e64805318fccafe1025d8be Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 16 Apr 2015 22:54:55 +0200 Subject: [PATCH 580/998] 1.11.89 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d184215d..713b6127 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": "1.11.88", + "version": "1.11.89", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From c0e5d54c16713fe39f93d4ca8276ada8723d8fe2 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 31 Mar 2015 16:33:29 +0200 Subject: [PATCH 581/998] jQuery.merge: accept array-like objects instead of arrays Fixes gh-686 Closes gh-692 --- entries/jQuery.merge.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/entries/jQuery.merge.xml b/entries/jQuery.merge.xml index ef43c770..053fff03 100644 --- a/entries/jQuery.merge.xml +++ b/entries/jQuery.merge.xml @@ -4,15 +4,15 @@ Merge the contents of two arrays together into the first array. 1.0 - - The first array to merge, the elements of second added. + + The first array-like object to merge, the elements of second added. - - The second array to merge into the first, unaltered. + + The second array-like object to merge into the first, unaltered. -

        The $.merge() operation forms an array that contains all elements from the two arrays. The orders of items in the arrays are preserved, with items from the second array appended. The $.merge() function is destructive. It alters the first parameter to add the items from the second.

        +

        The $.merge() operation forms an array that contains all elements from the two arrays. The orders of items in the arrays are preserved, with items from the second array appended. The $.merge() function is destructive. It alters the length and numeric index properties of the first object to include items from the second.

        If you need the original first array, make a copy of it before calling $.merge(). Fortunately, $.merge() itself can be used for this duplication:

        
         var newArray = $.merge([], oldArray);
        
        From 11636011aa377d1af31527afa1c40919aff8d0a7 Mon Sep 17 00:00:00 2001
        From: Arthur Verschaeve 
        Date: Thu, 16 Apr 2015 23:14:15 +0200
        Subject: [PATCH 582/998] Types: rename `array-like objects` to `array-like
         object`
        
        ---
         entries/jQuery.merge.xml | 4 ++--
         pages/Types.html         | 4 ++--
         2 files changed, 4 insertions(+), 4 deletions(-)
        
        diff --git a/entries/jQuery.merge.xml b/entries/jQuery.merge.xml
        index 053fff03..b122635e 100644
        --- a/entries/jQuery.merge.xml
        +++ b/entries/jQuery.merge.xml
        @@ -4,10 +4,10 @@
           Merge the contents of two arrays together into the first array. 
           
             1.0
        -    
        +    
               The first array-like object to merge, the elements of second added.
             
        -    
        +    
               The second array-like object to merge into the first, unaltered.
             
           
        diff --git a/pages/Types.html b/pages/Types.html
        index feab0a76..5cd81ca6 100644
        --- a/pages/Types.html
        +++ b/pages/Types.html
        @@ -73,7 +73,7 @@
               
      • Array<Type> Notation
    • -
    • Array-Like Objects
    • +
    • Array-Like Object
    • PlainObject
    • Date
    • Function @@ -412,7 +412,7 @@

      Array<Type> Notation

      This indicates that the method doesn't only expect an array as the argument, but also specifies the expected type. The notation is borrowed from Java 5's generics notation (or C++ templates).

      -

      Array-Like Objects

      +

      Array-Like Object

      Either a true JavaScript Array or a JavaScript Object that contains a nonnegative integer length property and index properties from 0 up to length - 1. This latter case includes array-like objects commonly encountered in web-based code such as the arguments object and the NodeList object returned by many DOM methods.

      When a jQuery API accepts either plain Objects or Array-Like objects, a plain Object with a numeric length property will trigger the Array-Like behavior.

      PlainObject

      From 424bea3fa4b9d65707485e5d9de7bdb37cd91afd Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 17 Apr 2015 17:37:40 +0200 Subject: [PATCH 583/998] 1.11.90 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 713b6127..d5ea4af1 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": "1.11.89", + "version": "1.11.90", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e420da6cacea0f08c528b7a5eeb376ad64c52f32 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 17 Apr 2015 17:22:25 +0200 Subject: [PATCH 584/998] Events: add note about detaching to all shorthand methods Fixes gh-717 Closes gh-719 --- entries/blur.xml | 1 + entries/change.xml | 1 + entries/click.xml | 1 + entries/dblclick.xml | 1 + entries/error.xml | 1 + entries/focus.xml | 1 + entries/focusin.xml | 1 + entries/focusout.xml | 1 + entries/keydown.xml | 1 + entries/keypress.xml | 1 + entries/keyup.xml | 1 + entries/mousedown.xml | 1 + entries/mouseenter.xml | 1 + entries/mouseleave.xml | 1 + entries/mousemove.xml | 1 + entries/mouseout.xml | 1 + entries/mouseover.xml | 1 + entries/mouseup.xml | 1 + entries/resize.xml | 1 + entries/scroll.xml | 1 + entries/select.xml | 1 + entries/submit.xml | 1 + entries/unload.xml | 1 + notes.xsl | 3 +++ 24 files changed, 26 insertions(+) diff --git a/entries/blur.xml b/entries/blur.xml index 747a7d1e..11afbd6a 100644 --- a/entries/blur.xml +++ b/entries/blur.xml @@ -52,6 +52,7 @@ $( "#other" ).click(function() {

      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().

      + To trigger the blur event on all paragraphs: Date: Sat, 28 Feb 2015 23:34:56 +0000 Subject: [PATCH 586/998] jQuery.data: correct info on `.data( "name", undefined )` Fixes gh-586 Closes gh-673 --- entries/jQuery.data.xml | 2 +- notes.xsl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.data.xml b/entries/jQuery.data.xml index 193cae70..bc1bab43 100644 --- a/entries/jQuery.data.xml +++ b/entries/jQuery.data.xml @@ -25,7 +25,7 @@ jQuery.data( document.body, "bar", "test" ); - + Store then retrieve a value from the div element. Date: Thu, 16 Apr 2015 11:15:18 +0200 Subject: [PATCH 588/998] Trigger: add note about objects with a `length` property Fixes gh-377 Closes gh-716 --- entries/trigger.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/trigger.xml b/entries/trigger.xml index c840b058..91e3c26a 100644 --- a/entries/trigger.xml +++ b/entries/trigger.xml @@ -46,6 +46,7 @@ $( "#foo").trigger( "custom", [ "Custom", "Event" ] );

      The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.

      Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.
      Note: As with .triggerHandler(), when calling .trigger() with an event name matches the name of a property on the object, prefixed by on (e.g. triggering click on window that has a non null onclick method), jQuery will attempt to invoke that property as a method.
      +
      Note: When triggering with a plain object that is not array-like but still contains a length property, you should pass the object in an array (e.g. [ { length: 1 } ]).
      Clicks to button #2 also trigger a click for button #1. From c0c72c680d146a750a42cf966368a7e3beaa35be Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 19 Apr 2015 15:04:11 +0200 Subject: [PATCH 589/998] 1.11.93 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3df6c618..5d9f7f24 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": "1.11.92", + "version": "1.11.93", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 225389fb6aeb14bbe9c2ee290d7617a45801cfef Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 28 Mar 2015 08:44:51 -0400 Subject: [PATCH 590/998] jQuery.parseHTML: Fix a couple typos --- entries/jQuery.parseHTML.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index 06f59937..930d60a2 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -18,10 +18,10 @@

      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.

      Security Considerations

      -

      Most jQuery APIs that accept HTML strings will run scripts that are included in the HTML. jQuery.parseHTML does not run script in the parsed HTML unless keepScripts is explicitly true. However, it is still possible in most environments to execute script 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.

      +

      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. + Create an array of DOM nodes using an HTML string and insert it into a div. Date: Wed, 22 Apr 2015 20:23:23 +0200 Subject: [PATCH 592/998] next-adjacent: rename file to `next-adjacent-selector.xml` Ref gh-722 Closes gh-723 --- .../{next-adjacent-Selector.xml => next-adjacent-selector.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename entries/{next-adjacent-Selector.xml => next-adjacent-selector.xml} (100%) diff --git a/entries/next-adjacent-Selector.xml b/entries/next-adjacent-selector.xml similarity index 100% rename from entries/next-adjacent-Selector.xml rename to entries/next-adjacent-selector.xml From 484615071377dfcb1c3a57e27e0a76704ac78a94 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 29 Apr 2015 20:08:58 +0200 Subject: [PATCH 593/998] 1.11.95 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6cc2c945..b86e0850 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": "1.11.94", + "version": "1.11.95", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1344eb35fb792ea0d7a148be96bbb81e84f08fea Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 20 Apr 2015 15:37:41 -0400 Subject: [PATCH 594/998] Dimensions: Update hidden element note Add information about it being bad practice, inaccurate, and subject to removal in a future version of jQuery. It probably causes cancer too. Fixes gh-197 Closes gh-721 --- entries/height.xml | 2 +- entries/innerHeight.xml | 2 +- entries/innerWidth.xml | 2 +- entries/outerHeight.xml | 2 +- entries/outerWidth.xml | 2 +- entries/width.xml | 2 +- notes.xsl | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/entries/height.xml b/entries/height.xml index 9d4b86bc..7efdf312 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -26,7 +26,7 @@ $( document ).height(); - + Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. Date: Wed, 29 Apr 2015 20:11:27 +0200 Subject: [PATCH 596/998] jQuery.post: change order of signatures Closes gh-726 Fixes gh-725 --- entries/jQuery.post.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 2300cbe7..8a1bdc43 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -1,12 +1,6 @@ jQuery.post() - - 3.0 - - 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. - - 1.0 @@ -27,6 +21,12 @@ The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + + 3.0 + + 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. + + Load data from the server using a HTTP POST request.

      This is a shorthand Ajax function, which is equivalent to:

      From 74d690ffc8af49cace4785e52eec70668a43068c Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 22 Apr 2015 20:34:58 +0200 Subject: [PATCH 597/998] offsetParent: Add correct `` Fixes gh-722 Closes gh-724 --- entries/offsetParent.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/offsetParent.xml b/entries/offsetParent.xml index 363c3208..c49a7044 100644 --- a/entries/offsetParent.xml +++ b/entries/offsetParent.xml @@ -59,4 +59,5 @@ $( "li.item-a" ).offsetParent().css( "background-color", "red" );
      + From 31d2ab4182a33ecd6a54c6b5ed3cad42fb0ebca5 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 1 May 2015 09:18:42 +0200 Subject: [PATCH 598/998] 1.11.97 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc0c4a63..8ba1dd52 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": "1.11.96", + "version": "1.11.97", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 699e63f1b8c74b428bf2e2b0115db7441e3a2f85 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 7 May 2015 12:50:10 -0700 Subject: [PATCH 599/998] event.metaKey: Explain which key is `META` on common platforms Sources: * https://w3c.github.io/uievents/#widl-KeyboardEvent-metaKey * https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/metaKey Closes gh-735 --- entries/event.metaKey.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entries/event.metaKey.xml b/entries/event.metaKey.xml index bca1b7b2..b83eeadd 100644 --- a/entries/event.metaKey.xml +++ b/entries/event.metaKey.xml @@ -8,6 +8,8 @@

      Returns a boolean value (true or false) that indicates whether or not the META key was pressed at the time the event fired. This key might map to an alternative key name on some platforms.

      +

      On Macintosh keyboards, the META key maps to the Command key (⌘).

      +

      On Windows keyboards, the META key maps to the Windows key.

      Determine whether the META key was pressed when the event fired. From 7ecff5dd61e6137858e063d5d352ee50ba8f127d Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 11 May 2015 06:56:16 +0200 Subject: [PATCH 600/998] 1.11.98 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ba1dd52..d75c90bd 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": "1.11.97", + "version": "1.11.98", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ae3a65efea000b267ef67d63343dc29453ad68e4 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 23 May 2015 19:54:22 +0100 Subject: [PATCH 601/998] jQuery(): Wrap code using the `code` element Closes gh-743 --- entries/jQuery.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index fc13219d..287d0f0a 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -174,7 +174,7 @@ $( myForm.elements ).hide();
      $( "<p id='test'>My <em>new</em> text</p>" ).appendTo( "body" );

      For explicit parsing of a string to HTML, use the $.parseHTML() method.

      By default, elements are created with an .ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

      -

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's .innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function.

      +

      If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's .innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function.

      When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

      Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

      To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

      From 66e94294b81748b66230005cc71c02de9755c78f Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 23 May 2015 22:19:57 +0200 Subject: [PATCH 602/998] 1.11.99 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d75c90bd..97ddf8c0 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": "1.11.98", + "version": "1.11.99", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From be83880bcfed80ffe87771e5835a690d6216bbe8 Mon Sep 17 00:00:00 2001 From: Yuval Greenfield Date: Sun, 19 Apr 2015 09:18:41 -0700 Subject: [PATCH 603/998] jQuery.ajax: Clarify information regarding cross-domain `jsonp` usage Closes gh-329 --- entries/jQuery.ajax.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index f2db327d..4c8f6686 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -74,8 +74,15 @@ $.ajax({ The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: -
      • "xml": Returns a XML document that can be processed via jQuery.
      • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
      • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
      • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • "text": A plain text string.
      • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. -
      +
        +
      • "xml": Returns a XML document that can be processed via jQuery.
      • +
      • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
      • +
      • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
      • +
      • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • +
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • +
      • "text": A plain text string.
      • +
      • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
      • +
      From 4bd46e4374437abb815dcac54438f61c66f93e92 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 24 May 2015 19:45:23 +0200 Subject: [PATCH 604/998] 1.11.100 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 97ddf8c0..0cda4e6d 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": "1.11.99", + "version": "1.11.100", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 87d3f60d6634bf5d63ee7fd599a25a50000d32a2 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 27 May 2015 21:54:26 +0200 Subject: [PATCH 605/998] Selector: correct `removed` version Fixes gh-746 Closes gh-747 --- entries/selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/selector.xml b/entries/selector.xml index 971a2535..76a0ea5e 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -1,5 +1,5 @@ - + .selector 1.3 From fd5e89de6a79d9314cd4d27d517c374e659e6eab Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 28 May 2015 06:49:53 +0200 Subject: [PATCH 606/998] 1.11.101 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0cda4e6d..f428e95f 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": "1.11.100", + "version": "1.11.101", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2fbd82b48db4c5387f4f6d68084486fff8d4bf83 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 9 May 2015 22:19:50 +0200 Subject: [PATCH 607/998] jQuery(): add note about support of text nodes Fixes gh-709 Close gh-738 --- entries/contents.xml | 2 +- entries/jQuery.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/entries/contents.xml b/entries/contents.xml index 9f4d8b2f..6f348b9b 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -6,7 +6,7 @@ Get the children of each element in the set of matched elements, including text and comment nodes. -

      Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes as well as HTML elements in the resulting jQuery object.

      +

      Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes and comment nodes as well as HTML elements in the resulting jQuery object. Please note that most jQuery operations don't support text nodes and comment nodes. The few that do will have an explicit note on their API documentation page.

      The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

      Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br>):

      
      diff --git a/entries/jQuery.xml b/entries/jQuery.xml
      index 287d0f0a..80e5bf19 100644
      --- a/entries/jQuery.xml
      +++ b/entries/jQuery.xml
      @@ -57,7 +57,8 @@ $( "div.foo" ).click(function() {
             

      Internally, selector context is implemented with the .find() method, so $( "span", this ) is equivalent to $( this ).find( "span" ).

      Using DOM elements

      -

      The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way. When passing an array, each element must be a DOM element; mixed data is not supported. A jQuery object is created from the array elements in the order they appeared in the array; unlike most other multi-element jQuery operations, the elements are not sorted in DOM order.

      +

      The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way. A jQuery object is created from the array elements in the order they appeared in the array; unlike most other multi-element jQuery operations, the elements are not sorted in DOM order. Elements will be copied from the array as-is and won't be unwrapped if they're already jQuery collections.

      +

      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() {
      
      From 2519ef6e70285e92d2a89db062e47a7e40182efc Mon Sep 17 00:00:00 2001
      From: Arthur Verschaeve 
      Date: Sat, 30 May 2015 15:41:58 +0200
      Subject: [PATCH 608/998] 1.11.102
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index f428e95f..c850d7e1 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": "1.11.101",
      +  "version": "1.11.102",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation and other contributors"
      
      From cc4cc30698bc19ebe075c8838b2da31b65d5b89d Mon Sep 17 00:00:00 2001
      From: Chad Killingsworth 
      Date: Mon, 8 Jun 2015 09:14:43 -0500
      Subject: [PATCH 609/998] deferred.promise: promise objects also have the
       .promise() method
      
      Closes gh-753
      ---
       entries/deferred.promise.xml | 2 +-
       pages/Types.html             | 2 +-
       2 files changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/deferred.promise.xml b/entries/deferred.promise.xml
      index d2a4c12d..db6550bd 100644
      --- a/entries/deferred.promise.xml
      +++ b/entries/deferred.promise.xml
      @@ -9,7 +9,7 @@
         
          Return a Deferred's Promise object. 
         
      -    

      The deferred.promise() method allows an asynchronous function to prevent other code from interfering with the progress or status of its internal request. The Promise exposes only the Deferred methods needed to attach additional handlers or determine the state (then, done, fail, always, pipe, progress, and state), but not ones that change the state (resolve, reject, notify, resolveWith, rejectWith, and notifyWith).

      +

      The deferred.promise() method allows an asynchronous function to prevent other code from interfering with the progress or status of its internal request. The Promise exposes only the Deferred methods needed to attach additional handlers or determine the state (then, done, fail, always, pipe, progress, state and promise), but not ones that change the state (resolve, reject, notify, resolveWith, rejectWith, and notifyWith).

      If target is provided, deferred.promise() will attach the methods onto it and then return this object rather than create a new one. This can be useful to attach the Promise behavior to an object that already exists.

      If you are creating a Deferred, keep a reference to the Deferred so that it can be resolved or rejected at some point. Return only the Promise object via deferred.promise() so other code can register callbacks or inspect the current state.

      For more information, see the documentation for Deferred object.

      diff --git a/pages/Types.html b/pages/Types.html index 5cd81ca6..18e0ee5b 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -638,7 +638,7 @@

      Deferred Object

      As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

      Promise Object

      -

      This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, and state) to prevent users from changing the state of the Deferred. +

      This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, progress, state and promise) to prevent users from changing the state of the Deferred.

      Callbacks Object

      A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

      From 3a277ccdd8f767fffe85a698867abe3223134780 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 9 Jun 2015 06:52:34 +0200 Subject: [PATCH 610/998] 1.11.103 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c850d7e1..b788fab7 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": "1.11.102", + "version": "1.11.103", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From f389f0e279fc05bbcb3d7c9979a4a6cb16bb73fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 9 Jun 2015 22:36:49 -0400 Subject: [PATCH 611/998] Build: Run `grunt lint` on Travis Fixes jquery/api.jquery.com#749 --- .travis.yml | 5 +++++ Gruntfile.js | 7 ++++++- package.json | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..86929762 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.12" +before_script: + - npm install -g grunt-cli diff --git a/Gruntfile.js b/Gruntfile.js index cc71e7be..05990732 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -22,7 +22,12 @@ grunt.initConfig({ all: "resources/**" }, wordpress: (function() { - var config = require( "./config" ); + + // There's no config for CI, but we don't need one for basic testing + var config = {}; + try { + config = require( "./config" ); + } catch ( error ) {} config.dir = "dist/wordpress"; return config; })() diff --git a/package.json b/package.json index b788fab7..c1eda129 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,9 @@ "url": "https://github.com/jquery/api.jquery.com/blob/master/LICENSE.txt" } ], + "scripts": { + "test": "grunt lint" + }, "dependencies": { "grunt": "0.4.5", "grunt-jquery-content": "2.0.0" From bb24ed6b6f4e3d1983296cdd1960ce87cfad7cf2 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 21 Jun 2015 18:47:17 +0100 Subject: [PATCH 612/998] focusout: Added missing signature Closes gh-761 --- entries/focusout.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entries/focusout.xml b/entries/focusout.xml index 1029a9e5..6b633c89 100644 --- a/entries/focusout.xml +++ b/entries/focusout.xml @@ -19,6 +19,9 @@ + + 1.0 +

      This method is a shortcut for .on( "focusout", handler ) when passed arguments, and .trigger( "focusout" ) when no arguments are passed.

      The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus on descendant elements (in other words, it supports event bubbling).

      From 1f816046f94cceed3c2aaf7f6749b8b01af56489 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 21 Jun 2015 18:46:35 +0100 Subject: [PATCH 613/998] focusin: Added missing signature Closes gh-760 --- entries/focusin.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entries/focusin.xml b/entries/focusin.xml index 13c62fa5..aaff429d 100644 --- a/entries/focusin.xml +++ b/entries/focusin.xml @@ -19,8 +19,11 @@ + + 1.0 + -

      This method is a shortcut for .on('focusin', handler).

      +

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

      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.

      From 6b02de00cb399d3bad6f0035224227e09eaf38e9 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 29 Jun 2015 18:36:33 +0100 Subject: [PATCH 614/998] 1.11.104 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1eda129..82e98ffd 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": "1.11.103", + "version": "1.11.104", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b337509696d5af5185cb69f1882cbd070133fa0e Mon Sep 17 00:00:00 2001 From: Eric Lee Carraway Date: Fri, 3 Jul 2015 11:41:47 -0500 Subject: [PATCH 615/998] README: fix two typos possesive => possessive Authoritive => Authoritative Closes gh-768 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f720120c..0ded6592 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Wi #### Pronoun Usage * Use second-person pronoun ("you") when necessary, but try to avoid it. -* Favor the definite article ("the") over second-person possesive ("your"). +* Favor the definite article ("the") over second-person possessive ("your"). * **Yes**: Insert the paragraph after the unordered list. * **No**: Insert your paragraph after the unordered list. * When editing current entries, change first-person plural pronouns ("we," "our," "us") to second-person. @@ -83,5 +83,5 @@ Code in the API documentation should follow the [jQuery Core Style Guide](http:/ * Strong in English writing * Tone * Middle ground between formal and familiar. Err on the side of formality. - * Authoritive + * Authoritative * Tactful From 14b0978b44062c443e879f31fe1dfa146453e631 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Fri, 3 Jul 2015 18:52:18 +0200 Subject: [PATCH 616/998] 1.11.105 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 82e98ffd..0876a658 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": "1.11.104", + "version": "1.11.105", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From cd61b061ce6509930e4842eca21b1b4c409ec627 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Tue, 7 Jul 2015 12:22:44 +0200 Subject: [PATCH 617/998] Event.which: fix a typo Fixes jquery/jquery.com#105 Closes gh-769 --- entries/event.which.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/event.which.xml b/entries/event.which.xml index efa9cddf..1d36d527 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 MDC.

      +

      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.

      From a4e5e98b129923067bb1c0d8d659423acca89398 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Wed, 8 Jul 2015 13:37:44 +0200 Subject: [PATCH 618/998] 1.11.106 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0876a658..b9290c76 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": "1.11.105", + "version": "1.11.106", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 37fe85787de8def42f220419f9cc27c8fc7d49f4 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 24 May 2015 00:08:32 +0100 Subject: [PATCH 619/998] val: Updated description for the setter version Fixes #712 Closes gh-744 --- entries/val.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/val.xml b/entries/val.xml index 184abdad..52f2023f 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -123,7 +123,7 @@ $( "input" ) Set the value of each element in the set of matched elements.

      This method is typically used to set the values of form fields.

      -

      Passing an array of element values allows matching <input type="checkbox">, <input type="radio"> and <option>s inside of n <select multiple="multiple"> to be selected. In the case of <input type="radio">s that are part of a radio group and <select multiple="multiple"> the other elements will be deselected.

      +

      val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that don't match one of the elements of the array will be unchecked or unselected, depending on the type. In case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

      The .val() method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

      
       $( "input:text.items" ).val(function( index, value ) {
      
      From bd14b435882735362b117690683cda631a634f65 Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Sat, 28 Feb 2015 15:28:10 +0000
      Subject: [PATCH 620/998] README: Added note for the build process
      
      Added a note to troubleshoot a possible issue when running the build
      process on Windows.
      
      Closes gh-669
      ---
       README.md | 2 ++
       1 file changed, 2 insertions(+)
      
      diff --git a/README.md b/README.md
      index 0ded6592..805e0442 100644
      --- a/README.md
      +++ b/README.md
      @@ -11,6 +11,8 @@ To build and deploy your changes for previewing in a [`jquery-wp-content`](https
       
       The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com.
       
      +**Note**: If you're using Windows and you receive the error "Error" when executing the task `build-xml-entries:all`, try to add the DLL `libwinpthread-1.dll` in the root of the project.
      +
       ## Style Guidelines
       
       ### Prose Style & Grammar
      
      From 039224281affcc9d64d2475b98ac413cf5aa0217 Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Mon, 20 Jul 2015 00:53:24 +0100
      Subject: [PATCH 621/998] 1.11.107
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index b9290c76..e572fd50 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": "1.11.106",
      +  "version": "1.11.107",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation and other contributors"
      
      From 96dd835e4d2d0d67b27116223d015afbc8ebea32 Mon Sep 17 00:00:00 2001
      From: Annika Backstrom 
      Date: Fri, 24 Jul 2015 11:50:57 -0400
      Subject: [PATCH 622/998] jQuery.Callbacks: fix a typo
      
      Closes gh-783
      ---
       entries/jQuery.Callbacks.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/entries/jQuery.Callbacks.xml b/entries/jQuery.Callbacks.xml
      index 8443476b..c31de063 100644
      --- a/entries/jQuery.Callbacks.xml
      +++ b/entries/jQuery.Callbacks.xml
      @@ -38,7 +38,7 @@ callbacks.fire( "bar!" );
           

      The result of this is that it becomes simple to construct complex lists of callbacks where input values can be passed through to as many functions as needed with ease.

      Two specific methods were being used above: .add() and .fire(). The .add() method supports adding new callbacks to the callback list, while the .fire() method executes the added functions and provides a way to pass arguments to be processed by the callbacks in the same list.

      -

      Another method supported by $.Callbacks is .remove(), which has the ability to remove a particular callback from the callback list. Here"s a practical example of .remove() being used:

      +

      Another method supported by $.Callbacks is .remove(), which has the ability to remove a particular callback from the callback list. Here's a practical example of .remove() being used:

      
       var callbacks = $.Callbacks();
       callbacks.add( fn1 );
      
      From 5e0f6fa2d650ee8f88cf666064fa7dd519adcb04 Mon Sep 17 00:00:00 2001
      From: Arthur Verschaeve 
      Date: Fri, 24 Jul 2015 17:56:58 +0200
      Subject: [PATCH 623/998] 1.11.108
      
      ---
       package.json | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/package.json b/package.json
      index e572fd50..656ec6e2 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": "1.11.107",
      +  "version": "1.11.108",
         "homepage": "https://github.com/jquery/api.jquery.com",
         "author": {
           "name": "jQuery Foundation and other contributors"
      
      From 00c2ddc345c81d44b244f50e94381e3fcad22b9c Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Mon, 20 Jul 2015 01:06:12 +0100
      Subject: [PATCH 624/998] deferred.always: Added note for parameters changing
       order
      
      Fixes gh-763
      Closes gh-779
      ---
       entries/deferred.always.xml | 1 +
       1 file changed, 1 insertion(+)
      
      diff --git a/entries/deferred.always.xml b/entries/deferred.always.xml
      index 57b3cf7f..30e92193 100644
      --- a/entries/deferred.always.xml
      +++ b/entries/deferred.always.xml
      @@ -17,6 +17,7 @@
          Add handlers to be called when the Deferred object is either resolved or rejected. 
         
           

      The argument can be either a single function or an array of functions. When the Deferred is resolved or rejected, the alwaysCallbacks are called. Since deferred.always() returns the Deferred object, other methods of the Deferred object can be chained to this one, including additional .always() methods. When the Deferred is resolved or rejected, callbacks are executed in the order they were added, using the arguments provided to the resolve, reject, resolveWith or rejectWith method calls. For more information, see the documentation for Deferred object.

      +

      Note: The deferred.always() method receives the arguments that were used to .resolve() or .reject() the Deferred object, which are often very different. For this reason, it's best to use it only for actions that do not require inspecting the arguments. In all other cases, use explicit .done() or .fail() handlers since the arguments will have well-known orders.

      Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method. From 30eb320cc1007335e05e446738769449cfcca605 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 27 Jul 2015 22:07:12 +0100 Subject: [PATCH 625/998] 1.11.109 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 656ec6e2..b1480c49 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": "1.11.108", + "version": "1.11.109", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 7021a1202ef6cb5bc02838bb2bbbcd87e1e599d4 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 23 Jul 2015 23:06:37 +0200 Subject: [PATCH 626/998] Build: move redirects from the infrastucture repo Closes gh-782 --- package.json | 2 +- redirects.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 redirects.json diff --git a/package.json b/package.json index b1480c49..83004b42 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,6 @@ }, "dependencies": { "grunt": "0.4.5", - "grunt-jquery-content": "2.0.0" + "grunt-jquery-content": "2.3.0" } } diff --git a/redirects.json b/redirects.json new file mode 100644 index 00000000..2aa9b056 --- /dev/null +++ b/redirects.json @@ -0,0 +1,3 @@ +{ + "/api/": "/resources/api.xml" +} From a32c847d29a6458331246aa259f055206b2a095f Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 30 Jul 2015 22:47:49 +0200 Subject: [PATCH 627/998] 1.11.110 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83004b42..7a8d53d4 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": "1.11.109", + "version": "1.11.110", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 07b3ad769f45c0206981c51f7b2a7f8a1d54b146 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 16 Aug 2015 23:33:26 +0100 Subject: [PATCH 628/998] Added note for Global Ajax Event Handlers Fixes gh-479 Closes gh-797 --- entries/ajaxComplete.xml | 1 + entries/ajaxError.xml | 1 + entries/ajaxSend.xml | 1 + entries/ajaxStart.xml | 1 + entries/ajaxStop.xml | 1 + entries/ajaxSuccess.xml | 1 + notes.xsl | 3 +++ 7 files changed, 9 insertions(+) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 7f045973..7481f97b 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -44,6 +44,7 @@ $( document ).ajaxComplete(function( event, xhr, settings ) {

      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.xml b/entries/ajaxError.xml index d13f71e6..f674df42 100644 --- a/entries/ajaxError.xml +++ b/entries/ajaxError.xml @@ -42,6 +42,7 @@ $( document ).ajaxError(function( event, jqxhr, settings, thrownError ) { } });
      + Show a message when an Ajax request fails. diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml index 2d609b71..0678622c 100644 --- a/entries/ajaxSend.xml +++ b/entries/ajaxSend.xml @@ -42,6 +42,7 @@ $( document ).ajaxSend(function( event, jqxhr, settings ) { });
      + Show a message before an Ajax request is sent. diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml index 7747e5b6..92e6cc70 100644 --- a/entries/ajaxStart.xml +++ b/entries/ajaxStart.xml @@ -31,6 +31,7 @@ $( ".trigger" ).click(function() {

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

      As of jQuery 1.8, the .ajaxStart() method should only be attached to document.

      + Show a loading message whenever an Ajax request starts (and none is already active). diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index 76b3bffc..fc0781f6 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -31,6 +31,7 @@ $( ".trigger" ).click(function() {

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

      As of jQuery 1.8, the .ajaxStop() method should only be attached to document.

      + Hide a loading message after all the Ajax requests have stopped. diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 26583e2e..8972b24d 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -45,6 +45,7 @@ $( document ).ajaxSuccess(function( event, xhr, settings ) {

      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/notes.xsl b/notes.xsl index 33a2c073..eb5a9c61 100644 --- a/notes.xsl +++ b/notes.xsl @@ -67,6 +67,9 @@ As the .() method is just a shorthand for .on( "", handler ), detaching is possible using .off( "" ). + + As of jQuery 1.9, all the handlers for the jQuery global Ajax events, including those added with the method, must be attached to document. + From 2902fc21eebd928065e34e0292d4d034ba2b247b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 20 Aug 2015 23:34:29 +0100 Subject: [PATCH 629/998] 1.11.111 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a8d53d4..dc74663e 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": "1.11.110", + "version": "1.11.111", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b6116995a775e0666d40adf4b121aa85ba72d754 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 21 Sep 2015 20:48:26 +0100 Subject: [PATCH 630/998] Fixed many typos of the name Ajax Closes gh-810 --- entries/ajaxComplete.xml | 2 +- entries/ajaxSuccess.xml | 4 ++-- entries/jQuery.Callbacks.xml | 2 +- entries/jQuery.ajaxPrefilter.xml | 2 +- entries/jQuery.ajaxTransport.xml | 4 ++-- entries/jQuery.get.xml | 2 +- entries/jQuery.getJSON.xml | 2 +- entries/jQuery.post.xml | 4 ++-- entries/jQuery.when.xml | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 7481f97b..2c26aea3 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -42,7 +42,7 @@ $( document ).ajaxComplete(function( event, xhr, settings ) { } }); -

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

      +

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

      diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 8972b24d..40dabc01 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -38,12 +38,12 @@ $( ".trigger" ).on( "click", function() {
      
       $( document ).ajaxSuccess(function( event, xhr, settings ) {
         if ( settings.url == "ajax/test.html" ) {
      -    $( ".log" ).text( "Triggered ajaxSuccess handler. The ajax response was: " +
      +    $( ".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.

      +

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

      diff --git a/entries/jQuery.Callbacks.xml b/entries/jQuery.Callbacks.xml index c31de063..251bc111 100644 --- a/entries/jQuery.Callbacks.xml +++ b/entries/jQuery.Callbacks.xml @@ -259,7 +259,7 @@ dfd.done( topic.publish ); // Here the Deferred is being resolved with a message // that will be passed back to subscribers. It's possible to // easily integrate this into a more complex routine -// (eg. waiting on an ajax call to complete) so that +// (eg. waiting on an Ajax call to complete) so that // messages are only published once the task has actually // finished. dfd.resolve( "it's been published!" ); diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml index eb762dfb..f82d8d02 100644 --- a/entries/jQuery.ajaxPrefilter.xml +++ b/entries/jQuery.ajaxPrefilter.xml @@ -24,7 +24,7 @@ $.ajaxPrefilter(function( options, originalOptions, jqXHR ) {

      where:

      • options are the request options
      • -
      • originalOptions are the options as provided to the ajax method, unmodified and, thus, without defaults from ajaxSettings
      • +
      • originalOptions are the options as provided to the $.ajax() method, unmodified and, thus, without defaults from ajaxSettings
      • jqXHR is the jqXHR object of the request

      Prefilters are a perfect fit when custom options need to be handled. Given the following code, for example, a call to $.ajax() would automatically abort a request to the same URL if the custom abortOnRetry option is set to true:

      diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml index ab8e4d9b..93bcbf77 100644 --- a/entries/jQuery.ajaxTransport.xml +++ b/entries/jQuery.ajaxTransport.xml @@ -35,10 +35,10 @@ $.ajaxTransport( dataType, function( options, originalOptions, jqXHR ) {

      where:

      • options are the request options
      • -
      • originalOptions are the options as provided to the ajax method, unmodified and, thus, without defaults from ajaxSettings
      • +
      • originalOptions are the options as provided to the $.ajax() method, unmodified and, thus, without defaults from ajaxSettings
      • jqXHR is the jqXHR object of the request
      • headers is an object of (key-value) request headers that the transport can transmit if it supports it
      • -
      • completeCallback is the callback used to notify ajax of the completion of the request
      • +
      • completeCallback is the callback used to notify Ajax of the completion of the request

      completeCallback has the following signature:

      
      diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
      index 51b50c64..c3f18cac 100644
      --- a/entries/jQuery.get.xml
      +++ b/entries/jQuery.get.xml
      @@ -49,7 +49,7 @@ $.get( "ajax/test.html", function( data ) {
           

      This example fetches the requested HTML snippet and inserts it on the page.

      The jqXHR Object

      -

      As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

      +

      As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

      The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

      
       // Assign handlers immediately after making the request,
      diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
      index 97c8b0a9..23ad5c2d 100644
      --- a/entries/jQuery.getJSON.xml
      +++ b/entries/jQuery.getJSON.xml
      @@ -61,7 +61,7 @@ $.getJSON( "ajax/test.json", function( data ) {
           

      JSONP

      If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

      The jqXHR Object

      -

      As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

      +

      As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

      The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.getJSON(), to chain multiple .done(), .always(), and .fail() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

      
       // Assign handlers immediately after making the request,
      diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
      index 8a1bdc43..982b28c7 100644
      --- a/entries/jQuery.post.xml
      +++ b/entries/jQuery.post.xml
      @@ -100,7 +100,7 @@ $.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } );
       ]]>
         
         
      -    Send form data using ajax requests
      +    Send form data using Ajax requests
           
      @@ -132,7 +132,7 @@ $.post( "test.php", { func: "getNameAndTime" }, function( data ) {
       ]]>
         
         
      -    Post a form using ajax and put results in a div
      +    Post a form using Ajax and put results in a div
           1.0
         
         
      -    

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

      This method is a shortcut for .on( "dblclick", handler ) in the first two variations, and .trigger( "dblclick" ) in the third. The dblclick event is sent to an element when the element is double-clicked. Any HTML element can receive this event. For example, consider the HTML:

      
      
      From 51383334dcb3b53107ceea3cc5674bc72eee718e Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Mon, 21 Sep 2015 01:48:21 +0100
      Subject: [PATCH 632/998] Dblclick: Minor improvements to wording
      
      Closes gh-808
      ---
       entries/dblclick.xml | 4 ++--
       1 file changed, 2 insertions(+), 2 deletions(-)
      
      diff --git a/entries/dblclick.xml b/entries/dblclick.xml
      index 6287b4cb..df7a5ae4 100644
      --- a/entries/dblclick.xml
      +++ b/entries/dblclick.xml
      @@ -47,7 +47,7 @@ $( "#target" ).dblclick(function() {
           

      Handler for .dblclick() called.

      -

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

      +

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

      
       $( "#other" ).click(function() {
         $( "#target" ).dblclick();
      @@ -66,7 +66,7 @@ $( "#other" ).click(function() {
         
         
         
      -    To bind a "Hello World!" alert box the dblclick event on every paragraph on the page:
      +    To bind a "Hello World!" alert box to the dblclick event on every paragraph on the page:
           
           

      Duration

      Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The default duration is 400 milliseconds. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

      -

      Complete Function

      -

      If supplied, the complete callback function is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, the callback is executed once per matched element, not once for the animation as a whole.

      +

      Callback Functions

      +

      If supplied, the start, step, progress, complete, done, fail, and always callbacks are called on a per-element basis; this is set to the DOM element being animated. If no elements are in the set, no callbacks are called. If multiple elements are animated, the callback is executed once per matched element, not once for the animation as a whole. Use the .promise() method to obtain a promise to which you can attach callbacks that fire once for an animated set of any size, including zero elements.

      Basic Usage

      To animate any element, such as a simple image:

      
      diff --git a/includes/complete-argument.xml b/includes/complete-argument.xml
      index 042fdf45..5d109f39 100644
      --- a/includes/complete-argument.xml
      +++ b/includes/complete-argument.xml
      @@ -1,4 +1,4 @@
       
       
      -	A function to call once the animation is complete.
      +	A function to call once the animation is complete, called once per matched element.
       
      diff --git a/includes/options-argument.xml b/includes/options-argument.xml
      index f62a8585..168e8648 100644
      --- a/includes/options-argument.xml
      +++ b/includes/options-argument.xml
      @@ -41,17 +41,17 @@
       		
       	
       	
      -		A function to call once the animation is complete.
      +		A function that is called once the animation on an element is complete.
       		
       	
       	
      -		A function to call when the animation begins.
      +		A function to call when the animation on an element begins.
       		
       			An enhanced Promise object with additional properties for the animation
       		
       	
       	
      -		A function to be called when the animation completes (its Promise object is resolved).
      +		A function to be called when the animation on an element completes (its Promise object is resolved).
       		
       			An enhanced Promise object with additional properties for the animation
       		
      @@ -60,7 +60,7 @@
       		
       	
       	
      -		A function to be called when the animation fails to complete (its Promise object is rejected).
      +		A function to be called when the animation on an element fails to complete (its Promise object is rejected).
       		
       			An enhanced Promise object with additional properties for the animation
       		
      @@ -69,7 +69,7 @@
       		
       	
       	
      -		A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected).
      +		A function to be called when the animation on an element completes or stops without completing (its Promise object is either resolved or rejected).
       		
       			An enhanced Promise object with additional properties for the animation
       		
      
      From be7c028a49986e94cec51481b06fcac1a23191bb Mon Sep 17 00:00:00 2001
      From: Andy Li 
      Date: Mon, 7 Sep 2015 17:29:27 +0800
      Subject: [PATCH 634/998] Events: Completed the list of copied properties
      
      Closes gh-802
      ---
       categories.xml | 2 +-
       1 file changed, 1 insertion(+), 1 deletion(-)
      
      diff --git a/categories.xml b/categories.xml
      index d4941b0e..d43d8929 100644
      --- a/categories.xml
      +++ b/categories.xml
      @@ -143,7 +143,7 @@ jQuery( "body" ).trigger( e );
                   

    The following properties are also copied to the event object, though some of their values may be undefined depending on the event:

    -

    altKey, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, view, which

    +

    altKey, bubbles, button, buttons, cancelable, char, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, key, keyCode, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, toElement, view, which

    OtherProperties

    Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

    Example:

    From 4746900942a4ccc7bd2463c1913aedc18bc03905 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 21 Sep 2015 23:36:00 +0100 Subject: [PATCH 635/998] 1.11.112 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc74663e..ca35e147 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": "1.11.111", + "version": "1.11.112", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ea616380521f9e47a222a1179218308a26068f21 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 22 Jan 2015 06:39:04 +0000 Subject: [PATCH 636/998] Error: Improved image example Fixes gh-413 Closes gh-630 --- entries/error.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/entries/error.xml b/entries/error.xml index 2b3ba94c..0fcb1810 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -34,22 +34,23 @@ $( "#book" ) }) .attr( "src", "missing.png" );
    -

    If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed:

    +

    If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed:

    Handler for .error() called.

    -

    The event handler must be attached before the browser fires the error event, which is why the example sets the src attribute after attaching the handler. Also, the error event may not be correctly fired when the page is served locally; error relies on HTTP status codes and will generally not be triggered if the URL uses the file: protocol.

    +

    The event handler must be attached before the browser fires the error event, which is why the example sets the src attribute after attaching the handler. Also, the error event may not be correctly fired when the page is served locally; error relies on HTTP status codes and will generally not be triggered if the URL uses the file: protocol.

    -

    Note: A jQuery error event handler should not be attached to the window object. The browser fires the window's error event when a script error occurs. However, the window error event receives different arguments and has different return value requirements than conventional event handlers. Use window.onerror instead.

    +

    Note: A jQuery error event handler should not be attached to the window object. The browser fires the window's error event when a script error occurs. However, the window error event receives different arguments and has different return value requirements than conventional event handlers. Use window.onerror instead.

    - To hide the "broken image" icons for IE users, you can try: + To replace all the missing images with another, you can update the src attribute inside the callback passed to .error(). Be sure that the replacement image exists; otherwise the error event will be triggered indefinitely. From e25e39538f0dfa6cd46e33255fb99252254d176b Mon Sep 17 00:00:00 2001 From: Dmitry Gorelenkov Date: Fri, 28 Aug 2015 19:34:30 +0200 Subject: [PATCH 637/998] jQuery.grep: Argument can be an Array-like object Closes gh-801 --- entries/jQuery.grep.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.grep.xml b/entries/jQuery.grep.xml index 245a672d..5195ffdd 100644 --- a/entries/jQuery.grep.xml +++ b/entries/jQuery.grep.xml @@ -4,8 +4,8 @@ Finds the elements of an array which satisfy a filter function. The original array is not affected. 1.0 - - The array to search through. + + The array-like object to search through. From f7e567fac4cbfbce6764f106df29203c65105c1a Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 19 Oct 2015 00:32:12 +0100 Subject: [PATCH 638/998] isNumeric: argument can be anything Closes gh-818 --- entries/jQuery.isNumeric.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index 80edc02d..c6ec81e8 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -4,7 +4,7 @@ Determines whether its argument is a number. 1.7 - + The value to be tested. From da5ec3328c7d9929df5ab488dfe4a504eb75d696 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 21 Sep 2015 01:44:34 +0100 Subject: [PATCH 639/998] Added page about the contextmenu() alias Fixes gh-806 Closes gh-807 --- entries/contextmenu.xml | 86 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 entries/contextmenu.xml diff --git a/entries/contextmenu.xml b/entries/contextmenu.xml new file mode 100644 index 00000000..0c846169 --- /dev/null +++ b/entries/contextmenu.xml @@ -0,0 +1,86 @@ + + + .contextmenu() + Bind an event handler to the "contextmenu" JavaScript 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 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. Any HTML element can receive this event. + For example, consider the HTML:

    +
    
    +<div id="target">
    +  Right-click here
    +</div>
    +    
    +

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

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

    Now right-clicking on this element displays the alert:

    +

    + Handler for .contextmenu() called. +

    +

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

    +
    
    +$( "#target" ).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. + + + + + + + +
    From d347186c65f26e5432649498202b954297b501b2 Mon Sep 17 00:00:00 2001 From: Eric Lee Carraway Date: Tue, 3 Nov 2015 21:30:47 -0500 Subject: [PATCH 640/998] Docs(entries): Fix typos. Closes gh-827. --- entries/contents.xml | 2 +- entries/jQuery.ajax.xml | 4 ++-- entries/jQuery.ajaxTransport.xml | 2 +- entries/on.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/entries/contents.xml b/entries/contents.xml index 6f348b9b..5bfe9fc6 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -50,7 +50,7 @@ $( "p" ) ]]>
    - Change the background colour of links inside of an iframe. + Change the background color of links inside of an iframe. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 4c8f6686..81e3e42c 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -318,7 +318,7 @@ jqxhr.always(function() {

    As of jQuery 1.5, jQuery's Ajax implementation includes prefilters, transports, and converters that allow you to extend Ajax with a great deal of flexibility.

    Using Converters

    -

    $.ajax() converters support mapping data types to other data types. If, however, you want to map a custom data type to a known type (e.g json), you must add a correspondance between the response Content-Type and the actual data type using the contents option:

    +

    $.ajax() converters support mapping data types to other data types. If, however, you want to map a custom data type to a known type (e.g json), you must add a correspondence between the response Content-Type and the actual data type using the contents option:

    
     $.ajaxSetup({
       contents: {
    @@ -332,7 +332,7 @@ $.ajaxSetup({
       }
     });
         
    -

    This extra object is necessary because the response Content-Types and data types never have a strict one-to-one correspondance (hence the regular expression).

    +

    This extra object is necessary because the response Content-Types and data types never have a strict one-to-one correspondence (hence the regular expression).

    To convert from a supported type (e.g text, json) to a custom data type and back again, use another pass-through converter:

    
     $.ajaxSetup({
    diff --git a/entries/jQuery.ajaxTransport.xml b/entries/jQuery.ajaxTransport.xml
    index 93bcbf77..ccc73ce8 100644
    --- a/entries/jQuery.ajaxTransport.xml
    +++ b/entries/jQuery.ajaxTransport.xml
    @@ -48,7 +48,7 @@ function( status, statusText, responses, headers ) {}
         
    • status is the HTTP status code of the response, like 200 for a typical success, or 404 for when the resource is not found.
    • statusText is the statusText of the response.
    • -
    • responses (Optional) is An object containing dataType/value that contains the response in all the formats the transport could provide (for instance, a native XMLHttpRequest object would set reponses to { xml: XMLData, text: textData } for a response that is an XML document)
    • +
    • responses (Optional) is An object containing dataType/value that contains the response in all the formats the transport could provide (for instance, a native XMLHttpRequest object would set responses to { xml: XMLData, text: textData } for a response that is an XML document)
    • headers (Optional) is a string containing all the response headers if the transport has access to them (akin to what XMLHttpRequest.getAllResponseHeaders() would provide).

    Just like prefilters, a transport's factory function can be attached to a specific dataType:

    diff --git a/entries/on.xml b/entries/on.xml index 9a7e66ed..34d14f4e 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -34,7 +34,7 @@

    The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()

    Event names and namespaces

    -

    Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon chraracters.

    +

    Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon characters.

    An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces beginning with an underscore are reserved for jQuery's use.

    In the second form of .on(), the events argument is a plain object. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

    Direct and delegated events

    From 320265a67851969e02837b88f14802d93ef8e7fc Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Tue, 3 Nov 2015 21:39:51 -0500 Subject: [PATCH 641/998] Release 1.11.113 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca35e147..f9206b26 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": "1.11.112", + "version": "1.11.113", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1cb336132d804c87f8a580c65e9d79b45e3730c9 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sat, 31 Oct 2015 13:15:53 +0000 Subject: [PATCH 642/998] Error: Added deprecation note Closes gh-824 --- entries/error.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/error.xml b/entries/error.xml index 0fcb1810..872ff70d 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -21,6 +21,7 @@

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

    +

    As of jQuery 1.8, the .error() method is deprecated. Use .on( "error", handler ) to attach event handlers to the error event instead.

    The error event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly.

    For example, consider a page with a simple image element:

    
    
    From 306ec8135a911c0b925ad4397f550864cf7e193c Mon Sep 17 00:00:00 2001
    From: Karl Swedberg 
    Date: Wed, 2 Dec 2015 10:01:39 -0500
    Subject: [PATCH 643/998] Add 
    and
    for longdesc imgs --- entries/animate.xml | 10 ++++++++-- entries/click.xml | 5 +++-- entries/dblclick.xml | 5 +++-- entries/fadeIn.xml | 13 +++++++------ entries/fadeOut.xml | 13 +++++++------ entries/fadeTo.xml | 13 +++++++------ entries/height.xml | 5 +++-- entries/hide.xml | 12 ++++++------ entries/innerHeight.xml | 5 +++-- entries/innerWidth.xml | 5 +++-- entries/mousedown.xml | 5 +++-- entries/mouseenter.xml | 5 +++-- entries/mouseleave.xml | 5 +++-- entries/mouseout.xml | 5 +++-- entries/mouseover.xml | 5 +++-- entries/mouseup.xml | 5 +++-- entries/outerHeight.xml | 5 +++-- entries/outerWidth.xml | 9 +++++---- entries/scroll.xml | 5 +++-- entries/show.xml | 13 +++++++------ entries/slideDown.xml | 13 +++++++------ entries/slideToggle.xml | 26 ++++++++++++++------------ entries/slideUp.xml | 13 +++++++------ entries/toggle.xml | 26 ++++++++++++++------------ entries/width.xml | 5 +++-- 25 files changed, 131 insertions(+), 100 deletions(-) diff --git a/entries/animate.xml b/entries/animate.xml index 11477c2a..f138bc4d 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -56,12 +56,18 @@ $( "#clickme" ).click(function() { });

    - +

    + +
    figure 1
    +

    Note that the target value of the height property is 'toggle'. Since the image was visible before, the animation shrinks the height to 0 to hide it. A second click then reverses this transition:

    - +

    + +
    figure 2
    +

    The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

    Directional properties (top, right, bottom, left) have no discernible effect on elements if their position style property is static, which it is by default.

    diff --git a/entries/click.xml b/entries/click.xml index 206edf99..c6e9b168 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -34,9 +34,10 @@ Trigger the handler </div>
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any <div>:

    
     $( "#target" ).click(function() {
    diff --git a/entries/dblclick.xml b/entries/dblclick.xml
    index df7a5ae4..54962191 100644
    --- a/entries/dblclick.xml
    +++ b/entries/dblclick.xml
    @@ -34,9 +34,10 @@
       Trigger the handler
     </div>
         
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any <div>:

    
     $( "#target" ).dblclick(function() {
    diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml
    index 819e663e..628e7e73 100644
    --- a/entries/fadeIn.xml
    +++ b/entries/fadeIn.xml
    @@ -35,12 +35,13 @@ $( "#clickme" ).click(function() {
       });
     });
         
    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index 28228979..cfd1c6ae 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -36,12 +36,13 @@ $( "#clickme" ).click(function() { }); });
    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

    diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml index 5ce98458..ca382b0c 100644 --- a/entries/fadeTo.xml +++ b/entries/fadeTo.xml @@ -50,12 +50,13 @@ $( "#clickme" ).click(function() { }); });
    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    With duration set to 0, this method just changes the opacity CSS property, so .fadeTo( 0, opacity ) is the same as .css( "opacity", opacity ).

    diff --git a/entries/height.xml b/entries/height.xml index 7efdf312..548af238 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -9,9 +9,10 @@ Get the current computed height for the first element in the set of matched elements.

    The difference between .css( "height" ) and .height() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .height() method is recommended when an element's height needs to be used in a mathematical calculation.

    -

    +

    -

    +
    figure 1
    +

    This method is also able to find the height of the window and document.

    
     // Returns height of browser viewport
    diff --git a/entries/hide.xml b/entries/hide.xml
    index cfe38a29..1a0093d5 100644
    --- a/entries/hide.xml
    +++ b/entries/hide.xml
    @@ -52,12 +52,12 @@ $( "#clickme" ).click(function() {
       });
     });
         
    -

    - - - - -

    +
    + + + + +
    diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index 294666c2..b962c231 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -11,9 +11,10 @@

    This method returns the height of the element, including top and bottom padding, in pixels.

    This method is not applicable to window and document objects; for these, use .height() instead.

    -

    +

    -

    +
    figure 1
    +
    diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index e98529d3..fbfd5df5 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -10,9 +10,10 @@

    This method returns the width of the element, including left and right padding, in pixels.

    This method is not applicable to window and document objects; for these, use .width() instead.

    -

    +

    -

    +
    figure 1
    +
    diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 9b1105d0..6217be54 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -33,9 +33,10 @@ Trigger the handler </div> -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any <div>:

    
     $( "#target" ).mousedown(function() {
    diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml
    index 6985f396..de72455d 100644
    --- a/entries/mouseenter.xml
    +++ b/entries/mouseenter.xml
    @@ -37,9 +37,10 @@
       Trigger the handler
     </div>
     <div id="log"></div>
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any element:

    
     $( "#outer" ).mouseenter(function() {
    diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml
    index 56adcb65..23508900 100644
    --- a/entries/mouseleave.xml
    +++ b/entries/mouseleave.xml
    @@ -37,9 +37,10 @@
       Trigger the handler
     </div>
     <div id="log"></div>
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any element:

    
     $( "#outer" ).mouseleave(function() {
    diff --git a/entries/mouseout.xml b/entries/mouseout.xml
    index bcdece5b..09c63aab 100644
    --- a/entries/mouseout.xml
    +++ b/entries/mouseout.xml
    @@ -38,9 +38,10 @@
     </div>
     <div id="log"></div>
         
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any element:

    
     $( "#outer" ).mouseout(function() {
    diff --git a/entries/mouseover.xml b/entries/mouseover.xml
    index f2ca8c02..5d4415da 100644
    --- a/entries/mouseover.xml
    +++ b/entries/mouseover.xml
    @@ -38,9 +38,10 @@
     </div>
     <div id="log"></div>
         
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any element:

    
     $( "#outer" ).mouseover(function() {
    diff --git a/entries/mouseup.xml b/entries/mouseup.xml
    index 31640a96..8fb2122b 100644
    --- a/entries/mouseup.xml
    +++ b/entries/mouseup.xml
    @@ -34,9 +34,10 @@
       Trigger the handler
     </div>
     
    -

    +

    -

    +
    figure 1
    +

    The event handler can be bound to any <div>:

    
     $( "#target" ).mouseup(function() {
    diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml
    index bdd1bd7f..6a14fd7d 100644
    --- a/entries/outerHeight.xml
    +++ b/entries/outerHeight.xml
    @@ -13,9 +13,10 @@
       
         

    The top and bottom padding and border are always included in the .outerHeight() calculation; if the includeMargin argument is set to true, the margin (top and bottom) is also included.

    This method is not applicable to window and document objects; for these, use .height() instead.

    -

    +

    -

    +
    figure 1
    +
    diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index a6ab2247..f39fe926 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -14,9 +14,10 @@

    Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.

    If includeMargin is omitted or false, the padding and border are included in the calculation; if true, the margin is also included.

    This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

    -

    +

    -

    +
    figure 1
    +
    @@ -63,7 +64,7 @@ $( "p:last" ).text(

    When calling .outerWidth(value), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used (such as 100px, 50%, or auto).

    - + Change the outer width of each div the first time it is clicked (and change its color). - + diff --git a/entries/scroll.xml b/entries/scroll.xml index 8597018b..1a0e9cbd 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -43,9 +43,10 @@ <div id="log"></div>

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

    -

    +

    -

    +
    figure 1
    +

    The scroll event handler can be bound to this element:

    
     $( "#target" ).scroll(function() {
    diff --git a/entries/show.xml b/entries/show.xml
    index f0745958..60974469 100644
    --- a/entries/show.xml
    +++ b/entries/show.xml
    @@ -53,12 +53,13 @@ $( "#clickme" ).click(function() {
       });
     });
         
    -

    - - - - -

    +
    + + + + +
    figure 1
    +
    diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 01a14e03..204a9372 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -36,12 +36,13 @@ $( "#clickme" ).click(function() { }); });
    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml index e3c3d474..d6cd26b0 100644 --- a/entries/slideToggle.xml +++ b/entries/slideToggle.xml @@ -37,19 +37,21 @@ $( "#clickme" ).click(function() { });

    With the element initially shown, we can hide it slowly with the first click:

    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    A second click will show the element once again:

    -

    - - - - -

    +
    + + + + +
    figure 2
    +

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    diff --git a/entries/slideUp.xml b/entries/slideUp.xml index 345d3c4f..3ecc8feb 100644 --- a/entries/slideUp.xml +++ b/entries/slideUp.xml @@ -36,12 +36,13 @@ $( "#clickme" ).click(function() { }); }); -

    - - - - -

    +
    + + + + +
    figure 1
    +

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    Callback Function

    diff --git a/entries/toggle.xml b/entries/toggle.xml index 87cc15ce..26f85aa0 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -59,19 +59,21 @@ $( "#clickme" ).click(function() {

    With the element initially shown, we can hide it slowly with the first click:

    -

    - - - - -

    +
    + + + + +
    figure 1
    +

    A second click will show the element once again:

    -

    - - - - -

    +
    + + + + +
    figure 2
    +

    The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:

    
    diff --git a/entries/width.xml b/entries/width.xml
    index 11fc2ebf..abc8aff3 100644
    --- a/entries/width.xml
    +++ b/entries/width.xml
    @@ -9,9 +9,10 @@
         Get the current computed width for the first element in the set of matched elements.
         
           

    The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation.

    -

    +

    -

    +
    figure 1
    +

    This method is also able to find the width of the window and document.

    
     // Returns width of browser viewport
    
    From 69e0e2ac4b9f19433c8d491b3772eec8c558111b Mon Sep 17 00:00:00 2001
    From: Anne-Gaelle Colom 
    Date: Wed, 2 Dec 2015 21:08:32 +0000
    Subject: [PATCH 644/998] 1.11.114
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index f9206b26..673192ac 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": "1.11.113",
    +  "version": "1.11.114",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 8e70d52f767f2ffb92beb884752579db6483ceda Mon Sep 17 00:00:00 2001
    From: Andy Li 
    Date: Sun, 13 Dec 2015 01:10:38 +0800
    Subject: [PATCH 645/998] index: Document return value as integer
    
    Closes gh-845
    ---
     entries/index.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/index.xml b/entries/index.xml
    index ecd46243..efcde43c 100644
    --- a/entries/index.xml
    +++ b/entries/index.xml
    @@ -1,5 +1,5 @@
     
    -
    +
       .index()
       
         1.4
    
    From d1e8d47ea5089aa88768568adce4d11c8db7c1f5 Mon Sep 17 00:00:00 2001
    From: Nabil Kadimi 
    Date: Sun, 6 Dec 2015 22:11:13 +0000
    Subject: [PATCH 646/998] event.stopPropagation: Minor improvement
    
    Closes gh-844
    ---
     entries/event.stopPropagation.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/event.stopPropagation.xml b/entries/event.stopPropagation.xml
    index 923b9587..adf4ea10 100644
    --- a/entries/event.stopPropagation.xml
    +++ b/entries/event.stopPropagation.xml
    @@ -7,7 +7,7 @@
       Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
       
         

    We can use event.isPropagationStopped() to determine if this method was ever called (on that event object).

    -

    This method works for custom events triggered with trigger(), as well.

    +

    This method works for custom events triggered with trigger() as well.

    Note that this will not prevent other handlers on the same element from running.

    From b023cc01bb213ca3bd15dff6c4bcfc07c9664125 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 6 Oct 2015 21:20:20 +0100 Subject: [PATCH 647/998] Document that addClass and removeClass change the property Fixes gh-312 Closes gh-813 --- entries/addClass.xml | 1 + entries/removeClass.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/entries/addClass.xml b/entries/addClass.xml index 476251d8..69274708 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -19,6 +19,7 @@ Adds the specified class(es) to each element in the set of matched elements.

    It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

    +

    The .addClass() method manipulates the className property of the selected elements, not the class attribute. Once the property is changed, it's the browser that updates the attribute accordingly. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).

    More than one class may be added at a time, separated by a space, to the set of matched elements, like so:

    
     $( "p" ).addClass( "myClass yourClass" );
    diff --git a/entries/removeClass.xml b/entries/removeClass.xml
    index 8bb11196..3263e3a3 100644
    --- a/entries/removeClass.xml
    +++ b/entries/removeClass.xml
    @@ -19,6 +19,7 @@
       Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
       
         

    If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.

    +

    The .removeClass() method manipulates the className property of the selected elements, not the class attribute. Once the property is changed, it's the browser that updates the attribute accordingly. This means that when the class attribute is updated and the last class name is removed, the browser may set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).

    More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

    
     $( "p" ).removeClass( "myClass yourClass" )
    
    From 6f9531167072d3e39aafb32804f8cb94c1d39634 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Mon, 21 Sep 2015 00:57:52 +0100
    Subject: [PATCH 648/998] Moved note about Global Ajax events to notes.xsl
    
    Fixes gh-798
    Closes gh-805
    ---
     entries/ajaxComplete.xml | 1 -
     entries/ajaxError.xml    | 1 -
     entries/ajaxSend.xml     | 1 -
     entries/ajaxStart.xml    | 1 -
     entries/ajaxStop.xml     | 1 -
     entries/ajaxSuccess.xml  | 1 -
     6 files changed, 6 deletions(-)
    
    diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml
    index 2c26aea3..33705e53 100644
    --- a/entries/ajaxComplete.xml
    +++ b/entries/ajaxComplete.xml
    @@ -32,7 +32,6 @@ $( ".trigger" ).click(function() {
     });
         

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

    -

    As of jQuery 1.8, the .ajaxComplete() method should only be attached to document.

    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 ) {
    diff --git a/entries/ajaxError.xml b/entries/ajaxError.xml
    index f674df42..19abee09 100644
    --- a/entries/ajaxError.xml
    +++ b/entries/ajaxError.xml
    @@ -33,7 +33,6 @@ $( "button.trigger" ).on( "click", function() {
     });
         

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

    -

    As of jQuery 1.8, the .ajaxError() method should only be attached to document.

    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 ) {
    diff --git a/entries/ajaxSend.xml b/entries/ajaxSend.xml
    index 0678622c..db814fee 100644
    --- a/entries/ajaxSend.xml
    +++ b/entries/ajaxSend.xml
    @@ -32,7 +32,6 @@ $( ".trigger" ).click(function() {
     });
         

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

    -

    As of jQuery 1.8, the .ajaxSend() method should only be attached to document.

    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 ) {
    diff --git a/entries/ajaxStart.xml b/entries/ajaxStart.xml
    index 92e6cc70..bf7fc14a 100644
    --- a/entries/ajaxStart.xml
    +++ b/entries/ajaxStart.xml
    @@ -29,7 +29,6 @@ $( ".trigger" ).click(function() {
     });
         

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

    -

    As of jQuery 1.8, the .ajaxStart() method should only be attached to document.

    diff --git a/entries/ajaxStop.xml b/entries/ajaxStop.xml index fc0781f6..073dd208 100644 --- a/entries/ajaxStop.xml +++ b/entries/ajaxStop.xml @@ -29,7 +29,6 @@ $( ".trigger" ).click(function() { });

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

    -

    As of jQuery 1.8, the .ajaxStop() method should only be attached to document.

    diff --git a/entries/ajaxSuccess.xml b/entries/ajaxSuccess.xml index 40dabc01..840ec028 100644 --- a/entries/ajaxSuccess.xml +++ b/entries/ajaxSuccess.xml @@ -33,7 +33,6 @@ $( ".trigger" ).on( "click", function() { });

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

    -

    As of jQuery 1.8, the .ajaxSuccess() method should only be attached to document.

    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 ) {
    
    From db305e638f5142decaa4e962e70cd8de89cbca8b Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Tue, 15 Dec 2015 10:26:52 +0000
    Subject: [PATCH 649/998] Note that Types page is not a comprehensive guide
    
    Fixes gh-832
    Closes gh-850
    ---
     pages/Types.html | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/pages/Types.html b/pages/Types.html
    index 18e0ee5b..fbf2bf80 100644
    --- a/pages/Types.html
    +++ b/pages/Types.html
    @@ -9,7 +9,7 @@
     ol ul li { font-size: 1em !important; }
     ol ul { margin-left: 1.5em !important; }
     
    -

    JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and all and everything you wanted to know about Functions. +

    JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and some concepts you need to know about Functions. If you want to study these concepts in depth, take a look at MDN.

    You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox).

    From 4cd3452c32196332fd72c03f571b6a8afdc91e43 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Wed, 16 Dec 2015 00:22:40 +0000 Subject: [PATCH 650/998] Added performance warning to show and hide Fixes gh-816 Closes gh-852 --- entries/hide.xml | 3 +++ entries/show.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/entries/hide.xml b/entries/hide.xml index 1a0093d5..91916a8e 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -37,6 +37,9 @@ $( ".target" ).hide();

    Note that .hide() is fired immediately and will override the animation queue if no duration or a duration of 0 is specified.

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    +
    +

    Note: This method may cause performance issues, especially when used on many elements. If you're encountering such issues, use performance testing tools to determine whether this method is causing them. Moreover, this method can cause problems with responsive layouts if the display value differs at different viewport sizes.

    +

    We can animate any element, such as a simple image:

    
     <div id="clickme">
    diff --git a/entries/show.xml b/entries/show.xml
    index 60974469..b6f38e13 100644
    --- a/entries/show.xml
    +++ b/entries/show.xml
    @@ -40,6 +40,9 @@ $( ".target" ).show();
         

    Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

    +
    +

    Note: This method may cause performance issues, especially when used on many elements. If you're encountering such issues, use performance testing tools to determine whether this method is causing them. Moreover, this method can cause problems with responsive layouts if the display value differs at different viewport sizes.

    +

    We can animate any element, such as a simple image:

    
     <div id="clickme">
    
    From c000f3fb055f7f6611802c1a78b1221ed30791cb Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Mon, 14 Dec 2015 20:56:49 +0000
    Subject: [PATCH 651/998] Note that :visible is the opposite of :hidden
    
    Fixes gh-838
    Closes gh-848
    ---
     entries/hidden-selector.xml  | 1 +
     entries/visible-selector.xml | 1 +
     2 files changed, 2 insertions(+)
    
    diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml
    index 6712c736..2c2e6e2c 100644
    --- a/entries/hidden-selector.xml
    +++ b/entries/hidden-selector.xml
    @@ -16,6 +16,7 @@
         
         

    Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

    Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    +

    This selector is the opposite of the :visible selector. So, every element selected by :hidden isn't selected by :visible and vice versa.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index c1050ab5..25df8ee7 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -10,6 +10,7 @@

    Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.

    Elements with visibility: hidden or opacity: 0 are considered visible, since they still consume space in the layout.

    Elements that are not in a document are considered hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

    +

    This selector is the opposite of the :hidden selector. So, every element selected by :visible isn't selected by :hidden and vice versa.

    All option elements are considered hidden, regardless of their selected state.

    During animations that hide an element, the element is considered visible until the end of the animation. During animations to show an element, the element is considered visible at the start at the animation.

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    From 68cb1c6ef1ba835486ef0e9e664a72e3fa9f21f2 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Wed, 16 Dec 2015 18:27:07 +0000 Subject: [PATCH 652/998] 1.11.116 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 673192ac..14b6ded5 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": "1.11.114", + "version": "1.11.116", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From aab36ba0238c3c6f48ffcbc164da2789ccb55e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Dec 2015 13:24:04 -0500 Subject: [PATCH 653/998] Build: Upgrade to grunt-jquery-content 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14b6ded5..fc919412 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,6 @@ }, "dependencies": { "grunt": "0.4.5", - "grunt-jquery-content": "2.3.0" + "grunt-jquery-content": "3.0.0" } } From b49f84466b890e476f4427a0b9029e22302fd175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 17 Dec 2015 13:24:13 -0500 Subject: [PATCH 654/998] 1.11.117 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc919412..25fab7fc 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": "1.11.116", + "version": "1.11.117", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a232f008344f25ce53b9f1b8a217890f6009d13b Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Sat, 19 Dec 2015 15:33:53 -0500 Subject: [PATCH 655/998] attr: Document attr(key, null) to remove attribute Fixes gh-523 Closes gh-853 --- entries/attr.xml | 3 ++- pages/Types.html | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/entries/attr.xml b/entries/attr.xml index 203c61c8..40c94de1 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -147,7 +147,8 @@ The title of the emphasis is:
    - A value to set for the attribute. + + A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). diff --git a/pages/Types.html b/pages/Types.html index fbf2bf80..4890df38 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -432,6 +432,9 @@

    PlainObject

    jQuery.isPlainObject( o ); // true
    +

    Null

    +

    The null keyword is a JavaScript literal that is commonly used to express the absence of an intentional value.

    +

    Date

    The Date type is a JavaScript object that represents a single moment in time. Date objects are instantiated using their constructor function, which by default creates an object that represents the current date and time.

    From 8868adde30a83bcef6e63f83f06e8c0a0c446780 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Thu, 3 Dec 2015 08:39:59 +0000 Subject: [PATCH 656/998] Entries: Added description to Figures Closes gh-842 --- entries/animate.xml | 4 ++-- entries/click.xml | 2 +- entries/dblclick.xml | 2 +- entries/fadeIn.xml | 2 +- entries/fadeOut.xml | 2 +- entries/fadeTo.xml | 2 +- entries/height.xml | 2 +- entries/hide.xml | 1 + entries/innerHeight.xml | 2 +- entries/innerWidth.xml | 2 +- entries/mousedown.xml | 2 +- entries/mouseenter.xml | 2 +- entries/mouseleave.xml | 2 +- entries/mouseout.xml | 2 +- entries/mouseover.xml | 2 +- entries/mouseup.xml | 2 +- entries/outerHeight.xml | 2 +- entries/outerWidth.xml | 2 +- entries/scroll.xml | 2 +- entries/show.xml | 2 +- entries/slideDown.xml | 2 +- entries/slideToggle.xml | 4 ++-- entries/slideUp.xml | 2 +- entries/toggle.xml | 4 ++-- entries/width.xml | 2 +- 25 files changed, 28 insertions(+), 27 deletions(-) diff --git a/entries/animate.xml b/entries/animate.xml index f138bc4d..5db2dcf6 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -58,7 +58,7 @@ $( "#clickme" ).click(function() {

    -
    figure 1
    +
    Figure 1 - Illustration of the specified animation effect

    Note that the target value of the height property is 'toggle'. Since the image was visible before, the animation shrinks the height to 0 to hide it. A second click then reverses this transition: @@ -66,7 +66,7 @@ $( "#clickme" ).click(function() {

    -
    figure 2
    +
    Figure 2 - Illustration of the specified animation effect

    The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

    diff --git a/entries/click.xml b/entries/click.xml index c6e9b168..56475da4 100644 --- a/entries/click.xml +++ b/entries/click.xml @@ -36,7 +36,7 @@
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any <div>:

    
    diff --git a/entries/dblclick.xml b/entries/dblclick.xml
    index 54962191..c5ffe14b 100644
    --- a/entries/dblclick.xml
    +++ b/entries/dblclick.xml
    @@ -36,7 +36,7 @@
         
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any <div>:

    
    diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml
    index 628e7e73..f3b2e9e2 100644
    --- a/entries/fadeIn.xml
    +++ b/entries/fadeIn.xml
    @@ -40,7 +40,7 @@ $( "#clickme" ).click(function() {
           
           
           
    -      
    figure 1
    +
    Figure 1 - Illustration of the fadeIn() effect

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index cfd1c6ae..1bdddaf6 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -41,7 +41,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the fadeOut() effect

    Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

    diff --git a/entries/fadeTo.xml b/entries/fadeTo.xml index ca382b0c..4bf38be1 100644 --- a/entries/fadeTo.xml +++ b/entries/fadeTo.xml @@ -55,7 +55,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the fadeTo() effect

    With duration set to 0, this method just changes the opacity CSS property, so .fadeTo( 0, opacity ) is the same as .css( "opacity", opacity ).

    diff --git a/entries/height.xml b/entries/height.xml index 548af238..2bbe55a0 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -11,7 +11,7 @@

    The difference between .css( "height" ) and .height() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .height() method is recommended when an element's height needs to be used in a mathematical calculation.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured height

    This method is also able to find the height of the window and document.

    
    diff --git a/entries/hide.xml b/entries/hide.xml
    index 91916a8e..3a68ca15 100644
    --- a/entries/hide.xml
    +++ b/entries/hide.xml
    @@ -60,6 +60,7 @@ $( "#clickme" ).click(function() {
           
           
           
    +      
    Figure 1 - Illustration of the hide() effect
    diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index b962c231..b8c5654e 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -13,7 +13,7 @@

    This method is not applicable to window and document objects; for these, use .height() instead.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured height
    diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index fbfd5df5..6e9fd0d3 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -12,7 +12,7 @@

    This method is not applicable to window and document objects; for these, use .width() instead.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured width
    diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 6217be54..dc1626fd 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -35,7 +35,7 @@
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any <div>:

    
    diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml
    index de72455d..f9c39697 100644
    --- a/entries/mouseenter.xml
    +++ b/entries/mouseenter.xml
    @@ -39,7 +39,7 @@
     <div id="log"></div>
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any element:

    
    diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml
    index 23508900..edb8fa44 100644
    --- a/entries/mouseleave.xml
    +++ b/entries/mouseleave.xml
    @@ -39,7 +39,7 @@
     <div id="log"></div>
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any element:

    
    diff --git a/entries/mouseout.xml b/entries/mouseout.xml
    index 09c63aab..57304cb1 100644
    --- a/entries/mouseout.xml
    +++ b/entries/mouseout.xml
    @@ -40,7 +40,7 @@
         
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any element:

    
    diff --git a/entries/mouseover.xml b/entries/mouseover.xml
    index 5d4415da..88ddb981 100644
    --- a/entries/mouseover.xml
    +++ b/entries/mouseover.xml
    @@ -40,7 +40,7 @@
         
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any element:

    
    diff --git a/entries/mouseup.xml b/entries/mouseup.xml
    index 8fb2122b..e18080a6 100644
    --- a/entries/mouseup.xml
    +++ b/entries/mouseup.xml
    @@ -36,7 +36,7 @@
     
    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The event handler can be bound to any <div>:

    
    diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml
    index 6a14fd7d..95df451f 100644
    --- a/entries/outerHeight.xml
    +++ b/entries/outerHeight.xml
    @@ -15,7 +15,7 @@
         

    This method is not applicable to window and document objects; for these, use .height() instead.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured height
    diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index f39fe926..24861c8e 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -16,7 +16,7 @@

    This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured width
    diff --git a/entries/scroll.xml b/entries/scroll.xml index 1a0e9cbd..8529cb0c 100644 --- a/entries/scroll.xml +++ b/entries/scroll.xml @@ -45,7 +45,7 @@

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

    -
    figure 1
    +
    Figure 1 - Illustration of the rendered HTML

    The scroll event handler can be bound to this element:

    
    diff --git a/entries/show.xml b/entries/show.xml
    index b6f38e13..fb150631 100644
    --- a/entries/show.xml
    +++ b/entries/show.xml
    @@ -61,7 +61,7 @@ $( "#clickme" ).click(function() {
           
           
           
    -      
    figure 1
    +
    Figure 1 - Illustration of the show() effect
    diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 204a9372..7ca77825 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -41,7 +41,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the slideDown() effect

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml index d6cd26b0..12b97ad1 100644 --- a/entries/slideToggle.xml +++ b/entries/slideToggle.xml @@ -42,7 +42,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the slideToggle() effect when hiding the image

    A second click will show the element once again:

    @@ -50,7 +50,7 @@ $( "#clickme" ).click(function() { -
    figure 2
    +
    Figure 2 - Illustration of the slideToggle() effect when showing the image

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    diff --git a/entries/slideUp.xml b/entries/slideUp.xml index 3ecc8feb..8db63468 100644 --- a/entries/slideUp.xml +++ b/entries/slideUp.xml @@ -41,7 +41,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the slideUp() effect

    Easing

    As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

    diff --git a/entries/toggle.xml b/entries/toggle.xml index 26f85aa0..6c290220 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -64,7 +64,7 @@ $( "#clickme" ).click(function() { -
    figure 1
    +
    Figure 1 - Illustration of the toggle() effect when hiding the image

    A second click will show the element once again:

    @@ -72,7 +72,7 @@ $( "#clickme" ).click(function() { -
    figure 2
    +
    Figure 2 - Illustration of the toggle() effect when showing the image

    The second version of the method accepts a Boolean parameter. If this parameter is true, then the matched elements are shown; if false, the elements are hidden. In essence, the statement:

    diff --git a/entries/width.xml b/entries/width.xml index abc8aff3..f073145a 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -11,7 +11,7 @@

    The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation.

    -
    figure 1
    +
    Figure 1 - Illustration of the measured width

    This method is also able to find the width of the window and document.

    
    
    From 9560239d82c44ec98bcf5137ade9fb7e6f5eef9d Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Mon, 14 Dec 2015 23:53:26 +0000
    Subject: [PATCH 657/998] jQuery.speed: Created entry
    
    Fixes gh-830
    Closes gh-849
    ---
     entries/jQuery.speed.xml | 46 ++++++++++++++++++++++++++++++++++++++++
     1 file changed, 46 insertions(+)
     create mode 100644 entries/jQuery.speed.xml
    
    diff --git a/entries/jQuery.speed.xml b/entries/jQuery.speed.xml
    new file mode 100644
    index 00000000..cb5ea916
    --- /dev/null
    +++ b/entries/jQuery.speed.xml
    @@ -0,0 +1,46 @@
    +
    +
    +  jQuery.speed
    +  Creates an object containing a set of properties ready to be used in the definition of custom animations.
    +  
    +    1.0
    +    
    +    
    +        
    +            A string indicating which easing function to use for the transition.
    +        
    +        
    +            A function to call once the animation is complete.
    +        
    +    
    +  
    +  
    +    1.1
    +    
    +    
    +    
    +  
    +  
    +    1.1
    +    
    +        
    +            A string or number determining how long the animation will run.
    +            
    +            
    +        
    +        
    +            A string indicating which easing function to use for the transition.
    +        
    +        
    +            A function to call once the animation is complete.
    +        
    +    
    +  
    +  
    +    

    The $.speed() method provides a way to define properties, such as duration, easing, and queue, to use in a custom animation. By using it, you don't have to implement the logic that deals with default values and optional parameters.

    +

    This method is meant for plugin developers who are creating new animation methods. Letting $.speed() do all the parameter hockey and normalization for you, rather than duplicating the logic yourself, makes your work simpler. An example of use can be found in the animated form of .addClass() of jQuery UI.

    +
    + + + +
    From 0811e8f152a3e3665af696dd308940189d6f6339 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Thu, 7 Jan 2016 16:02:35 -0500 Subject: [PATCH 658/998] Manipulation: fix after/before xml parsing Closes gh-859 --- entries/after.xml | 4 ++-- entries/before.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index 1e195510..ee63cbf7 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -30,9 +30,9 @@ - + 1.10 - + A function that returns an HTML string, DOM element(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 cba817a9..6a388ca4 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -33,7 +33,7 @@ 1.10 - + From cd7119b5d423e91b92594ebb99b2e8483a91c3f6 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 7 May 2015 21:55:42 +0200 Subject: [PATCH 659/998] jQuery.uniqueSort: add new entry, deprecate `jQuery.unique()` Fixes gh-731 Closes gh-736 --- entries/jQuery.unique.xml | 3 ++- entries/jQuery.uniqueSort.xml | 45 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 entries/jQuery.uniqueSort.xml diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index 0546cfa7..b31ce023 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -1,5 +1,5 @@ - + jQuery.unique() 1.1.3 @@ -9,6 +9,7 @@ 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.

    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.

    diff --git a/entries/jQuery.uniqueSort.xml b/entries/jQuery.uniqueSort.xml new file mode 100644 index 00000000..0bccb245 --- /dev/null +++ b/entries/jQuery.uniqueSort.xml @@ -0,0 +1,45 @@ + + + jQuery.uniqueSort() + + 3.0 + + The Array 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. + +

    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.

    +

    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. + + + + + +
    From 4a2f3836f5a02501fc32d7c946b8ca35530cebe9 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 14 Dec 2015 02:04:06 +0000 Subject: [PATCH 660/998] Document that addClass and removeClass change the attribute Fixes gh-814 Closes gh-846 --- entries/addClass.xml | 3 ++- entries/removeClass.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/entries/addClass.xml b/entries/addClass.xml index 69274708..5dd99ec5 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -19,7 +19,8 @@ Adds the specified class(es) to each element in the set of matched elements.

    It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

    -

    The .addClass() method manipulates the className property of the selected elements, not the class attribute. Once the property is changed, it's the browser that updates the attribute accordingly. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).

    +

    Before jQuery version 1.12/2.2, the .addClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

    +

    As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .addClass() can be used on XML or SVG documents.

    More than one class may be added at a time, separated by a space, to the set of matched elements, like so:

    
     $( "p" ).addClass( "myClass yourClass" );
    diff --git a/entries/removeClass.xml b/entries/removeClass.xml
    index 3263e3a3..a35954e9 100644
    --- a/entries/removeClass.xml
    +++ b/entries/removeClass.xml
    @@ -19,7 +19,8 @@
       Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
       
         

    If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.

    -

    The .removeClass() method manipulates the className property of the selected elements, not the class attribute. Once the property is changed, it's the browser that updates the attribute accordingly. This means that when the class attribute is updated and the last class name is removed, the browser may set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).

    +

    Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

    +

    As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

    More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

    
     $( "p" ).removeClass( "myClass yourClass" )
    
    From 9ddc0201846c229e8cf9adb81a8b96b9c53e67bd Mon Sep 17 00:00:00 2001
    From: Timmy Willison 
    Date: Mon, 28 Dec 2015 11:09:49 -0500
    Subject: [PATCH 661/998] Ajax: new signature for post/get was added in
     1.12/2.2
    
    ---
     entries/jQuery.get.xml  | 14 +++++++-------
     entries/jQuery.post.xml |  6 +++---
     2 files changed, 10 insertions(+), 10 deletions(-)
    
    diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
    index c3f18cac..a4e2bcdb 100644
    --- a/entries/jQuery.get.xml
    +++ b/entries/jQuery.get.xml
    @@ -1,12 +1,6 @@
     
     
       jQuery.get()
    -  
    -    3.0
    -    
    -      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.
    -    
    -  
       
         1.0
         
    @@ -24,7 +18,13 @@
           A callback function that is executed if the request succeeds. Required if dataType is provided, but you can use null or jQuery.noop as a placeholder.
         
         
    -      The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
    +      The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
    +    
    +  
    +  
    +    1.12/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.
         
       
       Load data from the server using a HTTP GET request.
    diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
    index 982b28c7..0ca6c139 100644
    --- a/entries/jQuery.post.xml
    +++ b/entries/jQuery.post.xml
    @@ -12,9 +12,9 @@
           A plain object or string that is sent to the server with the request.
         
         
    -      
    +      
           
    -              
    +      
           A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
         
         
    @@ -22,7 +22,7 @@
         
       
       
    -    3.0
    +    1.12/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.
         
    
    From 82c1f4c57d31142a4851d50cad4a0233a8c27036 Mon Sep 17 00:00:00 2001
    From: Timmy Willison 
    Date: Mon, 28 Dec 2015 11:10:25 -0500
    Subject: [PATCH 662/998] Uniquesort: added in 1.12/2.2
    
    ---
     entries/jQuery.uniqueSort.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.uniqueSort.xml b/entries/jQuery.uniqueSort.xml
    index 0bccb245..a1927bda 100644
    --- a/entries/jQuery.uniqueSort.xml
    +++ b/entries/jQuery.uniqueSort.xml
    @@ -2,7 +2,7 @@
     
       jQuery.uniqueSort()
       
    -    3.0
    +    1.12/2.2
         
           The Array of DOM elements.
         
    
    From cc0604bb4d075031d083ca3fd27c0a0aac2df80f Mon Sep 17 00:00:00 2001
    From: Timmy Willison 
    Date: Thu, 7 Jan 2016 16:01:45 -0500
    Subject: [PATCH 663/998] jQuery.htmlPrefilter: add new entry
    
    Fixes gh-727
    Close gh-858
    ---
     entries/jQuery.htmlPrefilter.xml | 77 ++++++++++++++++++++++++++++++++
     1 file changed, 77 insertions(+)
     create mode 100644 entries/jQuery.htmlPrefilter.xml
    
    diff --git a/entries/jQuery.htmlPrefilter.xml b/entries/jQuery.htmlPrefilter.xml
    new file mode 100644
    index 00000000..3682ed5b
    --- /dev/null
    +++ b/entries/jQuery.htmlPrefilter.xml
    @@ -0,0 +1,77 @@
    +
    +
    +  jQuery.htmlPrefilter()
    +  Modify and filter HTML strings passed through jQuery manipulation methods.
    +  
    +    1.12/2.2
    +    
    +      The HTML string on which to operate.
    +    
    +  
    +  
    +    

    This method rarely needs to be called directly. Instead, use it as an entry point to modify existing jQuery manipulation methods. For instance, to remove all <del> tags from incoming HTML strings, do this:

    +
    
    +var htmlPrefilter = $.htmlPrefilter,
    +  rdel = /<(del)(?=[\s>])[\w\W]*?<\/\1\s*>/gi;
    +
    +$.htmlPrefilter = function( html ) {
    +  return htmlPrefilter.call( this, html ).replace( rdel, "" );
    +};
    +    
    +

    This function can also be overwritten in order to bypass certain edge case issues. The default htmlPrefilter function in jQuery will greedily ensure that all tags are XHTML-compliant. This includes anything that looks like an HTML tag, but is actually within a string (e.g.

    <a title="<div />"><>
    ). The jQuery.htmlPrefilter() function can be used to bypass this:

    +
    
    +$.htmlPrefilter = function( html ) {
    +  // Return HTML strings unchanged
    +  return html;
    +};
    +    
    +

    However, while the above fix is short and simple, it puts the burden on you to ensure XHTML-compliant tags in any HTML strings. A more thorough fix for this issue would be this:

    +
    
    +var panything = "[\\w\\W]*?",
    +
    +  // Whitespace
    +  // https://html.spec.whatwg.org/multipage/infrastructure.html#space-character
    +  pspace = "[\\x20\\t\\r\\n\\f]",
    +
    +  // End of tag name (whitespace or greater-than)
    +  pnameEnd = pspace.replace( "]", ">]" ),
    +
    +  // Tag name (a leading letter, then almost anything)
    +  // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
    +  // https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
    +  pname = "[a-z]" + pnameEnd.replace( "[", "[^/\\0" ) + "*",
    +
    +  // Void element (end tag prohibited)
    +  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
    +  pvoidName = "(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|" +
    +    "source|track|wbr)(?=" + pnameEnd + ")",
    +
    +  // Attributes (double-quoted value, single-quoted value, unquoted value, or no value)
    +  // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
    +  pattrs = "(?:" + pspace + "+[^\\0-\\x20\\x7f-\\x9f=\"'/>]+(?:" + pspace + "*=" + pspace +
    +    "*(?:\"" + panything + "\"|'" + panything + "'|" +
    +    pnameEnd.replace( "[", "[^" ) + "*(?!/)" +
    +    ")|))*" + pspace + "*",
    +
    +  // Trailing content of a close tag
    +  pcloseTail = "(?:" + pspace + panything + "|)",
    +
    +  rspecialHtml = new RegExp(
    +    // Non-void element that self-closes: $1–$5
    +    "(<)(?!" + pvoidName + ")(" + pname + ")(" + pattrs + ")(\\/)(>)|" +
    +      // No-innerHTML container (element, comment, or CDATA): $6
    +      "(<(script|style|textarea)" + pattrs + ">" + panything + "<\\/\\7" + pcloseTail + ">|" +
    +      "<!--" + panything + "--)",
    +    "gi"
    +  ),
    +
    +  // "<"; element name; attributes; ">"; "<"; "/"; element name; ">"; no-innerHTML container
    +  pspecialReplacement = "$1$2$3$5$1$4$2$5$6";
    +
    +$.htmlPrefilter = function( html ) {
    +  return ( html + "" ).replace( rspecialHtml, pspecialReplacement );
    +};
    +    
    +
    + +
    From af5264bdfd64581ba5f2a05e906d6178ce5977d5 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Fri, 15 Jan 2016 14:23:27 -0800 Subject: [PATCH 664/998] jQuery.when: Returns a resolved promise for no arguments Closes gh-868 --- entries/jQuery.when.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index bcb12dc1..09c8393e 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -4,11 +4,12 @@ 1.5 - One or more Deferred objects, or plain JavaScript objects. + Zero or more Deferred objects, or plain JavaScript objects. - Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + Provides a way to execute callback functions based on zero or more objects, usually Deferred objects that represent asynchronous events. +

    If no arguments are passed to jQuery.when(), it will return a resolved Promise.

    If a single Deferred is passed to jQuery.when(), its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise-compatible object and can be used this way:

    
     $.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {
    
    From 4ee55d3af232574735a8f2433497e784c5fb3a8a Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sat, 16 Jan 2016 17:01:08 +0000
    Subject: [PATCH 665/998] jQuery.css: Clarified that currentStyle and
     runtimeStyle belong to IE9-
    
    Fixes gh-867
    Closes gh-869
    ---
     entries/css.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 8fe89b20..0658d754 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -17,7 +17,7 @@
         
         Get the computed style properties for the first element in the set of matched elements.
         
    -      

    The .css() method is a convenient way to get a computed style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    +

    The .css() method is a convenient way to get a computed style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer prior to version 9) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). This means mixed case has a special meaning, .css( "WiDtH" ) won't do the same as .css( "width" ), for example.

    Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

    Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

    From 1fd8912c31a18307627e25d9bd55e87e2844f934 Mon Sep 17 00:00:00 2001 From: Vihan Bhargava Date: Sat, 16 Jan 2016 08:23:38 -0800 Subject: [PATCH 666/998] Types: Clarified where to use parenthesis in numbers to strings convertion Fixes gh-870 --- pages/Types.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index 4890df38..4dc65e34 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -205,7 +205,7 @@

    Parsing Numbers

    parseFloat( "10.10" ) = 10.1

    Numbers to Strings

    -

    When appending numbers to string, the result is always a string. The operator is the same, so be careful: If you want to add numbers and then append them to a string, put parentheses around them: +

    When appending numbers to string, the result is always a string. The operator is the same, so be careful: If you want to add numbers and then append them to a string, put parentheses around the numbers:

    "" + 1 + 2; // "12"
     "" + ( 1 + 2 ); // "3"
    
    From d75ba72649954e6d1a92bc8c7cf5eff85c8e4069 Mon Sep 17 00:00:00 2001
    From: Vihan Bhargava 
    Date: Sat, 16 Jan 2016 08:30:23 -0800
    Subject: [PATCH 667/998] Types: Changed occurrences of == to ===
    
    Fixes gh-871
    Closes gh-854
    ---
     pages/Types.html | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/pages/Types.html b/pages/Types.html
    index 4dc65e34..3ab98753 100644
    --- a/pages/Types.html
    +++ b/pages/Types.html
    @@ -234,11 +234,11 @@ 

    NaN and Infinity

    Note that NaN compares in a strange way:

    -
    NaN == NaN // false (!)
    +
    NaN === NaN // false (!)
     

    But:

    -
    Infinity == Infinity // true
    +
    Infinity === Infinity // true
     

    Integer

    An integer is a plain Number type, but whenever explicitly mentioned, indicates that a non-floating-point number is expected. @@ -320,7 +320,7 @@

    Prototype

    var form = $("#myform");
     console.log( form.clearForm ); // undefined
     
    -// jQuery.fn == jQuery.prototype
    +// jQuery.fn === jQuery.prototype
     jQuery.fn.clearForm = function() {
       return this.find( ":input" ).each(function() {
         this.value = "";
    @@ -477,7 +477,7 @@ 

    Arguments

    The arguments object also has a callee property, which refers to the function you're inside of. For instance:

    var awesome = function() { return arguments.callee; }
    -awesome() == awesome // true
    +awesome() === awesome // true
     

    Context, Call and Apply

    In JavaScript, the variable "this" always refers to the current context. By default, "this" refers to the window object. Within a function this context can change, depending on how the function is called. From fc260f6ecda27e5ded15114ea75023d1dae750b2 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 11 Jan 2016 23:50:26 -0500 Subject: [PATCH 668/998] jQuery.isNumber: Clarify purpose and behavior Fixes gh-862 Closes gh-864 Ref jquery/jquery/issues/2781 --- entries/jQuery.isNumeric.xml | 39 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index c6ec81e8..7a4e7f6c 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -1,7 +1,7 @@ jQuery.isNumeric() - Determines whether its argument is a number. + Determines whether its argument represents a JavaScript number. 1.7 @@ -9,26 +9,31 @@ -

    The $.isNumeric() method checks whether its argument represents a numeric value. If so, it returns true. Otherwise it returns false. The argument can be of any type.

    +

    The $.isNumeric() method checks whether a value is a finite number, or would be cast to one by Number. If so, it returns true. Otherwise it returns false. The argument can be of any type.

    Sample return values of $.isNumeric with various inputs. From 6eece50ee318333de81e834475d5cd48f784799b Mon Sep 17 00:00:00 2001 From: David Bazile Date: Wed, 23 Sep 2015 12:46:31 -0400 Subject: [PATCH 669/998] jQuery.ajax: Added example for the accepts property Closes gh-811 --- entries/jQuery.ajax.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 81e3e42c..65f5b544 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -16,7 +16,27 @@ A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). - The content type sent in the request header that tells the server what kind of response it will accept in return. + A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept request header. This header tells the server what kind of response it will accept in return. For example, the following defines a custom type mycustomtype to be sent with the request: +
    
    +$.ajax({
    +  accepts: {
    +    mycustomtype: 'application/x-some-custom-type'
    +  },
    +
    +  // Instructions for how to deserialize a `mycustomtype`
    +  converters: {
    +    'text mycustomtype': function(result) {
    +      // Do Stuff
    +      return newresult;
    +    }
    +  },
    +
    +  // Expect a `mycustomtype` back from server
    +  dataType: 'mycustomtype'
    +});
    +          
    + Note: You will need to specify a complementary entry for this type in converters for this to work properly. +
    By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). From 674b7514dd46be08c75f8e38d60a90a724729159 Mon Sep 17 00:00:00 2001 From: Callum Kerr Date: Mon, 18 Jan 2016 12:03:05 -0700 Subject: [PATCH 670/998] jQuery.offset: Add a link to .position() Closes gh-875 --- entries/offset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/offset.xml b/entries/offset.xml index 9b1a0093..e626ac5a 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -8,7 +8,7 @@ Get the current coordinates of the first element in the set of matched elements, relative to the document. -

    The .offset() method allows us to retrieve the current position of an element 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.

    +

    The .offset() method allows us to retrieve the current position of an element 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 borders, margins, or padding set on the body element.

    From 5b90d81484b50366ca27510ba032117b606060b1 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 11 Feb 2016 00:20:54 +0000 Subject: [PATCH 671/998] Noted support of SVG documents for class methods Fixes gh-885 Closes gh-886 --- entries/hasClass.xml | 1 + entries/toggleClass.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/entries/hasClass.xml b/entries/hasClass.xml index 37b52f79..ddf5d893 100644 --- a/entries/hasClass.xml +++ b/entries/hasClass.xml @@ -25,6 +25,7 @@ $( "#mydiv" ).hasClass( "bar" )
    
     $( "#mydiv" ).hasClass( "quux" )
         
    +

    As of jQuery 1.12/2.2, this method supports XML documents, including SVG.

    Looks for the paragraph that contains 'selected' as a class. diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index 1d034d86..f14cb8ed 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -37,6 +37,8 @@ Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. +

    Before jQuery version 1.12/2.2, the .toggleClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

    +

    As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .toggleClass() can be used on XML or SVG documents.

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    
     <div class="tumble">Some text.</div>
    
    From b985c8eb6a33980366f6ddc73b8205e74229d372 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Thu, 11 Feb 2016 00:24:19 +0000
    Subject: [PATCH 672/998] stop: Specified default values
    
    Closes gh-887
    ---
     entries/stop.xml | 8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/entries/stop.xml b/entries/stop.xml
    index ce38bd01..b66c0bcc 100644
    --- a/entries/stop.xml
    +++ b/entries/stop.xml
    @@ -4,22 +4,22 @@
       Stop the currently-running animation on the matched elements.
       
         1.2
    -    
    +    
           A Boolean indicating whether to remove queued animation as well. Defaults to false.
         
    -    
    +    
           A Boolean indicating whether to complete the current animation immediately. Defaults to false.
         
       
       
         1.7
    -    
    +    
           The name of the queue in which to stop animations.
         
         
           A Boolean indicating whether to remove queued animation as well. Defaults to false.
         
    -    
    +    
           A Boolean indicating whether to complete the current animation immediately. Defaults to false.
         
       
    
    From fb8d4da0b4002833ec2363a812e90ac019b07b05 Mon Sep 17 00:00:00 2001
    From: Ian Kemp 
    Date: Wed, 10 Feb 2016 12:47:41 +0200
    Subject: [PATCH 673/998] Specified defaults for outerWidth and outerHeight
    
    Fixes gh-882
    Closes gh-883
    ---
     entries/outerHeight.xml | 2 +-
     entries/outerWidth.xml  | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml
    index 95df451f..ab497404 100644
    --- a/entries/outerHeight.xml
    +++ b/entries/outerHeight.xml
    @@ -5,7 +5,7 @@
       .outerHeight()
       
         1.2.6
    -    
    +    
           A Boolean indicating whether to include the element's margin in the calculation.
         
       
    diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml
    index 24861c8e..64687fb9 100644
    --- a/entries/outerWidth.xml
    +++ b/entries/outerWidth.xml
    @@ -5,7 +5,7 @@
       .outerWidth()
       
         1.2.6
    -    
    +    
           A Boolean indicating whether to include the element's margin in the calculation.
         
       
    
    From 3a5b4cb769b43d379f1900cd8b089d855e723dee Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Mon, 18 Jan 2016 00:33:20 +0000
    Subject: [PATCH 674/998] jQuery.closest: Removed reference to deprecated
     context property
    
    Fixes gh-857
    Closes gh-874
    ---
     entries/closest.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/closest.xml b/entries/closest.xml
    index 5f1bb2b4..14c10a80 100644
    --- a/entries/closest.xml
    +++ b/entries/closest.xml
    @@ -14,7 +14,7 @@
             A string containing a selector expression to match elements against.
           
           
    -        A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
    +        A DOM element within which a matching element may be found.
           
         
         
    @@ -166,7 +166,7 @@ $( document ).on( "click", function( event ) {
             An array or string containing a selector expression to match elements against (can also be a jQuery object).
           
           
    -        A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
    +        A DOM element within which a matching element may be found.
           
         
         Get an array of all the elements and selectors matched against the current element up through the DOM tree.
    
    From 5f397052be4613689274b6a2db185225443872ef Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sat, 16 Jan 2016 17:39:22 +0000
    Subject: [PATCH 675/998] jQuery.css: Specified that important declarations are
     ignored
    
    Fixes gh-866
    Closes gh-872
    ---
     entries/css.xml | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/entries/css.xml b/entries/css.xml
    index 0658d754..34fc7237 100644
    --- a/entries/css.xml
    +++ b/entries/css.xml
    @@ -146,6 +146,7 @@ $( "div" ).click(function() {
           

    Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

    When a number is passed as the value, jQuery will convert it to a string and add px to the end of that string. If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.

    When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

    +

    Note: .css() ignores !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red. It's strongly advised to use classes instead; otherwise use a jQuery plugin.

    As of jQuery 1.8, the .css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.

    As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

    As of jQuery 1.4, .css() allows us to pass a function as the property value:

    From 6142f8693cba08be3372d71f9b75cf80190cbb24 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 18 Jan 2016 00:11:06 +0000 Subject: [PATCH 676/998] jQuery.prev: Clarified its behavior Fixes gh-861 Closes gh-873 --- entries/prev.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/prev.xml b/entries/prev.xml index bfa4fa2f..7ee31594 100644 --- a/entries/prev.xml +++ b/entries/prev.xml @@ -7,7 +7,7 @@ A string containing a selector expression to match elements against. - Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + Get the immediately preceding sibling of each element in the set of matched elements. If a selector is provided, it retrieves the previous sibling only if it matches that selector.

    Given a jQuery object that represents a set of DOM elements, the .prev() method searches for the predecessor of each of these elements in the DOM tree and constructs a new jQuery object from the matching elements.

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

    From a6eecc290676b5301c58e327ce52060555767f4b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 14 Feb 2016 22:03:36 +0000 Subject: [PATCH 677/998] jQuery.hasData: Clarified when it returns false Fixes gh-889 Closes gh-891 --- entries/jQuery.hasData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.hasData.xml b/entries/jQuery.hasData.xml index af081d41..ece74c75 100644 --- a/entries/jQuery.hasData.xml +++ b/entries/jQuery.hasData.xml @@ -9,7 +9,7 @@ Determine whether an element has any jQuery data associated with it. -

    The jQuery.hasData() method provides a way to determine if an element currently has any values that were set using jQuery.data(). If no data is associated with an element (there is no data object at all or the data object is empty), the method returns false; otherwise it returns true.

    +

    The jQuery.hasData() method provides a way to determine if an element currently has any values that were set using jQuery.data(). If there is no data object associated with an element, the method returns false; otherwise it returns true.

    The primary advantage of jQuery.hasData(element) is that it does not create and associate a data object with the element if none currently exists. In contrast, jQuery.data(element) always returns a data object to the caller, creating one if no data object previously existed.

    Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using .on(), .bind(), .live(), .delegate(), or one of the shorthand event methods also associates a data object with that element. From 5e6a5a00cbd4ea9fe905a8fb90619b7741d0f808 Mon Sep 17 00:00:00 2001 From: Vitaly Zdanevich Date: Fri, 5 Feb 2016 19:34:55 +0300 Subject: [PATCH 678/998] jQuery.on: Added example with multiple events Closes gh-888 --- entries/on.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/entries/on.xml b/entries/on.xml index 34d14f4e..18a17cae 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -265,11 +265,19 @@ $( "body" ).on( "click", "p", function() { ]]> - Cancel a link's default action using the .preventDefault() method. + Cancel a link's default action using the .preventDefault() method: + + + Attach multiple events—one on mouseenter and one on mouseleave to the same element: + From a465962f7b40c719c763d5f770e8eb36b76600df Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 16 Feb 2016 21:11:09 +0000 Subject: [PATCH 679/998] Clarified when the keydown event is fired Fixes gh-876 Closes gh-892 --- entries/keydown.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/keydown.xml b/entries/keydown.xml index 50f83b57..f21ae4e0 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -24,7 +24,7 @@ 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.

    -

    The keydown event is sent to an element when the user first presses a key on the keyboard. 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.

    +

    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:

    
     <form>
    
    From 5a9497eb0b6a99cdd579c5d68bffd1551ac90ea7 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Wed, 17 Feb 2016 23:28:02 +0000
    Subject: [PATCH 680/998] 1.12.0
    
    ---
     package.json | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/package.json b/package.json
    index 25fab7fc..5fb4ca99 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": "1.11.117",
    +  "version": "1.12.0",
       "homepage": "https://github.com/jquery/api.jquery.com",
       "author": {
         "name": "jQuery Foundation and other contributors"
    
    From 01824acfe979e7507952086b947015bf42840143 Mon Sep 17 00:00:00 2001
    From: Jeromy French 
    Date: Tue, 12 May 2015 17:47:07 -0400
    Subject: [PATCH 681/998] checked selector: Added link :selected
    
    Fixes gh-558
    Closes gh-740
    ---
     entries/checked-selector.xml | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/entries/checked-selector.xml b/entries/checked-selector.xml
    index ebf96c2b..5d49ebcd 100644
    --- a/entries/checked-selector.xml
    +++ b/entries/checked-selector.xml
    @@ -7,7 +7,8 @@
       
       Matches all elements that are checked or selected.
       
    -    

    The :checked selector works for checkboxes, radio buttons, and select elements. For select elements only, use the :selected selector.

    +

    The :checked selector works for checkboxes, radio buttons, and options of select elements.

    +

    To retrieve only the selected options of select elements, use the :selected selector.

    Determine how many input elements are checked. From 28a7fe628643e15470bc18d1657d187c865a581b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Wed, 24 Feb 2016 23:47:33 +0000 Subject: [PATCH 682/998] First selector: Clarified behavior Fixes gh-894 Closes gh-895 --- entries/first-selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/first-selector.xml b/entries/first-selector.xml index a0371809..0676d85f 100644 --- a/entries/first-selector.xml +++ b/entries/first-selector.xml @@ -5,7 +5,7 @@ 1.0 - Selects the first matched element. + Selects the first matched DOM element.

    The :first pseudo-class is equivalent to :eq( 0 ). It could also be written as :lt( 1 ). While this matches only a single element, :first-child can match more than one: One for each parent.

    From f606cecd6ad1a6ca524787b80c19af72700f5330 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 25 Feb 2016 23:33:18 +0000 Subject: [PATCH 683/998] Added note about support for SVG documents Fixes gh-884 Closes gh-896 --- entries/append.xml | 3 ++- entries/appendTo.xml | 1 + entries/attr.xml | 1 + entries/filter.xml | 1 + entries/find.xml | 1 + entries/insertAfter.xml | 1 + entries/insertBefore.xml | 1 + entries/prepend.xml | 1 + entries/prependTo.xml | 1 + entries/removeAttr.xml | 1 + notes.xsl | 3 +++ 11 files changed, 14 insertions(+), 1 deletion(-) diff --git a/entries/append.xml b/entries/append.xml index c1de1420..07acacf1 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -33,7 +33,7 @@ Insert content, specified by the parameter, to the end of each element in the set of matched elements. -

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    +

    The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

    The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .append(), the selector expression preceding the method is the container into which the content is inserted. With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

    Consider the following HTML:

    
    @@ -87,6 +87,7 @@ $( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
         

    Since .append() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $('body').append( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Appends some HTML to all paragraphs.

    The result of this call would be a red background on item 1.

    +
    Starts with all paragraphs and searches for descendant span elements, same as $( "p span" ) diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml index 7e3435f8..9065d305 100644 --- a/entries/insertAfter.xml +++ b/entries/insertAfter.xml @@ -53,6 +53,7 @@ $( "h2" ).insertAfter( $( ".container" ) );

    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.

    + Insert all paragraphs after an element with id of "foo". Same as $( "#foo" ).after( "p" ) Since .prepend() can accept any number of additional arguments, the same result can be achieved by passing in the three <div>s as three separate arguments, like so: $( "body" ).prepend( $newdiv1, newdiv2, existingdiv1 ). The type and number of arguments will largely depend on how you collect the elements in your code.

    + Prepends some HTML to all paragraphs.
    + Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute. diff --git a/notes.xsl b/notes.xsl index eb5a9c61..50f94fc0 100644 --- a/notes.xsl +++ b/notes.xsl @@ -70,6 +70,9 @@ As of jQuery 1.9, all the handlers for the jQuery global Ajax events, including those added with the method, must be attached to document. + + jQuery doesn't officially support SVG. Using jQuery methods on SVG documents, unless explicitly documented for that method, might cause unexpected behaviors. Examples of methods that support SVG as of jQuery 3.0 are addClass and removeClass. + From 6cbf6b787db3631a4e797bd0c5cfb82046db2f82 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 26 Feb 2016 22:03:41 +0000 Subject: [PATCH 684/998] 1.12.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5fb4ca99..d8865dc2 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": "1.12.0", + "version": "1.12.1", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 075661471fc1b49c52cd27afe5d0af04c0177f21 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 3 Mar 2016 15:23:41 -0500 Subject: [PATCH 685/998] val: Document empty-context behavior Fixes gh-893 Ref https://github.com/jquery/jquery/issues/2319 Closes gh-897 --- entries/val.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/val.xml b/entries/val.xml index 52f2023f..2c78771f 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -11,7 +11,7 @@ Get the current value of the first element in the set of matched elements. -

    The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present.

    +

    The .val() method is primarily used to get the values of form elements such as input, select and textarea. When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), it returns an array containing the value of each selected option, or null if no options are selected. When called on an empty collection, it returns undefined.

    For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

    
     // Get the value from a dropdown select
    
    From e98feb7a5c4b88391a5667045f197e2ce450e7f4 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sat, 12 Mar 2016 11:26:11 +0000
    Subject: [PATCH 686/998] jQuery.ajax: Added note for jsonp and untrusted
     sources
    
    Ref gh-756
    Closes gh-900
    ---
     entries/jQuery.ajax.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index 65f5b544..d1d0e4d8 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -124,7 +124,7 @@ $.ajax({
             Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
           
           
    -        Override the callback function name in a JSONP request.  This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url.  So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
    +        Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax requests, consider setting the jsonp property to false for security reasons.
           
           
             
    
    From 75d59a317552b4978bbd27ee50dad8bb27a5cb15 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sat, 12 Mar 2016 11:29:09 +0000
    Subject: [PATCH 687/998] jQuery.ajax: Specified that jsonp accepts a Boolean
    
    ---
     entries/jQuery.ajax.xml | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
    index d1d0e4d8..33ce8b72 100644
    --- a/entries/jQuery.ajax.xml
    +++ b/entries/jQuery.ajax.xml
    @@ -123,7 +123,9 @@ $.ajax({
           
             Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
           
    -      
    +      
    +        
    +        
             Override the callback function name in a JSONP request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax requests, consider setting the jsonp property to false for security reasons.
           
           
    
    From 67996d7aa733c1b34cb699198f0cce3abe05eaf1 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sat, 12 Mar 2016 14:34:11 +0000
    Subject: [PATCH 688/998] scrollTop: Updated the return value to Number
    
    Fixes gh-608
    Closes gh-901
    ---
     entries/scrollTop.xml | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/entries/scrollTop.xml b/entries/scrollTop.xml
    index 027d3db0..9f0ec14e 100644
    --- a/entries/scrollTop.xml
    +++ b/entries/scrollTop.xml
    @@ -1,6 +1,6 @@
     
     
    -  
    +  
         .scrollTop()
         
           1.2.6
    @@ -35,7 +35,7 @@ $( "p:last" ).text( "scrollTop:" + p.scrollTop() );
         
           1.2.6
           
    -        An integer indicating the new position to set the scroll bar to.
    +        A number indicating the new position to set the scroll bar to.
           
         
         Set the current vertical position of the scroll bar for each of the set of matched elements.
    
    From 82c278e15cf114a90a50d9801b074311b0e11150 Mon Sep 17 00:00:00 2001
    From: Kris Borchers 
    Date: Wed, 23 Mar 2016 14:28:08 -0400
    Subject: [PATCH 689/998] jQuery.speed: Fix incorrect custom-effects slug
    
    Closes gh-902
    ---
     entries/jQuery.speed.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/jQuery.speed.xml b/entries/jQuery.speed.xml
    index cb5ea916..75cd1e68 100644
    --- a/entries/jQuery.speed.xml
    +++ b/entries/jQuery.speed.xml
    @@ -40,7 +40,7 @@
         

    The $.speed() method provides a way to define properties, such as duration, easing, and queue, to use in a custom animation. By using it, you don't have to implement the logic that deals with default values and optional parameters.

    This method is meant for plugin developers who are creating new animation methods. Letting $.speed() do all the parameter hockey and normalization for you, rather than duplicating the logic yourself, makes your work simpler. An example of use can be found in the animated form of .addClass() of jQuery UI.

    - +
    From 8905818402b717b4a172ed38dcae673d5085044a Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Wed, 30 Mar 2016 15:21:37 +0100 Subject: [PATCH 690/998] Build: Update grunt-jquery-content to 3.0.1 Closes gh-905 Fixes gh-890 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8865dc2..f49874de 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,6 @@ }, "dependencies": { "grunt": "0.4.5", - "grunt-jquery-content": "3.0.0" + "grunt-jquery-content": "3.0.1" } } From b41fe9c94602ab17c956344854f4a3d242606f1c Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Thu, 31 Mar 2016 14:29:32 +0100 Subject: [PATCH 691/998] 1.12.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f49874de..9f714af3 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": "1.12.1", + "version": "1.12.2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 33508ae0af0dbb7162466bcd3548090f66401939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Thu, 31 Mar 2016 16:08:16 +0200 Subject: [PATCH 692/998] Build: Add grunt-cli to dependencies --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9f714af3..e4bfc203 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ }, "dependencies": { "grunt": "0.4.5", + "grunt-cli": "1.1.0", "grunt-jquery-content": "3.0.1" } } From 068d23efa1cc35abc076bd11206ecb6684ad7dbd Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 12 Apr 2016 21:35:02 +0100 Subject: [PATCH 693/998] val(): Specified that it does not fire the change event Fixes gh-79 Closes gh-909 --- entries/val.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/val.xml b/entries/val.xml index 2c78771f..1ba0c365 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -124,6 +124,7 @@ $( "input" )

    This method is typically used to set the values of form fields.

    val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that don't match one of the elements of the array will be unchecked or unselected, depending on the type. In case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

    +

    Setting values using this method (or using the native value property) does not cause the dispatch of the change event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call .trigger( "change" ) after setting the value.

    The .val() method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

    
     $( "input:text.items" ).val(function( index, value ) {
    
    From 8c1b6078749786878fe70f55927f6e9c251e13b3 Mon Sep 17 00:00:00 2001
    From: Aaron Jorbin 
    Date: Wed, 13 Apr 2016 22:45:12 -0400
    Subject: [PATCH 694/998] Link to W3C for unquoted single word
    
    Unquoted single word has a specific definition in this case that is not
    succinct. A link to the spec helps developers understand what is meant.
    
    Fixes gh-910
    Ref jquery/jquery#2824
    Closes gh-911
    ---
     entries/attribute-contains-prefix-selector.xml | 2 +-
     entries/attribute-contains-selector.xml        | 2 +-
     entries/attribute-contains-word-selector.xml   | 2 +-
     entries/attribute-ends-with-selector.xml       | 2 +-
     entries/attribute-equals-selector.xml          | 2 +-
     entries/attribute-not-equal-selector.xml       | 2 +-
     entries/attribute-starts-with-selector.xml     | 2 +-
     7 files changed, 7 insertions(+), 7 deletions(-)
    
    diff --git a/entries/attribute-contains-prefix-selector.xml b/entries/attribute-contains-prefix-selector.xml
    index 4b706bc6..81856a8c 100644
    --- a/entries/attribute-contains-prefix-selector.xml
    +++ b/entries/attribute-contains-prefix-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).
    diff --git a/entries/attribute-contains-selector.xml b/entries/attribute-contains-selector.xml
    index 8cb21dfc..9974ab80 100644
    --- a/entries/attribute-contains-selector.xml
    +++ b/entries/attribute-contains-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value containing a given substring.
    diff --git a/entries/attribute-contains-word-selector.xml b/entries/attribute-contains-word-selector.xml
    index 18df4cbc..08553983 100644
    --- a/entries/attribute-contains-word-selector.xml
    +++ b/entries/attribute-contains-word-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.
    diff --git a/entries/attribute-ends-with-selector.xml b/entries/attribute-ends-with-selector.xml
    index 0febbde7..cb0f3344 100644
    --- a/entries/attribute-ends-with-selector.xml
    +++ b/entries/attribute-ends-with-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.
    diff --git a/entries/attribute-equals-selector.xml b/entries/attribute-equals-selector.xml
    index 555cf7c9..b29d733e 100644
    --- a/entries/attribute-equals-selector.xml
    +++ b/entries/attribute-equals-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value exactly equal to a certain value.
    diff --git a/entries/attribute-not-equal-selector.xml b/entries/attribute-not-equal-selector.xml
    index fabb6a2e..6736dd70 100644
    --- a/entries/attribute-not-equal-selector.xml
    +++ b/entries/attribute-not-equal-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value.
    diff --git a/entries/attribute-starts-with-selector.xml b/entries/attribute-starts-with-selector.xml
    index 3c2f6912..41485c85 100644
    --- a/entries/attribute-starts-with-selector.xml
    +++ b/entries/attribute-starts-with-selector.xml
    @@ -8,7 +8,7 @@
           An attribute name.
         
         
    -      An attribute value. Can be either an unquoted single word or a quoted string.
    +      An attribute value. Can be either an unquoted single word or a quoted string.
         
       
       Selects elements that have the specified attribute with a value beginning exactly with a given string.
    
    From e45384e612f2378f3a875e5b20a99bd62179c1c7 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Tue, 19 Apr 2016 02:44:07 +0100
    Subject: [PATCH 695/998] Types: Added Text
    
    ---
     pages/Types.html | 12 ++++++++++++
     1 file changed, 12 insertions(+)
    
    diff --git a/pages/Types.html b/pages/Types.html
    index 3ab98753..6e75a12f 100644
    --- a/pages/Types.html
    +++ b/pages/Types.html
    @@ -88,6 +88,7 @@
       
  • Selector
  • Event
  • Element
  • +
  • Text
  • jQuery
  • XMLHttpRequest
  • jqXHR
  • @@ -604,6 +605,17 @@

    Element

    You could replace this.value with $(this).val() to access the value of the text input via jQuery, but in that case you wouldn't gain anything.

    +

    Text

    +

    Text is a node of the Document Object Model (DOM) that represents the textual content of an element or an attribute. Consider the following code: +

    +
    <p id="target"><b>Hello</b> world</p>
    +
    +

    If you retrieve the children of the paragraph of the example as follows: +

    +
    var children = document.getElementById( "target" ).childNodes;
    +
    +you obtain two children. The first one is the element representing the b tag. The second child is a text node containing the string " world". +

    jQuery

    A jQuery object contains a collection of Document Object Model (DOM) elements that have been created from an HTML string or selected from a document. Since jQuery methods often use CSS selectors to match elements from a document, the set of elements in a jQuery object is often called a set of "matched elements" or "selected elements".

    From 9bf395aeb56299b05c84fda632865260d054ca8e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 19 Apr 2016 02:44:12 +0100 Subject: [PATCH 696/998] append: Documented that it accepts text nodes Fixes gh-879 Closes gh-914 --- entries/after.xml | 12 ++++++++---- entries/append.xml | 9 ++++++--- entries/before.xml | 12 ++++++++---- entries/prepend.xml | 9 ++++++--- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index ee63cbf7..4d2c477c 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -4,16 +4,18 @@ 1.0 - HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + HTML string, DOM element, text node, array of elements and text nodes, or jQuery object to insert after each element in the set of matched elements. + - One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + @@ -21,11 +23,12 @@ 1.4 - A function that returns an HTML string, DOM element(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 as an argument. Within the function, this refers to the current element in the set. + 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 as an argument. Within the function, this refers to the current element in the set. + @@ -33,12 +36,13 @@ 1.10 - A function that returns an HTML string, DOM element(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. + 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/append.xml b/entries/append.xml index 07acacf1..acdd1b11 100644 --- a/entries/append.xml +++ b/entries/append.xml @@ -4,16 +4,18 @@ 1.0 - DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + DOM element, text node, array of elements and text nodes, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + - One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + @@ -21,12 +23,13 @@ 1.4 - A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of 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. + A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at the end of 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 6a388ca4..ae958dc1 100644 --- a/entries/before.xml +++ b/entries/before.xml @@ -4,16 +4,18 @@ 1.0 - HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + HTML string, DOM element, text node, array of elements and text nodes, or jQuery object to insert before each element in the set of matched elements. + - One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + @@ -25,9 +27,10 @@ + - A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. @@ -39,9 +42,10 @@ + - A function that returns an HTML string, DOM element(s), or jQuery object to insert before 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. + A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert before 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/prepend.xml b/entries/prepend.xml index 4e12fcb8..912dd6fc 100644 --- a/entries/prepend.xml +++ b/entries/prepend.xml @@ -4,18 +4,20 @@ 1.0 - DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + DOM element, text node, array of elements and text nodes, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + + - One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. @@ -26,9 +28,10 @@ + - A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of 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. + A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at the beginning of 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. Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. From 8b3b088c76c1e23d96bea3b54079f33e6f5a1afe Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 21 Apr 2016 08:12:39 -0400 Subject: [PATCH 697/998] Types page: Add missing opening

    and remove data-lang="html" --- pages/Types.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/Types.html b/pages/Types.html index 6e75a12f..2deff771 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -608,13 +608,12 @@

    Element

    Text

    Text is a node of the Document Object Model (DOM) that represents the textual content of an element or an attribute. Consider the following code:

    -
    <p id="target"><b>Hello</b> world</p>
    -
    +
    <p id="target"><b>Hello</b> world</p>

    If you retrieve the children of the paragraph of the example as follows:

    var children = document.getElementById( "target" ).childNodes;
     
    -you obtain two children. The first one is the element representing the b tag. The second child is a text node containing the string " world". +

    you obtain two children. The first one is the element representing the b tag. The second child is a text node containing the string " world".

    jQuery

    A jQuery object contains a collection of Document Object Model (DOM) elements that have been created from an HTML string or selected from a document. Since jQuery methods often use CSS selectors to match elements from a document, the set of elements in a jQuery object is often called a set of "matched elements" or "selected elements". From 0d78b3ae6411ece043df1c7ae57bc42a58ec4516 Mon Sep 17 00:00:00 2001 From: Connor Cartwright Date: Thu, 5 May 2016 23:04:32 +0100 Subject: [PATCH 698/998] one: Clarified its behavior Fixes gh-796 Closes gh-923 --- entries/one.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entries/one.xml b/entries/one.xml index 1327dbf0..588f1d55 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -44,7 +44,7 @@ -

    The .one() method is identical to .on(), except that the handler is unbound after its first invocation. For example:

    +

    The .one() method is identical to .on(), except that the handler for a given element and event type is unbound after its first invocation. For example:

    
     $( "#foo" ).one( "click", function() {
       alert( "This will be displayed only once." );
    @@ -59,6 +59,12 @@ $( "#foo" ).on( "click", function( event ) {
         

    In other words, explicitly calling .off() from within a regularly-bound handler has exactly the same effect.

    If the first argument contains more than one space-separated event types, the event handler is called once for each event type.

    +
    
    +$( "#foo" ).one( "click mouseover", function() {
    +  alert( "The " + event.type + " event happened!" );
    +});
    +    
    +

    In the example above the alert could be displayed twice due to the two event types (click and mouseover).

    Tie a one-time click to each div. From a16c3b4b139e41d3910de153b8daa3c5a31e2fe7 Mon Sep 17 00:00:00 2001 From: Connor Cartwright Date: Thu, 5 May 2016 21:54:23 +0100 Subject: [PATCH 699/998] disabled: Described when an element is actually disabled Fixes gh-734 Closes gh-920 --- entries/disabled-selector.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/disabled-selector.xml b/entries/disabled-selector.xml index f018318c..812c8f57 100644 --- a/entries/disabled-selector.xml +++ b/entries/disabled-selector.xml @@ -9,9 +9,9 @@

    As with other pseudo-class selectors (those that begin with a ":"), it is recommended to precede it with a tag name or some other selector; otherwise, the universal selector ("*") is implied. In other words, the bare $(':disabled') is equivalent to $('*:disabled'), so $('input:disabled') or similar should be used instead.

    -

    Although their resulting selections are usually the same, the :disabled selector is subtly different from the [disabled] attribute selector; :disabled checks the boolean (true/false) value of the element's disabled property while [disabled] checks for the existence of the disabled attribute.

    +

    Although their resulting selections are usually the same, the :disabled selector is subtly different from the [disabled] attribute selector;:disabled matches elements that are actually disabled while [disabled] only checks for the existence of the disabled attribute.

    -

    The :disabled selector should only be used for selecting HTML elements that support the disabled attribute (<button>, <input>, <optgroup>, <option>, <select>, and <textarea>).

    +

    The :disabled selector should only be used for selecting HTML elements that support the disabled attribute (<button>, <input>, <optgroup>, <option>, <select>, <textarea>, <menuitem>, and <fieldset>).

    From d24fc66ed6998a03ccda9a69b4db005a9676c6b0 Mon Sep 17 00:00:00 2001 From: Connor Cartwright Date: Sun, 8 May 2016 20:27:36 +0100 Subject: [PATCH 700/998] Changed "unquoted single word" in "valid identifier" Fixes gh-918 Closes gh-927 --- entries/attribute-contains-prefix-selector.xml | 2 +- entries/attribute-contains-selector.xml | 2 +- entries/attribute-contains-word-selector.xml | 2 +- entries/attribute-ends-with-selector.xml | 2 +- entries/attribute-equals-selector.xml | 2 +- entries/attribute-not-equal-selector.xml | 2 +- entries/attribute-starts-with-selector.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/entries/attribute-contains-prefix-selector.xml b/entries/attribute-contains-prefix-selector.xml index 81856a8c..3465e6c2 100644 --- a/entries/attribute-contains-prefix-selector.xml +++ b/entries/attribute-contains-prefix-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-). diff --git a/entries/attribute-contains-selector.xml b/entries/attribute-contains-selector.xml index 9974ab80..15e7778d 100644 --- a/entries/attribute-contains-selector.xml +++ b/entries/attribute-contains-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value containing a given substring. diff --git a/entries/attribute-contains-word-selector.xml b/entries/attribute-contains-word-selector.xml index 08553983..8a71f37b 100644 --- a/entries/attribute-contains-word-selector.xml +++ b/entries/attribute-contains-word-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value containing a given word, delimited by spaces. diff --git a/entries/attribute-ends-with-selector.xml b/entries/attribute-ends-with-selector.xml index cb0f3344..cbdfe808 100644 --- a/entries/attribute-ends-with-selector.xml +++ b/entries/attribute-ends-with-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive. diff --git a/entries/attribute-equals-selector.xml b/entries/attribute-equals-selector.xml index b29d733e..faa6e513 100644 --- a/entries/attribute-equals-selector.xml +++ b/entries/attribute-equals-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value exactly equal to a certain value. diff --git a/entries/attribute-not-equal-selector.xml b/entries/attribute-not-equal-selector.xml index 6736dd70..38531ffc 100644 --- a/entries/attribute-not-equal-selector.xml +++ b/entries/attribute-not-equal-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value. diff --git a/entries/attribute-starts-with-selector.xml b/entries/attribute-starts-with-selector.xml index 41485c85..54067652 100644 --- a/entries/attribute-starts-with-selector.xml +++ b/entries/attribute-starts-with-selector.xml @@ -8,7 +8,7 @@ An attribute name. - An attribute value. Can be either an unquoted single word or a quoted string. + An attribute value. Can be either a valid identifier or a quoted string. Selects elements that have the specified attribute with a value beginning exactly with a given string. From e378db8ca39758fc5cfeea3913a0eea3731edd61 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 10 May 2016 22:50:04 +0200 Subject: [PATCH 701/998] Event: Suggest event.originalEvent usage jQuery.event.props has been removed, so it necessary to access event.originalEvent for non-common properties. Fixes #405 Closes #928 --- categories.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/categories.xml b/categories.xml index d43d8929..c181a548 100644 --- a/categories.xml +++ b/categories.xml @@ -120,7 +120,7 @@ var e = jQuery.Event( "keydown", { keyCode: 64 } ); // trigger an artificial keydown event with keyCode 64 jQuery( "body" ).trigger( e );
    -

    Event Properties

    +

    Common Event Properties

    jQuery normalizes the following properties for cross-browser consistency:

    • @@ -144,13 +144,12 @@ jQuery( "body" ).trigger( e );

    The following properties are also copied to the event object, though some of their values may be undefined depending on the event:

    altKey, bubbles, button, buttons, cancelable, char, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, key, keyCode, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, toElement, view, which

    -

    OtherProperties

    -

    Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

    -

    Example:

    +

    Other Properties

    +

    To access event properties not listed above, use the event.originalEvent object:

    
    -// add the dataTransfer property for use with the native `drop` event
    -// to capture information about files dropped into the browser window
    -jQuery.event.props.push( "dataTransfer" );
    +// Access the `dataTransfer` property from the `drop` event which
    +// holds the files dropped into the browser window.
    +var files = event.originalEvent.dataTransfer.files;
     
    ]]> From b6ec0a6a338223db3a893b2aac309a3b8eead473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Wed, 11 May 2016 10:16:47 +0200 Subject: [PATCH 702/998] 1.12.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e4bfc203..20678798 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": "1.12.2", + "version": "1.12.3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3aa37612b3601f86c571e1058cf951c7d2ce6611 Mon Sep 17 00:00:00 2001 From: Dennis Byrne Date: Mon, 16 May 2016 22:30:37 -0700 Subject: [PATCH 703/998] Replaced self closing divs with correct version Closes gh-929 --- entries/after.xml | 2 +- entries/append.xml | 2 +- entries/before.xml | 2 +- entries/prepend.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/after.xml b/entries/after.xml index 4d2c477c..210ad7c8 100644 --- a/entries/after.xml +++ b/entries/after.xml @@ -96,7 +96,7 @@ $( "p" ).after(function() {

    Similar to other content-adding methods such as .prepend() and .before(), .after() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> after the first paragraph:

    
    -var $newdiv1 = $( "<div id='object1'/>" ),
    +var $newdiv1 = $( "<div id='object1'></div>" ),
       newdiv2 = document.createElement( "div" ),
       existingdiv1 = document.getElementById( "foo" );
     
    diff --git a/entries/append.xml b/entries/append.xml
    index acdd1b11..b45c50ea 100644
    --- a/entries/append.xml
    +++ b/entries/append.xml
    @@ -81,7 +81,7 @@ $( ".container" ).append( $( "h2" ) );
         

    Similar to other content-adding methods such as .prepend() and .before(), .append() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the last three child nodes of the body:

    
    -var $newdiv1 = $( "<div id='object1'/>" ),
    +var $newdiv1 = $( "<div id='object1'></div>" ),
       newdiv2 = document.createElement( "div" ),
       existingdiv1 = document.getElementById( "foo" );
     
    diff --git a/entries/before.xml b/entries/before.xml
    index ae958dc1..1a1fcdea 100644
    --- a/entries/before.xml
    +++ b/entries/before.xml
    @@ -91,7 +91,7 @@ $( ".container" ).before( $( "h2" ) );
         

    Similar to other content-adding methods such as .prepend() and .after(), .before() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> before the first paragraph:

    
    -var newdiv1 = $( "<div id='object1'/>" ),
    +var newdiv1 = $( "<div id='object1'></div>" ),
       newdiv2 = document.createElement( "div" ),
       existingdiv1 = document.getElementById( "foo" );
     
    diff --git a/entries/prepend.xml b/entries/prepend.xml
    index 912dd6fc..0b7edd46 100644
    --- a/entries/prepend.xml
    +++ b/entries/prepend.xml
    @@ -81,7 +81,7 @@ $( ".container" ).prepend( $( "h2" ) );
         

    Similar to other content-adding methods such as .append() and .before(), .prepend() also supports passing in multiple arguments as input. Supported input includes DOM elements, jQuery objects, HTML strings, and arrays of DOM elements.

    For example, the following will insert two new <div>s and an existing <div> as the first three child nodes of the body:

    
    -var $newdiv1 = $( "<div id='object1'/>"),
    +var $newdiv1 = $( "<div id='object1'></div>"),
       newdiv2 = document.createElement( "div" ),
       existingdiv1 = document.getElementById( "foo" );
     
    
    From 0c57bf7efcfcc29a3fd4ba2dbed6d7e3fc8ed6b6 Mon Sep 17 00:00:00 2001
    From: Connor Cartwright 
    Date: Sun, 8 May 2016 01:11:52 +0100
    Subject: [PATCH 704/998] beforeunload event: Updated wording
    
    Fixes gh-364
    Closes gh-925
    ---
     entries/unload.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/unload.xml b/entries/unload.xml
    index 493e631f..173d560e 100644
    --- a/entries/unload.xml
    +++ b/entries/unload.xml
    @@ -23,7 +23,7 @@
         

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

    The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

    -

    The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers, and contrasted with the proprietary beforeunload event.

    +

    The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers and contrasted with the similar beforeunload event.

    Any unload event handler should be bound to the window object:

    
    
    From f77c9596a541f4fbe2413ce6db656603bf24c7f7 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Fri, 6 May 2016 10:12:50 +0100
    Subject: [PATCH 705/998] jQuery.param: Removed details about traditional flag
    
    Fixes gh-919
    Closes gh-924
    ---
     entries/jQuery.param.xml | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml
    index 468b6db9..2127f55b 100644
    --- a/entries/jQuery.param.xml
    +++ b/entries/jQuery.param.xml
    @@ -27,7 +27,6 @@
         

    This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

    As of jQuery 1.3, the return value of a function is used instead of the function as a String.

    As of jQuery 1.4, the $.param() method serializes deep objects recursively to accommodate modern scripting languages and frameworks such as PHP and Ruby on Rails. You can disable this functionality globally by setting jQuery.ajaxSettings.traditional = true;.

    -

    As of jQuery 1.8, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

    If the object passed is in an Array, it must be an array of objects in the format returned by .serializeArray()

    
     [
    
    From 32c9e324659aa57f1fc8e4a024622609f0144fa2 Mon Sep 17 00:00:00 2001
    From: Tom Delmas 
    Date: Sun, 29 May 2016 15:50:25 +0200
    Subject: [PATCH 706/998] Deferred.progress: Document it can take more than 2
     arguments
    
    More conform with the .fail and .done doc
    
    Closes gh-933
    ---
     entries/deferred.progress.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/deferred.progress.xml b/entries/deferred.progress.xml
    index d1f18cc7..87189af9 100644
    --- a/entries/deferred.progress.xml
    +++ b/entries/deferred.progress.xml
    @@ -14,7 +14,7 @@
           
           
           
    -        Optional additional function, or array of functions, to be called when the Deferred generates progress notifications.
    +        Optional additional functions, or arrays of functions, to be called when the Deferred generates progress notifications.
           
         
       
    
    From 353fb32196bc5dae3efe12ed624b5b4a3cfdd4f1 Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Wed, 11 Feb 2015 20:20:56 +0100
    Subject: [PATCH 707/998] removeAttr: update note on support in IE
    
    Fixes gh-642
    Closes gh-652
    ---
     entries/removeAttr.xml | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/entries/removeAttr.xml b/entries/removeAttr.xml
    index 778e328b..92a92b22 100644
    --- a/entries/removeAttr.xml
    +++ b/entries/removeAttr.xml
    @@ -10,7 +10,7 @@
       Remove an attribute from each element in the set of matched elements.
       
         

    The .removeAttr() method uses the JavaScript removeAttribute() function, but it has the advantage of being able to be called directly on a jQuery object and it accounts for different attribute naming across browsers.

    -

    Note: Removing an inline onclick event handler using .removeAttr() doesn't achieve the desired effect in Internet Explorer 6, 7, or 8. To avoid potential problems, use .prop() instead:

    +

    Note: Removing an inline onclick event handler using .removeAttr() doesn't achieve the desired effect in Internet Explorer 8, 9 and 11. To avoid potential problems, use .prop() instead:

    
     $element.prop( "onclick", null );
     console.log( "onclick property: ", $element[ 0 ].onclick );
    
    From 3185657bf889d3913118581a57bcd690c0265def Mon Sep 17 00:00:00 2001
    From: Arthur Verschaeve 
    Date: Tue, 24 Feb 2015 07:27:16 +0100
    Subject: [PATCH 708/998] child-selector: remove sentence about browser support
    
    Closes gh-662
    ---
     entries/child-selector.xml | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/entries/child-selector.xml b/entries/child-selector.xml
    index 5016a1b3..1b1b27c2 100644
    --- a/entries/child-selector.xml
    +++ b/entries/child-selector.xml
    @@ -13,7 +13,6 @@
       
       Selects all direct child elements specified by "child" of elements specified by "parent".
       
    -    

    As a CSS selector, the child combinator is supported by all modern web browsers including Safari, Firefox, Opera, Chrome, and Internet Explorer 7 and above, but notably not by Internet Explorer versions 6 and below. However, in jQuery, this selector (along with all others) works across all supported browsers, including IE6.

    The child combinator (E > F) can be thought of as a more specific form of the descendant combinator (E F) in that it selects only first-level descendants.

    From 34b96edacf16dc09f75b7b62ce1f1dc8030a0df7 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 2 Mar 2015 17:52:39 +0100 Subject: [PATCH 709/998] Ajax: Update notes about jqXHR.success(), .error() and .complete() Fixes gh-650 Closes gh-677 --- entries/jQuery.ajax.xml | 6 +++--- entries/jQuery.get.xml | 2 +- entries/jQuery.getJSON.xml | 2 +- entries/jQuery.post.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 33ce8b72..d5e6a33c 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -39,7 +39,7 @@ $.ajax({ - By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). @@ -232,7 +232,7 @@ $.ajax({
    • jqXHR.done(function( data, textStatus, jqXHR ) {}); -

      An alternative construct to the success callback option, the .done() method replaces the deprecated jqXHR.success() method. Refer to deferred.done() for implementation details.

      +

      An alternative construct to the success callback option, refer to deferred.done() for implementation details.

    • jqXHR.fail(function( jqXHR, textStatus, errorThrown ) {}); @@ -251,7 +251,7 @@ $.ajax({
    -

    Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    +

    Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    
     // Assign handlers immediately after making the request,
    diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
    index a4e2bcdb..87707e51 100644
    --- a/entries/jQuery.get.xml
    +++ b/entries/jQuery.get.xml
    @@ -75,7 +75,7 @@ jqxhr.always(function() {
     });
         

    Deprecation Notice

    -

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    +

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 23ad5c2d..7d5e08b6 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -87,7 +87,7 @@ jqxhr.complete(function() { });

    Deprecation Notice

    -

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    +

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 0ca6c139..91382759 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -77,7 +77,7 @@ jqxhr.always(function() {

    Deprecation Notice

    -

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    +

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

    From 5fe9b733eaa5de2f2e8beb3752272212961dec49 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 15:15:12 +0200 Subject: [PATCH 710/998] unwrap: add `selector` argument Fixes gh-689 Closes gh-711 --- entries/unwrap.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entries/unwrap.xml b/entries/unwrap.xml index d966952c..d3a7b405 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -4,6 +4,12 @@ 1.4 + + 3.0 + + A selector to check the parent element against. If an element's parent does not match the selector, the element won't be unwrapped. + + Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.

    The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

    From d19cd776a38e23d2bc66e6bf09ec51c0fc2707b0 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Mon, 6 Apr 2015 16:06:09 +0200 Subject: [PATCH 711/998] Selector: correct `removed` version number Fixes gh-696 Ref gh-702 --- entries/selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/selector.xml b/entries/selector.xml index 76a0ea5e..e9e61c1e 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -1,5 +1,5 @@ - + .selector 1.3 From ad85901ab2cc3ab72351c5a1e7c3a1a4491a1340 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Thu, 9 Apr 2015 19:19:50 +0200 Subject: [PATCH 712/998] Context: removed in 3.0 Closes gh-702 --- entries/context.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/context.xml b/entries/context.xml index a7377fa1..0cf0f7b4 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -1,5 +1,5 @@ - + .context 1.3 From b642f08baf04b2c92655a29e41227399765510f8 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sun, 24 May 2015 22:06:17 +0200 Subject: [PATCH 713/998] wrapAll: change description of function argument Fixes gh-605 Closes gh-745 --- entries/wrapAll.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entries/wrapAll.xml b/entries/wrapAll.xml index c6dc02ca..7d8c741d 100644 --- a/entries/wrapAll.xml +++ b/entries/wrapAll.xml @@ -14,8 +14,7 @@ 1.4 - A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. - + A callback function returning the HTML content or jQuery object to wrap around all the matched elements. Within the function, this refers to the first element in the set. Prior to jQuery 3.0, the callback was incorrectly called for every element in the set and received the index position of the element in the set as an argument. From 870eb805664a36257ac6f7761e7ead3ec34b51fa Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 14 Jun 2015 14:55:40 +0100 Subject: [PATCH 714/998] data: Document behavior changes Document changes that align the method to the Dataset API's behavior Fixes gh-730 Closes gh-758 --- entries/data.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entries/data.xml b/entries/data.xml index f54a229c..80ccee99 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -31,6 +31,7 @@ $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1,

    In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

    Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

    +

    jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of [the algorithm of the Dataset API](http://www.w3.org/TR/html5/dom.html#dom-dataset). Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

    @@ -88,6 +89,7 @@ alert( $( "body" ).data( "foo" ) ); // undefined $( "body" ).data( "bar", "foobar" ); alert( $( "body" ).data( "bar" ) ); // foobar
    +

    jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of [the algorithm of the Dataset API](http://www.w3.org/TR/html5/dom.html#dom-dataset). Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    HTML5 data-* Attributes

    From 025e1fcd02b5a9841c974a2fe82b8c3614a53013 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 27 Jul 2015 14:03:43 +0100 Subject: [PATCH 715/998] Visibility filters: Specified new behavior Fixes gh-737 Closes gh-789 --- entries/hidden-selector.xml | 1 + entries/visible-selector.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index 2c2e6e2c..47c0bf6c 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -19,6 +19,7 @@

    This selector is the opposite of the :visible selector. So, every element selected by :hidden isn't selected by :visible and vice versa.

    During animations to show an element, the element is considered to be visible at the start of the animation.

    How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

    +

    jQuery 3 slightly modifies the meaning of :hidden (and therefore of :visible). Starting with this version, elements will be considered :hidden if they don't have any layout boxes. For example, br elements and inline elements with no content will not be selected by the :hidden selector.

    diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml index 25df8ee7..6b159740 100644 --- a/entries/visible-selector.xml +++ b/entries/visible-selector.xml @@ -14,6 +14,7 @@

    All option elements are considered hidden, regardless of their selected state.

    During animations that hide an element, the element is considered visible until the end of the animation. During animations to show an element, the element is considered visible at the start at the animation.

    How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

    +

    jQuery 3 slightly modifies the meaning of :visible (and therefore of :hidden). Starting with this version, elements will be considered :visible if they have any layout boxes, including those of zero width and/or height. For example, br elements and inline elements with no content will be selected by the :visible selector.

    From 5854b44ba5f6afd8b356e5c2417eadc3cf29a118 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 19 Oct 2015 00:47:01 +0100 Subject: [PATCH 716/998] isNumeric: Updated description based on new behavior Fixes gh-817 Closes gh-819 --- entries/jQuery.isNumeric.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index 7a4e7f6c..b51eb84d 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -9,7 +9,8 @@ -

    The $.isNumeric() method checks whether a value is a finite number, or would be cast to one by Number. If so, it returns true. Otherwise it returns false. The argument can be of any type.

    +

    The $.isNumeric() method checks whether its argument represents a numeric value. If so, it returns true. Otherwise it returns false. The argument can be of any type.

    +

    As of jQuery 3.0 $.isNumeric() returns true only if the argument is of type number, or if it's of type string and it can be coerced into finite numbers. In all other cases, it returns false.

    Sample return values of $.isNumeric with various inputs. From d6d3e7a8f8d7de252ab721989f96f7425ae50231 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 8 Jan 2016 00:33:39 +0000 Subject: [PATCH 717/998] toggleClass: Document deprecation of a signature Fixes gh-851 Closes gh-860 --- entries/toggleClass.xml | 176 ++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 86 deletions(-) diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index f14cb8ed..5a18aa05 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -1,69 +1,62 @@ - - .toggleClass() - - 1.0 - - One or more class names (separated by spaces) to be toggled for each element in the matched set. - - - - 1.3 - - One or more class names (separated by spaces) to be toggled for each element in the matched set. - - - A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. - - - - 1.4 - - A boolean value to determine whether the class should be added or removed. - - - - 1.4 - - - - - - A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. - - - A boolean value to determine whether the class should be added or removed. - - - Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument. - -

    Before jQuery version 1.12/2.2, the .toggleClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

    -

    As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .toggleClass() can be used on XML or SVG documents.

    -

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    -
    
    +
    +  
    +    .toggleClass()
    +    
    +      1.0
    +      
    +        One or more class names (separated by spaces) to be toggled for each element in the matched set.
    +      
    +    
    +    
    +      1.3
    +      
    +        One or more class names (separated by spaces) to be toggled for each element in the matched set.
    +      
    +      
    +        A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
    +      
    +    
    +    
    +      1.4
    +      
    +        
    +        
    +        
    +        
    +        A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments.
    +      
    +      
    +        A boolean value to determine whether the class should be added or removed.
    +      
    +    
    +    Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the state argument.
    +    
    +      

    This method takes one or more class names as its parameter. In the first version, if an element in the matched set of elements already has the class, then it is removed; if an element does not have the class, then it is added. For example, we can apply .toggleClass() to a simple <div>:

    +
    
     <div class="tumble">Some text.</div>
    -    
    -

    The first time we apply $( "div.tumble" ).toggleClass( "bounce" ), we get the following:

    -
    
    +      
    +

    The first time we apply $( "div.tumble" ).toggleClass( "bounce" ), we get the following:

    +
    
     <div class="tumble bounce">Some text.</div>
    -    
    -

    The second time we apply $( "div.tumble" ).toggleClass( "bounce" ), the <div> class is returned to the single tumble value:

    -
    <div class="tumble">Some text.</div>
    -

    Applying .toggleClass( "bounce spin" ) to the same <div> alternates between <div class="tumble bounce spin"> and <div class="tumble">.

    -

    The second version of .toggleClass() uses the second parameter for determining whether the class should be added or removed. If this parameter's value is true, then the class is added; if false, the class is removed. In essence, the statement:

    -
    
    +      
    +

    The second time we apply $( "div.tumble" ).toggleClass( "bounce" ), the <div> class is returned to the single tumble value:

    +
    <div class="tumble">Some text.</div>
    +

    Applying .toggleClass( "bounce spin" ) to the same <div> alternates between <div class="tumble bounce spin"> and <div class="tumble">.

    +

    The second version of .toggleClass() uses the second parameter for determining whether the class should be added or removed. If this parameter's value is true, then the class is added; if false, the class is removed. In essence, the statement:

    +
    
     $( "#foo" ).toggleClass( className, addOrRemove );
    -    
    -

    is equivalent to:

    -
    
    +      
    +

    is equivalent to:

    +
    
     if ( addOrRemove ) {
       $( "#foo" ).addClass( className );
     } else {
       $( "#foo" ).removeClass( className );
     }
    -    
    -

    As of jQuery 1.4, if no arguments are passed to .toggleClass(), all class names on the element the first time .toggleClass() is called will be toggled. Also as of jQuery 1.4, the class name to be toggled can be determined by passing in a function.

    -
    
    +      
    +

    As of jQuery 1.4, if no arguments are passed to .toggleClass(), all class names on the element the first time .toggleClass() is called will be toggled. Also as of jQuery 1.4, the class name to be toggled can be determined by passing in a function.

    +
    
     $( "div.foo" ).toggleClass(function() {
       if ( $( this ).parent().is( ".bar" ) ) {
         return "happy";
    @@ -71,17 +64,17 @@ $( "div.foo" ).toggleClass(function() {
         return "sad";
       }
     });
    -
    -

    This example will toggle the happy class for <div class="foo"> elements if their parent element has a class of bar; otherwise, it will toggle the sad class.

    -
    - - Toggle the class 'highlight' when a paragraph is clicked. - - - - - - Add the "highlight" class to the clicked paragraph on every third click of that paragraph, remove it every first and second click. - - - - - - Toggle the class name(s) indicated on the buttons for each div. - - - - - - - - - - - -
    + + + + + + + + + + + 1.4 + + A boolean value to determine whether the class should be added or removed. + + + +
    This signature (only!) is deprecated as of jQuery 3.0.
    +
    +
    +
    \ No newline at end of file From 956f186173eb35bf1f8ac9b5d3fd19679d1ca257 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 11 Mar 2016 01:12:46 +0000 Subject: [PATCH 718/998] jQuery.parseJSON: Added deprecation note for jQuery 3 Fixes gh-898 Closes gh-899 --- entries/jQuery.parseJSON.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index bc9dcc78..d0965e41 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -1,5 +1,5 @@ - + @@ -26,6 +26,7 @@

    The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

    Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

    Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

    +

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

    Parse a JSON string. From 0d09c6a70ae16ec2098c8a9d67fb5c92fb53624b Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Thu, 7 Apr 2016 01:03:27 +0100 Subject: [PATCH 719/998] jQuery.parseHTML: Specified behavior of version 3 Fixes gh-903 Closes gh-907 --- entries/jQuery.parseHTML.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index 930d60a2..5354627a 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -17,6 +17,7 @@

    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.

    From a062f9fc82c3a24789d157fc0508d07ab198edb8 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 20 May 2016 01:28:05 +0100 Subject: [PATCH 720/998] jQuery.param: Updated version for traditional flag Ref gh-924 Closes gh-932 --- entries/jQuery.param.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index 2127f55b..9a80fc2b 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -27,6 +27,7 @@

    This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

    As of jQuery 1.3, the return value of a function is used instead of the function as a String.

    As of jQuery 1.4, the $.param() method serializes deep objects recursively to accommodate modern scripting languages and frameworks such as PHP and Ruby on Rails. You can disable this functionality globally by setting jQuery.ajaxSettings.traditional = true;.

    +

    As of jQuery 3.0, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

    If the object passed is in an Array, it must be an array of objects in the format returned by .serializeArray()

    
     [
    
    From b2e0296987e67e431caf0c5df2af869ee9702e8e Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Wed, 1 Jun 2016 01:04:58 +0100
    Subject: [PATCH 721/998] jQuery.escapeSelector: Created entry
    
    Fixes gh-880
    Closes gh-934
    ---
     entries/jQuery.escapeSelector.xml | 29 +++++++++++++++++++++++++++++
     1 file changed, 29 insertions(+)
     create mode 100644 entries/jQuery.escapeSelector.xml
    
    diff --git a/entries/jQuery.escapeSelector.xml b/entries/jQuery.escapeSelector.xml
    new file mode 100644
    index 00000000..9e9a91d1
    --- /dev/null
    +++ b/entries/jQuery.escapeSelector.xml
    @@ -0,0 +1,29 @@
    +
    +
    +  jQuery.escapeSelector()
    +  Escapes any character that has a special meaning in a CSS selector.
    +  
    +    3.0
    +    
    +      A string containing a selector expression to escape.
    +    
    +  
    +  
    +    

    This method is useful for situations where a class name or an ID contains characters that have a special meaning in CSS, such as the dot or the semicolon.

    +

    The method is essentially a shim for the CSS Working Group's CSS.escape() method. The main difference is that $.escapeSelector() can be reliably used in all of jQuery's supported browsers.

    +
    + + Escape an ID containing a hash. + + + + Select all the elements having a class name of .box inside a div. + + + + +
    From a6452420b248ac519a93084ff9a539a3d0a954f5 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Thu, 9 Jun 2016 17:26:02 -0400 Subject: [PATCH 722/998] 1.12.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 20678798..5703775b 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": "1.12.3", + "version": "1.12.4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2dcad72a2f3eed7e0e1d37efc16b8424f9a7f8aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Fri, 10 Jun 2016 00:07:34 +0200 Subject: [PATCH 723/998] categories: Change links from http to https --- categories.xml | 56 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/categories.xml b/categories.xml index c181a548..dd4b277a 100644 --- a/categories.xml +++ b/categories.xml @@ -38,7 +38,7 @@ @@ -48,22 +48,22 @@ @@ -98,7 +98,7 @@ ) as a literal part of a name, it must be escaped with with two backslashes: \\. For example, an element with id="foo.bar", can use the selector $("#foo\\.bar"). The W3C CSS specification contains the complete set of rules regarding valid CSS selectors. Also useful is the blog entry by Mathias Bynens on CSS character escape sequences for identifiers.

    +

    To use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[\]^`{|}~ ) as a literal part of a name, it must be escaped with with two backslashes: \\. For example, an element with id="foo.bar", can use the selector $("#foo\\.bar"). The W3C CSS specification contains the complete set of rules regarding valid CSS selectors. Also useful is the blog entry by Mathias Bynens on CSS character escape sequences for identifiers.

    ]]>
    , will select <a href="example.html" rel="nofollow">Some text</a> but not <a href="example.html" rel="nofollow foe">Some text</a>.

    -

    Attribute values in selector expressions must follow the rules for W3C CSS selectors; in general, that means anything other than a valid identifier should be surrounded by quotation marks.

    +

    Attribute values in selector expressions must follow the rules for W3C CSS selectors; in general, that means anything other than a valid identifier should be surrounded by quotation marks.

    • double quotes inside single quotes: $('a[rel="nofollow self"]')
    • single quotes inside double quotes: $("a[rel='nofollow self']")
    • @@ -258,7 +258,7 @@ var files = event.originalEvent.dataTransfer.files; - + @@ -276,7 +276,7 @@ var files = event.originalEvent.dataTransfer.files; - + @@ -302,52 +302,52 @@ var files = event.originalEvent.dataTransfer.files; @@ -362,22 +362,22 @@ var files = event.originalEvent.dataTransfer.files; - + @@ -394,7 +394,7 @@ var files = event.originalEvent.dataTransfer.files; jQuery.Callbacks() Toggling Animations Work Intuitively

      -

      For more information, see the Release Notes/Changelog at http://blog.jquery.com/2011/11/03/jquery-1-7-released/

      +

      For more information, see the Release Notes/Changelog at https://blog.jquery.com/2011/11/03/jquery-1-7-released/


      ]]>
      @@ -402,7 +402,7 @@ var files = event.originalEvent.dataTransfer.files; @@ -410,7 +410,7 @@ var files = event.originalEvent.dataTransfer.files; From cdb0c5ba6b3af574134acc13b10144e0a9dc2107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Fri, 10 Jun 2016 00:08:50 +0200 Subject: [PATCH 724/998] categories: Correct a typo --- categories.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index dd4b277a..937f6ab5 100644 --- a/categories.xml +++ b/categories.xml @@ -408,7 +408,7 @@ var files = event.originalEvent.dataTransfer.files; ]]> + + + From 93110b7fd8824a467b6e585d520d29c9d51b0092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Sat, 11 Jun 2016 00:56:16 +0200 Subject: [PATCH 726/998] 1.12.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5703775b..2c0fb08a 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": "1.12.4", + "version": "1.12.5", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 7af26e3158e68415a1b5f28cf7b96dcc1515d2c3 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Fri, 1 Jul 2016 17:19:15 +0100 Subject: [PATCH 727/998] data: Replaced URL markdown syntax with HTML Fixes gh-943 Closes gh-944 --- entries/data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/data.xml b/entries/data.xml index 80ccee99..3606395d 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -31,7 +31,7 @@ $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1,

    In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

    Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

    -

    jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of [the algorithm of the Dataset API](http://www.w3.org/TR/html5/dom.html#dom-dataset). Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    +

    jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

    Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

    From ef3cc87ef771de72853f8f73118e02605a3ac82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 6 Jul 2016 11:11:55 +0200 Subject: [PATCH 728/998] 1.12.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c0fb08a..28ef474a 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": "1.12.5", + "version": "1.12.6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From abe47693da490850e3c545c74a6ebcc14989c9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 6 Jul 2016 11:36:39 +0200 Subject: [PATCH 729/998] jQuery.readyException: Add the page, add the 3.1 category Fixes #942 Closes #946 --- categories.xml | 6 ++++++ entries/jQuery.readyException.xml | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 entries/jQuery.readyException.xml diff --git a/categories.xml b/categories.xml index a7190a24..55038248 100644 --- a/categories.xml +++ b/categories.xml @@ -422,6 +422,12 @@ var files = event.originalEvent.dataTransfer.files;
    ]]> + + + diff --git a/entries/jQuery.readyException.xml b/entries/jQuery.readyException.xml new file mode 100644 index 00000000..2c534ea9 --- /dev/null +++ b/entries/jQuery.readyException.xml @@ -0,0 +1,24 @@ + + + jQuery.readyException() + Handles errors thrown synchronously in functions wrapped in jQuery(). + + 3.1 + + An error thrown in the function wrapped in jQuery(). + + + +

    This method is fired when an error is thrown synchronously in a function wrapped in jQuery() or jQuery( document ).ready(), or equivalent. By default it re-throws the error in a timeout so that it's logged in the console and passed to window.onerror instead of being swallowed. Overwrite this method if you want to handle such errors differently.

    +
    + + Pass the received error to console.error. + + + + +
    From d143a116554e8a70267dfe38453a7398b5e3463f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Fri, 8 Jul 2016 01:01:41 +0200 Subject: [PATCH 730/998] 1.12.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28ef474a..266fe856 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": "1.12.6", + "version": "1.12.7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2b3ebc617f525a1b7c7f6c89e8fe5e97c54534f7 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Thu, 14 Jul 2016 08:34:39 -0400 Subject: [PATCH 731/998] val(): Update select multiple no selected statement for 3.0. Fixes #828 --- entries/val.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/entries/val.xml b/entries/val.xml index 1ba0c365..7ab00ff3 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -11,7 +11,8 @@ Get the current value of the first element in the set of matched elements. -

    The .val() method is primarily used to get the values of form elements such as input, select and textarea. When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), it returns an array containing the value of each selected option, or null if no options are selected. When called on an empty collection, it returns undefined.

    +

    The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

    +

    When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

    For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

    
     // Get the value from a dropdown select
    @@ -27,7 +28,7 @@ $( "input:checkbox:checked" ).val();
     $( "input:radio[name=bar]:checked" ).val();
           
    -

    Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

    +

    Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR, however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

    
     $.valHooks.textarea = {
    @@ -115,17 +116,17 @@ $( "input" )
           1.4
           
             
    -             
    -                 
    +        
    +        
             A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
           
         
         Set the value of each element in the set of matched elements.
         
           

    This method is typically used to set the values of form fields.

    -

    val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that don't match one of the elements of the array will be unchecked or unselected, depending on the type. In case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

    +

    val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that doesn't match one of the elements of the array will be unchecked or unselected, depending on the type. In the case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

    Setting values using this method (or using the native value property) does not cause the dispatch of the change event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call .trigger( "change" ) after setting the value.

    -

    The .val() method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

    +

    The .val() method allows settting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

    
     $( "input:text.items" ).val(function( index, value ) {
       return value + " " + this.className;
    
    From da62fdd3250f71ecec1ccf5d2d66ee1a3337ed03 Mon Sep 17 00:00:00 2001
    From: Aurelio De Rosa 
    Date: Sun, 17 Jul 2016 17:17:50 +0100
    Subject: [PATCH 732/998] Updated methods removed in jQuery 3
    
    Fixes gh-956
    Closes gh-957
    ---
     entries/andSelf.xml    | 3 ++-
     entries/context.xml    | 1 +
     entries/error.xml      | 3 ++-
     entries/load-event.xml | 3 ++-
     entries/size.xml       | 3 ++-
     entries/unload.xml     | 3 ++-
     6 files changed, 11 insertions(+), 5 deletions(-)
    
    diff --git a/entries/andSelf.xml b/entries/andSelf.xml
    index 6870b479..5adfd1ae 100644
    --- a/entries/andSelf.xml
    +++ b/entries/andSelf.xml
    @@ -1,5 +1,5 @@
     
    -
    +
       .andSelf()
       
         1.2
    @@ -75,4 +75,5 @@ $( "div.after-andself" ).find( "p" ).andSelf().addClass( "background" );
       
       
       
    +  
     
    diff --git a/entries/context.xml b/entries/context.xml
    index 0cf0f7b4..5fc5362a 100644
    --- a/entries/context.xml
    +++ b/entries/context.xml
    @@ -26,4 +26,5 @@ Context: 
      +
      diff --git a/entries/error.xml b/entries/error.xml index 872ff70d..6f646aa2 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -1,5 +1,5 @@ - + .error() Bind an event handler to the "error" JavaScript event. @@ -60,4 +60,5 @@ $( "img" ) + diff --git a/entries/load-event.xml b/entries/load-event.xml index d95f81bc..e3739cb7 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -1,5 +1,5 @@ - + .load() Bind an event handler to the "load" JavaScript event. @@ -76,4 +76,5 @@ $( "img.userIcon" ).load(function() { + diff --git a/entries/size.xml b/entries/size.xml index 2d092a37..e7dd1223 100644 --- a/entries/size.xml +++ b/entries/size.xml @@ -1,5 +1,5 @@ - + .size() 1.0 @@ -66,4 +66,5 @@ $( document.body ) + diff --git a/entries/unload.xml b/entries/unload.xml index 173d560e..1306ddd6 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -1,5 +1,5 @@ - + .unload() 1.0 @@ -46,4 +46,5 @@ $( window ).unload(function() { + From d5398a69edf4a97a44b49333e7ddefba36edc981 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 19 Apr 2016 02:12:21 +0100 Subject: [PATCH 733/998] jQuery.uniqueSort: Fixed category name Fixes gh-908 Closes gh-913 --- categories.xml | 8 ++++++++ entries/jQuery.uniqueSort.xml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index 55038248..d4d31106 100644 --- a/categories.xml +++ b/categories.xml @@ -414,6 +414,14 @@ var files = event.originalEvent.dataTransfer.files;
      ]]> + + + +
      From 3f3b61896c67f1bbef499e2135ebfb534ed86684 Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sun, 17 Jul 2016 13:19:35 -0400 Subject: [PATCH 734/998] Fix typo --- entries/val.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/val.xml b/entries/val.xml index 7ab00ff3..d2e9dbfd 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -126,7 +126,7 @@ $( "input" )

      This method is typically used to set the values of form fields.

      val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that doesn't match one of the elements of the array will be unchecked or unselected, depending on the type. In the case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

      Setting values using this method (or using the native value property) does not cause the dispatch of the change event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call .trigger( "change" ) after setting the value.

      -

      The .val() method allows settting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

      +

      The .val() method allows setting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

      
       $( "input:text.items" ).val(function( index, value ) {
         return value + " " + this.className;
      
      From c0cd6b2d045ea2b8b481c424849f1107a8074549 Mon Sep 17 00:00:00 2001
      From: Aurelio De Rosa 
      Date: Sun, 17 Jul 2016 17:17:50 +0100
      Subject: [PATCH 735/998] Updated methods removed in jQuery 3
      
      Fixes gh-956
      Closes gh-957
      ---
       entries/andSelf.xml    | 3 ++-
       entries/context.xml    | 1 +
       entries/error.xml      | 3 ++-
       entries/load-event.xml | 3 ++-
       entries/size.xml       | 3 ++-
       entries/unload.xml     | 3 ++-
       6 files changed, 11 insertions(+), 5 deletions(-)
      
      diff --git a/entries/andSelf.xml b/entries/andSelf.xml
      index 6870b479..5adfd1ae 100644
      --- a/entries/andSelf.xml
      +++ b/entries/andSelf.xml
      @@ -1,5 +1,5 @@
       
      -
      +
         .andSelf()
         
           1.2
      @@ -75,4 +75,5 @@ $( "div.after-andself" ).find( "p" ).andSelf().addClass( "background" );
         
         
         
      +  
       
      diff --git a/entries/context.xml b/entries/context.xml
      index 0cf0f7b4..5fc5362a 100644
      --- a/entries/context.xml
      +++ b/entries/context.xml
      @@ -26,4 +26,5 @@ Context: 
        +
        diff --git a/entries/error.xml b/entries/error.xml index 872ff70d..6f646aa2 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -1,5 +1,5 @@ - + .error() Bind an event handler to the "error" JavaScript event. @@ -60,4 +60,5 @@ $( "img" ) + diff --git a/entries/load-event.xml b/entries/load-event.xml index d95f81bc..e3739cb7 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -1,5 +1,5 @@ - + .load() Bind an event handler to the "load" JavaScript event. @@ -76,4 +76,5 @@ $( "img.userIcon" ).load(function() { + diff --git a/entries/size.xml b/entries/size.xml index 2d092a37..e7dd1223 100644 --- a/entries/size.xml +++ b/entries/size.xml @@ -1,5 +1,5 @@ - + .size() 1.0 @@ -66,4 +66,5 @@ $( document.body ) + diff --git a/entries/unload.xml b/entries/unload.xml index 173d560e..1306ddd6 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -1,5 +1,5 @@ - + .unload() 1.0 @@ -46,4 +46,5 @@ $( window ).unload(function() { + From 1b230db9c25a2fe55801454bf83487ca903bca97 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 19 Apr 2016 02:12:21 +0100 Subject: [PATCH 736/998] jQuery.uniqueSort: Fixed category name Fixes gh-908 Closes gh-913 --- categories.xml | 8 ++++++++ entries/jQuery.uniqueSort.xml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index 55038248..d4d31106 100644 --- a/categories.xml +++ b/categories.xml @@ -414,6 +414,14 @@ var files = event.originalEvent.dataTransfer.files;
        ]]> + + + +
        From 5689f1ade9bcbdb9bb9507f44ccf60dba167c2b8 Mon Sep 17 00:00:00 2001 From: Anton Rieder Date: Sun, 17 Jul 2016 13:25:40 -0400 Subject: [PATCH 737/998] Fix documentation for .val() --- entries/val.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entries/val.xml b/entries/val.xml index 1ba0c365..2aaeeb8e 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -13,6 +13,7 @@

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), it returns an array containing the value of each selected option, or null if no options are selected. When called on an empty collection, it returns undefined.

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        +

        jQuery 3 changes the behavior of this method to return an empty array if a collection is a select-multiple and no options are selected.

        
         // Get the value from a dropdown select
         $( "select.foo option:selected").val();
        @@ -43,6 +44,8 @@ $.valHooks.textarea = {
         function displayVals() {
           var singleValues = $( "#single" ).val();
           var multipleValues = $( "#multiple" ).val() || [];
        +  // When using jQuery 3:
        +  // var multipleValues = $( "#multiple" ).val()
           $( "p" ).html( "Single: " + singleValues +
             " Multiple: " + multipleValues.join( ", " ) );
         }
        
        From 56358d08841fc49d842012d82051e9a085471d1e Mon Sep 17 00:00:00 2001
        From: Anton Rieder 
        Date: Sun, 17 Jul 2016 13:25:40 -0400
        Subject: [PATCH 738/998] Fix documentation for .val()
        
        ---
         entries/val.xml | 3 +++
         1 file changed, 3 insertions(+)
        
        diff --git a/entries/val.xml b/entries/val.xml
        index d2e9dbfd..73d9d521 100644
        --- a/entries/val.xml
        +++ b/entries/val.xml
        @@ -14,6 +14,7 @@
               

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

        When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        +

        jQuery 3 changes the behavior of this method to return an empty array if a collection is a select-multiple and no options are selected.

        
         // Get the value from a dropdown select
         $( "select.foo option:selected").val();
        @@ -44,6 +45,8 @@ $.valHooks.textarea = {
         function displayVals() {
           var singleValues = $( "#single" ).val();
           var multipleValues = $( "#multiple" ).val() || [];
        +  // When using jQuery 3:
        +  // var multipleValues = $( "#multiple" ).val()
           $( "p" ).html( "Single: " + singleValues +
             " Multiple: " + multipleValues.join( ", " ) );
         }
        
        From ef2a80ec079a49bfebe402814d91c827949ba6a6 Mon Sep 17 00:00:00 2001
        From: Karl Swedberg 
        Date: Sun, 17 Jul 2016 13:35:40 -0400
        Subject: [PATCH 739/998] val(): Update select multiple no selected statement
         for 3.0. Fixes gh-828. Closes gh-955
        
        ---
         entries/val.xml | 13 +++++++------
         1 file changed, 7 insertions(+), 6 deletions(-)
        
        diff --git a/entries/val.xml b/entries/val.xml
        index 2aaeeb8e..73d9d521 100644
        --- a/entries/val.xml
        +++ b/entries/val.xml
        @@ -11,7 +11,8 @@
             
             Get the current value of the first element in the set of matched elements.
             
        -      

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), it returns an array containing the value of each selected option, or null if no options are selected. When called on an empty collection, it returns undefined.

        +

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

        +

        When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        jQuery 3 changes the behavior of this method to return an empty array if a collection is a select-multiple and no options are selected.

        
        @@ -28,7 +29,7 @@ $( "input:checkbox:checked" ).val();
         $( "input:radio[name=bar]:checked" ).val();
               
        -

        Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

        +

        Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR, however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

        
         $.valHooks.textarea = {
        @@ -118,17 +119,17 @@ $( "input" )
               1.4
               
                 
        -             
        -                 
        +        
        +        
                 A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
               
             
             Set the value of each element in the set of matched elements.
             
               

        This method is typically used to set the values of form fields.

        -

        val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that don't match one of the elements of the array will be unchecked or unselected, depending on the type. In case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

        +

        val() allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <input type="checkbox">, <input type="radio">, and <option>s inside of a <select>. In this case, the inputs and the options having a value that matches one of the elements of the array will be checked or selected while those having a value that doesn't match one of the elements of the array will be unchecked or unselected, depending on the type. In the case of <input type="radio">s that are part of a radio group and <select>s, any previously selected element will be deselected.

        Setting values using this method (or using the native value property) does not cause the dispatch of the change event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call .trigger( "change" ) after setting the value.

        -

        The .val() method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

        +

        The .val() method allows setting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

        
         $( "input:text.items" ).val(function( index, value ) {
           return value + " " + this.className;
        
        From 470df7b2e68743ed0e6f15addc649a28a4129b3b Mon Sep 17 00:00:00 2001
        From: Karl Swedberg 
        Date: Sun, 17 Jul 2016 13:54:34 -0400
        Subject: [PATCH 740/998] Fix duplicate info due to my bad merge
        
        ---
         entries/val.xml | 8 ++++----
         1 file changed, 4 insertions(+), 4 deletions(-)
        
        diff --git a/entries/val.xml b/entries/val.xml
        index 73d9d521..b2aa7613 100644
        --- a/entries/val.xml
        +++ b/entries/val.xml
        @@ -13,9 +13,9 @@
             
               

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

        When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

        -

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

        -

        jQuery 3 changes the behavior of this method to return an empty array if a collection is a select-multiple and no options are selected.

        +

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values. For example:

        
        +
         // Get the value from a dropdown select
         $( "select.foo option:selected").val();
         
        @@ -29,7 +29,7 @@ $( "input:checkbox:checked" ).val();
         $( "input:radio[name=bar]:checked" ).val();
               
        -

        Note: At present, using .val() on textarea elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR, however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

        +

        Note: At present, using .val() on <textarea> elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR, however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

        
         $.valHooks.textarea = {
        @@ -46,7 +46,7 @@ function displayVals() {
           var singleValues = $( "#single" ).val();
           var multipleValues = $( "#multiple" ).val() || [];
           // When using jQuery 3:
        -  // var multipleValues = $( "#multiple" ).val()
        +  // var multipleValues = $( "#multiple" ).val();
           $( "p" ).html( "Single: " + singleValues +
             " Multiple: " + multipleValues.join( ", " ) );
         }
        
        From 574cd0ab5c264101f1f339442be5aa2dbd858937 Mon Sep 17 00:00:00 2001
        From: Karl Swedberg 
        Date: Sun, 17 Jul 2016 14:07:34 -0400
        Subject: [PATCH 741/998] .val(): Ugh. Remove another merge snafu.
        
        ---
         entries/val.xml | 4 ----
         1 file changed, 4 deletions(-)
        
        diff --git a/entries/val.xml b/entries/val.xml
        index 0283b1bc..b2aa7613 100644
        --- a/entries/val.xml
        +++ b/entries/val.xml
        @@ -46,11 +46,7 @@ function displayVals() {
           var singleValues = $( "#single" ).val();
           var multipleValues = $( "#multiple" ).val() || [];
           // When using jQuery 3:
        -<<<<<<< HEAD
        -  // var multipleValues = $( "#multiple" ).val()
        -=======
           // var multipleValues = $( "#multiple" ).val();
        ->>>>>>> multi-select-val
           $( "p" ).html( "Single: " + singleValues +
             " Multiple: " + multipleValues.join( ", " ) );
         }
        
        From c15623ef1cac00bec4fb6fc369376d1612d3c9e5 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= 
        Date: Mon, 25 Jul 2016 13:43:48 +0200
        Subject: [PATCH 742/998] 1.12.8
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index 266fe856..77495144 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": "1.12.7",
        +  "version": "1.12.8",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From d2d750a6fe8f0a66cacd295fc0123b4a4fdf42d3 Mon Sep 17 00:00:00 2001
        From: Gaurang Patel 
        Date: Tue, 2 Aug 2016 18:22:17 -0700
        Subject: [PATCH 743/998] clone: Fixed a minor typo
        
        Closes gh-963
        ---
         entries/clone.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/clone.xml b/entries/clone.xml
        index 91d7bc29..764b6668 100644
        --- a/entries/clone.xml
        +++ b/entries/clone.xml
        @@ -63,7 +63,7 @@ $( ".hello" ).clone().appendTo( ".goodbye" );
             

        However, objects and arrays within element data are not copied and will continue to be shared between the cloned element and the original element. To deep copy all data, copy each one manually:

        
         // Original element with attached data
        -var $elem = $( "#elem" ).data( "arr": [ 1 ] ),
        +var $elem = $( "#elem" ).data( "arr", [ 1 ] ),
             $clone = $elem.clone( true )
               // Deep copy to prevent data sharing
               .data( "arr", $.extend( [], $elem.data( "arr" ) ) );
        
        From 925c41e5a4aa0b8cd0b1f31ceb3e98470f9f35cd Mon Sep 17 00:00:00 2001
        From: Aurelio De Rosa 
        Date: Fri, 5 Aug 2016 14:39:25 +0100
        Subject: [PATCH 744/998] 1.12.9
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index 77495144..961b2340 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": "1.12.8",
        +  "version": "1.12.9",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From ba2abaa99d0236e8360efe9e76e778984c91b715 Mon Sep 17 00:00:00 2001
        From: Dave Methvin 
        Date: Sat, 6 Aug 2016 17:50:33 -0400
        Subject: [PATCH 745/998] Ready: Rewrite to clarify and add jQuery 3.0 notes.
        
        Fixes gh-964
        Closes gh-967
        ---
         entries/ready.xml | 50 +++++++++++++++++++++++++----------------------
         1 file changed, 27 insertions(+), 23 deletions(-)
        
        diff --git a/entries/ready.xml b/entries/ready.xml
        index 09e1993f..9f14ae52 100644
        --- a/entries/ready.xml
        +++ b/entries/ready.xml
        @@ -9,49 +9,53 @@
             
           
           
        -    

        While JavaScript provides the load event for executing code when a page is rendered, this event does not get triggered until all assets such as images have been completely received. In most cases, the script can be run as soon as the DOM hierarchy has been fully constructed. The handler passed to .ready() is guaranteed to be executed after the DOM is ready, so this is usually the best place to attach all other event handlers and run other jQuery code. When using scripts that rely on the value of CSS style properties, it's important to reference external stylesheets or embed style elements before referencing the scripts.

        -

        In cases where code relies on loaded assets (for example, if the dimensions of an image are required), the code should be placed in a handler for the load event instead.

        -
        -

        The .ready() method is generally incompatible with the <body onload=""> attribute. If load must be used, either do not use .ready() or use jQuery's .load() method to attach load event handlers to the window or to more specific items, like images. -

        -
        -

        All three of the following syntaxes are equivalent:

        +

        The .ready() method offers a way to run JavaScript code as soon as the page's Document Object Model (DOM) becomes safe to manipulate. This will often be a good time to perform tasks that are needed before the user views or interacts with the page, for example to add event handlers and initialize plugins. When multiple functions are added via successive calls to this method, they run when the DOM is ready in the order in which they are added. As of jQuery 3.0, jQuery ensures that an exception occuring in one handler does not prevent subsequently added handlers from executing.

        + +

        Most browsers provide similar functionality in the form of a DOMContentLoaded event. However, jQuery's .ready() method differs in an important and useful way: If the DOM becomes ready and the browser fires DOMContentLoaded before the code calls .ready( handler ), the function handler will still be executed. In contrast, a DOMContentLoaded event listener added after the event fires is never executed.

        + +

        Browsers also provide the load event on the window object. When this event fires it indicates that all assets on the page have loaded, including images. This event can be watched in jQuery using $( window ).on( "load", handler ). In cases where code relies on loaded assets (for example, if the dimensions of an image are required), the code should be placed in a handler for the load event instead.

        + +

        Note that although the DOM always becomes ready before the page is fully loaded, it is usually not safe to attach a load event listener in code executed during a .ready() handler. For example, scripts can be loaded dynamically long after the page has loaded using methods such as $.getScript(). Although handlers added by .ready() will always be executed in a dynamically loaded script, the window's load event has already occurred and those listeners will never run.

        + +

        jQuery offers several ways to attach a function that will run when the DOM is ready. All of the following syntaxes are equivalent:

        +
          -
        • - $( document ).ready( handler ) -
        • -
        • $().ready( handler ) (this is not recommended)
        • -
        • - $( handler ) -
        • +
        • $( handler )
        • +
        • $( document ).ready( handler )
        • +
        • $( "document" ).ready( handler )
        • +
        • $( "img" ).ready( handler )
        • +
        • $().ready( handler )
        -

        There is also $(document).on( "ready", handler ), deprecated as of jQuery 1.8. This behaves similarly to the ready method but if the ready event has already fired and you try to .on( "ready" ) the bound handler will not be executed. Ready handlers bound this way are executed after any bound by the other three methods above.

        -

        The .ready() method can only be called on a jQuery object matching the current document, so the selector can be omitted.

        + +

        As of jQuery 3.0, only the first syntax is recommended; the other syntaxes still work but are deprecated. This is because the selection has no bearing on the behavior of the .ready() method, which is inefficient and can lead to incorrect assumptions about the method's behavior. For example, the third syntax works with "document" which selects nothing. The fourth syntax waits for the document to be ready but implies (incorrectly) that it waits for images to become ready.

        + +

        There is also $(document).on( "ready", handler ), deprecated as of jQuery 1.8 and removed in jQuery 3.0. Note that if the DOM becomes ready before this event is attached, the handler will not be executed.

        +

        The .ready() method is typically used with an anonymous function:

        
         $( document ).ready(function() {
           // Handler for .ready() called.
         });
             
        -

        Which is equivalent to calling:

        +

        Which is equivalent to the recommended way of calling:

        
         $(function() {
           // Handler for .ready() called.
         });
             
        -

        If .ready() is called after the DOM has been initialized, the new handler passed in will be executed immediately.

        -

        Aliasing the jQuery Namespace

        -

        When using another JavaScript library, we may wish to call $.noConflict() to avoid namespace difficulties. When this function is called, the $ shortcut is no longer available, forcing us to write jQuery each time we would normally write $. However, the handler passed to the .ready() method can take an argument, which is passed the global jQuery object. This means we can rename the object within the context of our .ready() handler without affecting other code:

        +

        Aliasing the jQuery Object

        +

        When $.noConflict() is used to avoid namespace conflicts, the $ shortcut is no longer available. However, the .ready() handler is passed a reference to the jQuery object that called the method. This allows the handler to use a jQuery object, for example as $, without knowing its aliased name:

        
        -jQuery( document ).ready(function( $ ) {
        -  // Code using $ as usual goes here.
        +jq2 = jQuery.noConflict();
        +jq2(function( $ ) {
        +  // Code using $ as usual goes here; the actual jQuery object is jq2
         });
             
        Display a message when the DOM is loaded. From fd4e6355c2839b024a98ff4e5650f8c5463406de Mon Sep 17 00:00:00 2001 From: Karl Swedberg Date: Sat, 6 Aug 2016 17:53:26 -0400 Subject: [PATCH 746/998] 1.12.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 961b2340..e5db9eed 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": "1.12.9", + "version": "1.12.10", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e55cf6302af7ee9fe849d062998ebda0510ad43f Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 8 Aug 2016 18:14:20 -0400 Subject: [PATCH 747/998] 1.12.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5db9eed..3a62a3fe 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": "1.12.10", + "version": "1.12.11", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9fef869ecd132c6f8bcfb92bf60a50251289f962 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Wed, 10 Aug 2016 17:18:45 -0400 Subject: [PATCH 748/998] Deprecate jQuery.fx.interval as of 3.0 Closes #969 --- entries/jQuery.fx.interval.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index cf67f484..5516d75c 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -1,12 +1,13 @@ - + jQuery.fx.interval The rate (in milliseconds) at which animations fire. 1.4.3 -

        This property can be manipulated to adjust the number of frames per second at which animations will run. The default is 13 milliseconds. Making this a lower number could make the animations run smoother in faster browsers (such as Chrome) but there may be performance and CPU implications of doing so.

        +

        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.

        @@ -34,4 +35,5 @@ $( "input" ).click(function() { +
        From 69cc61fa64fd1468264cda3c3393c3e20247a74b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 8 Aug 2016 16:52:21 -0400 Subject: [PATCH 749/998] Filter: Explain behavior on text and comment nodes Closes #968 --- entries/filter.xml | 1 + entries/not.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/entries/filter.xml b/entries/filter.xml index 831672aa..01489193 100644 --- a/entries/filter.xml +++ b/entries/filter.xml @@ -76,6 +76,7 @@ $( "li" ) .css( "background-color", "red" );

        This alteration to the code will cause the third and sixth list items to be highlighted, as it uses the modulus operator (%) to select every item with an index value that, when divided by 3, has a remainder of 2.

        +

        Note: When a CSS selector string is passed to .filter(), text and comment nodes will always be removed from the resulting jQuery object during the filtering process. When a specific node or array of nodes are provided, a text or comment node will be included in the resulting jQuery object only if it matches one of the nodes in the filtering array.

        diff --git a/entries/not.xml b/entries/not.xml index 059e5e29..a9a0880d 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -61,6 +61,7 @@ $( "li" ).not( document.getElementById( "notli" ) )

        This statement changes the color of items 1, 2, 4, and 5. We could have accomplished the same thing with a simpler jQuery expression, but this technique can be useful when, for example, other libraries provide references to plain DOM nodes.

        As of jQuery 1.4, the .not() method can take a function as its argument in the same way that .filter() does. Elements for which the function returns true are excluded from the filtered set; all other elements are included.

        +

        Note: When a CSS selector string is passed to .not(), text and comment nodes will always be removed from the resulting jQuery object during the filtering process. When a specific node or array of nodes are provided, text or comment nodes will only be removed from the jQuery object if they match one of the nodes in the filtering array.

        Adds a border to divs that are not green or blue. From 878331190459558435bb9a969c0eeb3e5f986bab Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 23 Aug 2016 17:30:15 -0400 Subject: [PATCH 750/998] 1.12.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a62a3fe..d306d940 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": "1.12.11", + "version": "1.12.12", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ae219e2795668f2bc5df5486b5102bbad11b1e6f Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 23 Aug 2016 17:49:51 -0400 Subject: [PATCH 751/998] 1.12.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d306d940..2fb714fc 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": "1.12.12", + "version": "1.12.13", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9fa469e1804241d753fe3bd7d72a640960448130 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Sun, 10 Jul 2016 12:26:58 +0100 Subject: [PATCH 752/998] bind, unbind, delegate, undelegate: Document the methods were deprecated in jQuery 3 Also, add the missing deprecated-3.0 category Fixes gh-945 --- categories.xml | 5 +++++ entries/bind.xml | 5 +++-- entries/delegate.xml | 5 +++-- entries/unbind.xml | 6 ++++-- entries/undelegate.xml | 6 ++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/categories.xml b/categories.xml index d4d31106..58563915 100644 --- a/categories.xml +++ b/categories.xml @@ -66,6 +66,11 @@

        For more information, see the Release Notes/Changelog at https://blog.jquery.com/2013/05/24/jquery-1-10-0-and-2-0-1-released/

        ]]> + + + diff --git a/entries/bind.xml b/entries/bind.xml index a81e46a8..05856faa 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -1,5 +1,5 @@ - + .bind() 1.0 @@ -34,7 +34,7 @@ Attach a handler to an event for the elements. -

        As of jQuery 1.7, the .on() method is the preferred method for attaching event handlers to a document. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

        +

        As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document since jQuery 1.7, so its use was already discouraged. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

        Any string is legal for eventType; if the string is not the name of a native DOM event, then the handler is bound to a custom event. These events are never called by the browser, but may be triggered manually from other JavaScript code using .trigger() or .triggerHandler().

        If the eventType string contains a period (.) character, then the event is namespaced. The period character separates the event from its namespace. For example, in the call .bind( "click.name", handler ), the string click is the event type, and the string name is the namespace. Namespacing allows us to unbind or trigger some events of a type without affecting others. See the discussion of .unbind() for more information.

        There are shorthand methods for some standard browser events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

        @@ -259,4 +259,5 @@ $( "div.test" ).bind({ +
        diff --git a/entries/delegate.xml b/entries/delegate.xml index e1670e84..10641ae6 100644 --- a/entries/delegate.xml +++ b/entries/delegate.xml @@ -1,5 +1,5 @@ - + .delegate() Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements. @@ -41,7 +41,7 @@ -

        As of jQuery 1.7, .delegate() has been superseded by the .on() method. For earlier versions, however, it remains the most effective means to use event delegation. More information on event binding and delegation is in the .on() method. In general, these are the equivalent templates for the two methods:

        +

        As of jQuery 3.0, .delegate() has been deprecated. It was superseded by the .on() method since jQuery 1.7, so its use was already discouraged. For earlier versions, however, it remains the most effective means to use event delegation. More information on event binding and delegation is in the .on() method. In general, these are the equivalent templates for the two methods:

        
         // jQuery 1.4.3+
         $( elements ).delegate( selector, events, data, handler );
        @@ -148,4 +148,5 @@ $( "button" ).click(function() {
           
           
           
        +  
         
        diff --git a/entries/unbind.xml b/entries/unbind.xml
        index e6be9a13..c53dd6af 100644
        --- a/entries/unbind.xml
        +++ b/entries/unbind.xml
        @@ -1,5 +1,5 @@
         
        -
        +
           .unbind()
           Remove a previously-attached event handler from the elements.
           
        @@ -31,7 +31,8 @@
             1.0
           
           
        -    

        Event handlers attached with .bind() can be removed with .unbind(). (As of jQuery 1.7, the .on() and .off() methods are preferred to attach and remove event handlers on elements.) In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements:

        +

        As of jQuery 3.0, .unbind() has been deprecated. It was superseded by the .off() method since jQuery 1.7, so its use was already discouraged.

        +

        Event handlers attached with .bind() can be removed with .unbind(). In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements:

        
         $( "#foo" ).unbind();
             
        @@ -155,4 +156,5 @@ $( "p" ).unbind( "click", foo ); // ... foo will no longer be called. +
        diff --git a/entries/undelegate.xml b/entries/undelegate.xml index 842a504a..f97e6b01 100644 --- a/entries/undelegate.xml +++ b/entries/undelegate.xml @@ -1,5 +1,5 @@ - + .undelegate() Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. @@ -43,7 +43,8 @@ -

        The .undelegate() method is a way of removing event handlers that have been bound using .delegate(). As of jQuery 1.7, the .on() and .off() methods are preferred for attaching and removing event handlers.

        +

        As of jQuery 3.0, .undelegate() has been deprecated. It was superseded by the .off() method since jQuery 1.7, so its use was already discouraged.

        +

        The .undelegate() method is a way of removing event handlers that have been bound using .delegate().

        Can bind and unbind events to the colored button. @@ -124,4 +125,5 @@ $( "form" ).undelegate( ".whatever" ); +
        From e1c7aaf16aa2931543137da729c2bcc3704ab70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 24 Aug 2016 13:50:49 +0200 Subject: [PATCH 753/998] bind: remove the link to .delegate() as it's deprecated as well Closes #948 --- entries/bind.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/bind.xml b/entries/bind.xml index 05856faa..150c645b 100644 --- a/entries/bind.xml +++ b/entries/bind.xml @@ -34,7 +34,7 @@ Attach a handler to an event for the elements. -

        As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document since jQuery 1.7, so its use was already discouraged. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on() or .delegate().

        +

        As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document since jQuery 1.7, so its use was already discouraged. For earlier versions, the .bind() method is used for attaching an event handler directly to elements. Handlers are attached to the currently selected elements in the jQuery object, so those elements must exist at the point the call to .bind() occurs. For more flexible event binding, see the discussion of event delegation in .on().

        Any string is legal for eventType; if the string is not the name of a native DOM event, then the handler is bound to a custom event. These events are never called by the browser, but may be triggered manually from other JavaScript code using .trigger() or .triggerHandler().

        If the eventType string contains a period (.) character, then the event is namespaced. The period character separates the event from its namespace. For example, in the call .bind( "click.name", handler ), the string click is the event type, and the string name is the namespace. Namespacing allows us to unbind or trigger some events of a type without affecting others. See the discussion of .unbind() for more information.

        There are shorthand methods for some standard browser events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

        From 43e0f008f963359acf72c24bea4d8d48dd3b610b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 24 Aug 2016 13:53:15 +0200 Subject: [PATCH 754/998] 1.12.14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2fb714fc..1abbf65c 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": "1.12.13", + "version": "1.12.14", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1c249b2cf2325376d64b75afa0365c37b68894d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=9A=E4=BA=BA=E7=A0=81=E5=A4=B4?= Date: Wed, 7 Sep 2016 11:38:54 +0800 Subject: [PATCH 755/998] toggleClass: Fixed a typo Closes gh-977 --- entries/toggleClass.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index 5a18aa05..dfe45f2d 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -137,7 +137,7 @@ $( "p" ).each(function() { float: left; width: 100px; margin: 1em 1em 0 0; - padding=left: 3px; + padding-left: 3px; border: 1px solid #abc; } div.a { From 36e13162cd54fe620ca9d92ba13dcc6c3de94af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 19 Oct 2016 14:32:30 +0200 Subject: [PATCH 756/998] deferred.catch: create the page Fixes #951 Closes #992 --- entries/deferred.catch.xml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 entries/deferred.catch.xml diff --git a/entries/deferred.catch.xml b/entries/deferred.catch.xml new file mode 100644 index 00000000..17df8dda --- /dev/null +++ b/entries/deferred.catch.xml @@ -0,0 +1,31 @@ + + + deferred.catch() + + 3.0 + + + A function that is called when the Deferred is rejected. + + + + Add handlers to be called when the Deferred object is rejected. + + +

        deferred.catch( fn ) is an alias to deferred.then( null, fn ). Read its page for more information.

        +
        + + Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. + + + + +
        From d16d569c48236676782d22d474838fca6bb3ad06 Mon Sep 17 00:00:00 2001 From: Chealer Date: Sat, 1 Oct 2016 11:35:22 -0400 Subject: [PATCH 757/998] val: Mention radio buttons in addition to selects and checkboxes Fixes #981 Closes #987 --- entries/val.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/val.xml b/entries/val.xml index b2aa7613..e7a82550 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -13,7 +13,7 @@

        The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

        When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

        -

        For selects and checkboxes, you can also use the :selected and :checked selectors to get at values. For example:

        +

        For selects, checkboxes and radio buttons, you can also use the :selected and :checked selectors to get at values. For example:

        
         
         // Get the value from a dropdown select
        
        From 8235e7b9ba4281f1562ba35eb2e1a92f15da97fe Mon Sep 17 00:00:00 2001
        From: Richard Gibson 
        Date: Sun, 25 Sep 2016 23:04:15 -0400
        Subject: [PATCH 758/998] Types: Document lack of support for wrapped
         primitives
        
        Fixes #985
        Closes #986
        ---
         pages/Types.html | 6 +++---
         1 file changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/pages/Types.html b/pages/Types.html
        index 2deff771..c56d995a 100644
        --- a/pages/Types.html
        +++ b/pages/Types.html
        @@ -9,7 +9,7 @@
         ol ul li { font-size: 1em !important; }
         ol ul { margin-left: 1.5em !important; }
         
        -

        JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and some concepts you need to know about Functions. If you want to study these concepts in depth, take a look at MDN. +

        This page documents data types appearing in jQuery function signatures, whether defined by JavaScript itself or further restricted by jQuery. Unless explicitly stated otherwise, jQuery functions require primitive values where applicable, and do not accept their Object-wrapped forms. If you want to study these concepts in depth, take a look at MDN.

        You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox).

        @@ -104,7 +104,7 @@

        Anything

        String

        -

        A string in JavaScript is an immutable object that contains none, one or many characters. +

        A string in JavaScript is an immutable primitive value that contains none, one or many characters.

        "I'm a String in JavaScript!"
         'So am I!'
        @@ -165,7 +165,7 @@ 

        htmlString

        $( "hellowaitbye" ).appendTo( "body" );

        Number

        -

        Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable, just as strings. All operators common in c-based languages are available to work with numbers (+, -, *, /, %, =, +=, -=, *=, /=, ++, --). +

        Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable primitive values, just like strings. All operators common in c-based languages are available to work with numbers (+, -, *, /, %, =, +=, -=, *=, /=, ++, --).

        12
         3.543
        
        From e40db5e2e3596e523265b75b97aaa0ca9fdcbb38 Mon Sep 17 00:00:00 2001
        From: Han Seoul-Oh 
        Date: Thu, 23 Jun 2016 16:14:12 -0700
        Subject: [PATCH 759/998] jQuery.post: Mark jqXHR.always() as added in 1.6
        
        While I'm there, fix missing ``
        ---
         entries/jQuery.post.xml | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml
        index 91382759..6152350a 100644
        --- a/entries/jQuery.post.xml
        +++ b/entries/jQuery.post.xml
        @@ -50,7 +50,7 @@ $.post( "ajax/test.html", function( data ) {
             

        This example fetches the requested HTML snippet and inserts it on the page.

        Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

        The jqXHR Object

        -

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        +

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

        
         // Assign handlers immediately after making the request,
        @@ -66,7 +66,7 @@ var jqxhr = $.post( "example.php", function() {
           })
           .always(function() {
             alert( "finished" );
        -});
        +  });
         
         // Perform other work here ...
         
        
        From 8b39fe73c6b915e09493117ea0a3975938d3d0f3 Mon Sep 17 00:00:00 2001
        From: Han Seoul-Oh 
        Date: Thu, 23 Jun 2016 16:18:01 -0700
        Subject: [PATCH 760/998] jQuery.get: Mark jqXHR.always() as added in 1.6
        
        ---
         entries/jQuery.get.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml
        index 87707e51..be1e25a2 100644
        --- a/entries/jQuery.get.xml
        +++ b/entries/jQuery.get.xml
        @@ -49,7 +49,7 @@ $.get( "ajax/test.html", function( data ) {
             

        This example fetches the requested HTML snippet and inserts it on the page.

        The jqXHR Object

        -

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        +

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

        
         // Assign handlers immediately after making the request,
        
        From dfbbb79cfec2a7fb880989434ba4fe050b3d3ef8 Mon Sep 17 00:00:00 2001
        From: Han Seoul-Oh 
        Date: Thu, 23 Jun 2016 16:20:34 -0700
        Subject: [PATCH 761/998] jQuery.ajax: Mark jqXHR.always() as added in 1.6
        
        ---
         entries/jQuery.ajax.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
        index d5e6a33c..c35582bc 100644
        --- a/entries/jQuery.ajax.xml
        +++ b/entries/jQuery.ajax.xml
        @@ -240,7 +240,7 @@ $.ajax({
                 

      • - jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown ) { }); + jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown ) { }); (added in jQuery 1.6)

        An alternative construct to the complete callback option, the .always() method replaces the deprecated .complete() method.

        In response to a successful request, the function's arguments are the same as those of .done(): data, textStatus, and the jqXHR object. For failed requests the arguments are the same as those of .fail(): the jqXHR object, textStatus, and errorThrown. Refer to deferred.always() for implementation details.

      • From 606a30eb27af95957a8f74e65e422b15c1ffa879 Mon Sep 17 00:00:00 2001 From: Han Seoul-Oh Date: Thu, 23 Jun 2016 16:24:12 -0700 Subject: [PATCH 762/998] jQuery.getJSON: Mark jqXHR.always() as added in 1.6 Closes #941 --- entries/jQuery.getJSON.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 7d5e08b6..c3b1e1e2 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -61,7 +61,7 @@ $.getJSON( "ajax/test.json", function( data ) {

        JSONP

        If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

        The jqXHR Object

        -

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        +

        As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

        The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.getJSON(), to chain multiple .done(), .always(), and .fail() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

        
         // Assign handlers immediately after making the request,
        
        From 9257b8006027b1550b206d1932caa64516cef11e Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= 
        Date: Wed, 26 Oct 2016 13:57:37 +0200
        Subject: [PATCH 763/998] 1.12.15
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index 1abbf65c..025e962d 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": "1.12.14",
        +  "version": "1.12.15",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From 9c1e80975ed30122feb6977470845c8042519d96 Mon Sep 17 00:00:00 2001
        From: Richard Gibson 
        Date: Sun, 13 Nov 2016 17:08:16 -0500
        Subject: [PATCH 764/998] Dimensions: normalize outerWidth and outerHeight
        
        ---
         entries/outerHeight.xml | 10 +++++-----
         entries/outerWidth.xml  |  8 ++++----
         2 files changed, 9 insertions(+), 9 deletions(-)
        
        diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml
        index ab497404..9f3a8fe5 100644
        --- a/entries/outerHeight.xml
        +++ b/entries/outerHeight.xml
        @@ -1,6 +1,6 @@
         
         
        -  Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.
        +  Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements or set the outer height of every matched element.
         
           .outerHeight()
           
        @@ -9,10 +9,10 @@
               A Boolean indicating whether to include the element's margin in the calculation.
             
           
        -  Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.
        +  Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements.
           
        -    

        The top and bottom padding and border are always included in the .outerHeight() calculation; if the includeMargin argument is set to true, the margin (top and bottom) is also included.

        -

        This method is not applicable to window and document objects; for these, use .height() instead.

        +

        Returns the height of the element, including top and bottom padding, border, and optionally margin, in pixels.

        +

        This method is not applicable to window and document objects; for these, use .height() instead. Although .outerHeight() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

        Figure 1 - Illustration of the measured height
        @@ -60,7 +60,7 @@ $( "p:last" ).text( A function returning the outer height to set. Receives the index position of the element in the set and the old outer height as arguments. Within the function, this refers to the current element in the set. - Set the CSS outer Height of each element in the set of matched elements. + Set the CSS outer height of each element in the set of matched elements.

        When calling .outerHeight(value), the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used (such as 100px, 50%, or auto).

        diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index 64687fb9..dcf7d23c 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -1,6 +1,6 @@ - Get the current computed width for the first element in the set of matched elements, including padding and border. + Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements or set the outer width of every matched element. .outerWidth() @@ -9,10 +9,9 @@ A Boolean indicating whether to include the element's margin in the calculation. - Get the current computed width for the first element in the set of matched elements, including padding and border. + Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements. -

        Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.

        -

        If includeMargin is omitted or false, the padding and border are included in the calculation; if true, the margin is also included.

        +

        Returns the width of the element, including left and right padding, border, and optionally margin, in pixels.

        This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

        @@ -45,6 +44,7 @@ $( "p:last" ).text( + 1.8.0 From 3aa71f277abc08eef73391d447b5dc1ae5354b7a Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Sun, 13 Nov 2016 17:21:31 -0500 Subject: [PATCH 765/998] Dimensions: Document empty-context getters Fixes gh-997 Closes gh-998 --- entries/innerHeight.xml | 2 +- entries/innerWidth.xml | 2 +- entries/outerHeight.xml | 2 +- entries/outerWidth.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/innerHeight.xml b/entries/innerHeight.xml index b8c5654e..bdc22f23 100644 --- a/entries/innerHeight.xml +++ b/entries/innerHeight.xml @@ -9,7 +9,7 @@ Get the current computed height for the first element in the set of matched elements, including padding but not border. -

        This method returns the height of the element, including top and bottom padding, in pixels.

        +

        This method returns the height of the element, including top and bottom padding, in pixels. If called on an empty set of elements, returns undefined (null before jQuery 3.0).

        This method is not applicable to window and document objects; for these, use .height() instead.

        diff --git a/entries/innerWidth.xml b/entries/innerWidth.xml index 6e9fd0d3..d3641b00 100644 --- a/entries/innerWidth.xml +++ b/entries/innerWidth.xml @@ -8,7 +8,7 @@ Get the current computed inner width for the first element in the set of matched elements, including padding but not border. -

        This method returns the width of the element, including left and right padding, in pixels.

        +

        This method returns the width of the element, including left and right padding, in pixels. If called on an empty set of elements, returns undefined (null before jQuery 3.0).

        This method is not applicable to window and document objects; for these, use .width() instead.

        diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml index 9f3a8fe5..c50dd23d 100644 --- a/entries/outerHeight.xml +++ b/entries/outerHeight.xml @@ -11,7 +11,7 @@ Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements. -

        Returns the height of the element, including top and bottom padding, border, and optionally margin, in pixels.

        +

        Returns the height of the element, including top and bottom padding, border, and optionally margin, in pixels. If called on an empty set of elements, returns undefined (null before jQuery 3.0).

        This method is not applicable to window and document objects; for these, use .height() instead. Although .outerHeight() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

        diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index dcf7d23c..bb37d571 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -11,7 +11,7 @@ Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements. -

        Returns the width of the element, including left and right padding, border, and optionally margin, in pixels.

        +

        Returns the width of the element, including left and right padding, border, and optionally margin, in pixels. If called on an empty set of elements, returns undefined (null before jQuery 3.0).

        This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

        From c2f3d41ce8168d2e8bd75c63a71ab39f80a6b170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 16 Nov 2016 11:53:05 +0100 Subject: [PATCH 766/998] Categories: Use jquery14.com via Web Archive The domain currently contains a scam site; web archive has the original version. --- categories.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/categories.xml b/categories.xml index 58563915..2ccd959e 100644 --- a/categories.xml +++ b/categories.xml @@ -43,7 +43,7 @@ @@ -357,12 +357,12 @@ var files = event.originalEvent.dataTransfer.files; From 244b0b07fcb16f9eb935e9edb287fedc2cbf8874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 16 Nov 2016 11:53:57 +0100 Subject: [PATCH 767/998] 1.12.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 025e962d..d140d3da 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": "1.12.15", + "version": "1.12.16", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 44cc16c57e76a03696c8fa171000b33ddf07da55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 23 Nov 2016 12:46:26 +0100 Subject: [PATCH 768/998] jQuery.parseJSON: Move the deprecation note to the top, rephrase it The deprecation note has been moved to the top of the description as it's the most important information about the API. This is also how other pages for deprecated APIs are documented. Also, the message has been rephrased a little as JSON is a string, not an object. Ref #899 Closes #1000 --- entries/jQuery.parseJSON.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index d0965e41..054663df 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -14,6 +14,7 @@ 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.

        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).
        • @@ -26,7 +27,6 @@

          The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

          Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

          Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

          -

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

          Parse a JSON string. From 30fe58a4eaee6fccee91e16c4b54774ad7adeaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 30 Nov 2016 12:45:38 +0100 Subject: [PATCH 769/998] 1.12.17 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d140d3da..d5921cb5 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": "1.12.16", + "version": "1.12.17", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From f52d5e8d13b7b317ecf972a6562d6e443a42c569 Mon Sep 17 00:00:00 2001 From: ash Date: Mon, 5 Dec 2016 13:55:36 +0530 Subject: [PATCH 770/998] ajaxComplete(): Fixed a typo Closes gh-1002 --- entries/ajaxComplete.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/ajaxComplete.xml b/entries/ajaxComplete.xml index 33705e53..f96dc4cf 100644 --- a/entries/ajaxComplete.xml +++ b/entries/ajaxComplete.xml @@ -48,7 +48,7 @@ $( document ).ajaxComplete(function( event, xhr, settings ) { Show a message when an Ajax request completes. From 5d37c0aaa5a7aa942572a25e7e700525578d823c Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 26 Oct 2016 14:40:38 -0400 Subject: [PATCH 771/998] val: Remove use of nonstandard selectors Fixes gh-993 Closes gh-994 --- entries/val.xml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/entries/val.xml b/entries/val.xml index e7a82550..56ef9e34 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -13,20 +13,19 @@

          The .val() method is primarily used to get the values of form elements such as input, select and textarea. When called on an empty collection, it returns undefined.

          When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), .val() returns an array containing the value of each selected option. As of jQuery 3.0, if no options are selected, it returns an empty array; prior to jQuery 3.0, it returns null.

          -

          For selects, checkboxes and radio buttons, you can also use the :selected and :checked selectors to get at values. For example:

          +

          For selects, checkboxes and radio buttons, you can use :checked to select the right elements. For example:

          
          +// Get the value from the selected option in a dropdown
          +$( "select#foo option:checked" ).val();
           
          -// Get the value from a dropdown select
          -$( "select.foo option:selected").val();
          -
          -// Get the value from a dropdown select even easier
          -$( "select.foo" ).val();
          +// Get the value from a dropdown select directly
          +$( "select#foo" ).val();
           
           // Get the value from a checked checkbox
          -$( "input:checkbox:checked" ).val();
          +$( "input[type=checkbox][name=bar]:checked" ).val();
           
           // Get the value from a set of radio buttons
          -$( "input:radio[name=bar]:checked" ).val();
          +$( "input[type=radio][name=baz]:checked" ).val();
                 

          Note: At present, using .val() on <textarea> elements strips carriage return characters from the browser-reported value. When this value is sent to the server via XHR, however, carriage returns are preserved (or added by browsers which do not include them in the raw value). A workaround for this issue can be achieved using a valHook as follows:

          @@ -131,11 +130,11 @@ $( "input" )

          Setting values using this method (or using the native value property) does not cause the dispatch of the change event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call .trigger( "change" ) after setting the value.

          The .val() method allows setting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value:

          
          -$( "input:text.items" ).val(function( index, value ) {
          -  return value + " " + this.className;
          +$( "input[type=text].tags" ).val(function( index, value ) {
          +  return value.trim();
           });
                 
          -

          This example appends the string " items" to the text inputs' values.

          +

          This example removes leading and trailing whitespace from the values of text inputs with a "tags" class.

          Set the value of an input box. From 6b54ab52f52ee586cbc97b695211322d1c670551 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Mon, 19 Dec 2016 15:49:59 +0000 Subject: [PATCH 772/998] prop(): Fixed incorrect position of parenthesis Fixes gh-1003 Closes gh-1004 --- entries/prop.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/prop.xml b/entries/prop.xml index adccbc85..419c3cc2 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -86,7 +86,7 @@ $( "input" ).change(function() { $( "p" ).html( ".attr( \"checked\" ): " + $input.attr( "checked" ) + "
          " + ".prop( \"checked\" ): " + $input.prop( "checked" ) + "
          " + - ".is( \":checked\" ): " + $input.is( ":checked" ) ) + ""; + ".is( \":checked\" ): " + $input.is( ":checked" ) + "" ); }).change(); ]]> 1.0 - A string containing a JavaScript event type, such as click or submit. + A string containing one or more DOM event types, such as "click" or "submit," or custom event names. The function that is to be no longer executed. @@ -15,7 +15,7 @@ 1.4.3 - A string containing a JavaScript event type, such as click or submit. + A string containing one or more DOM event types, such as "click" or "submit," or custom event names. Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). From 9729a4b3212f48df715069cfe453aec5e352a55e Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 20 Dec 2016 16:35:29 +0000 Subject: [PATCH 774/998] Types: Added Error Fixes gh-958 Closes gh-1012 --- pages/Types.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pages/Types.html b/pages/Types.html index c56d995a..47f5ea74 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -85,6 +85,7 @@
        • Proxy Pattern
        +
      • Error
      • Selector
      • Event
      • Element
      • @@ -566,8 +567,16 @@

        Callback

        Instead of always returning false, the callback could check fields of the form for validity, and return false only when the form is invalid.

        -


        +

        Error

        +

        An instance of an Error object is thrown as an exception when a runtime error occurs. Error can also be used as base to define user custom exception classes. In JavaScript an error can be thrown as shown below: +

        +
        throw new Error( "The argument provided is incorrect" );
        +
        +

        An error can also be thrown by the engine under some circumstances. For example, when trying to access a property of null:

        +
        var obj = null;
        +console.log( obj.foo() );
        +

        Selector

        A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax.

        From 431ccdb463d647a502d91f002838af8fd6b807e2 Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Tue, 20 Dec 2016 22:18:40 -0600 Subject: [PATCH 775/998] 1.12.18 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d5921cb5..4ba9e9b4 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": "1.12.17", + "version": "1.12.18", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 13c6d7a41ee6d0378cd1e501d619f9e95a7128ba Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Tue, 20 Dec 2016 22:59:45 -0600 Subject: [PATCH 776/998] 1.12.19 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ba9e9b4..3fb09190 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": "1.12.18", + "version": "1.12.19", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9af27d66abf585dd6802ba12f9ddba1038b1227d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 27 Dec 2016 20:59:27 -0600 Subject: [PATCH 777/998] one(): Add named parameter to example Fixes #1008 Closes #1016 --- entries/one.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/one.xml b/entries/one.xml index 588f1d55..8d37f3f8 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -60,7 +60,7 @@ $( "#foo" ).on( "click", function( event ) {

        In other words, explicitly calling .off() from within a regularly-bound handler has exactly the same effect.

        If the first argument contains more than one space-separated event types, the event handler is called once for each event type.

        
        -$( "#foo" ).one( "click mouseover", function() {
        +$( "#foo" ).one( "click mouseover", function( event ) {
           alert( "The " + event.type + " event happened!" );
         });
             
        From 53ffa06085f4cd8c729e6fdb494bf6579e332ace Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 20 Dec 2016 15:45:23 +0000 Subject: [PATCH 778/998] find(): Mention support for selectors starting with > Fixes gh-973 Closes gh-1011 --- entries/find.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/find.xml b/entries/find.xml index 0a080a05..c6a32e84 100644 --- a/entries/find.xml +++ b/entries/find.xml @@ -18,7 +18,7 @@ Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.

        Given a jQuery object that represents a set of DOM elements, the .find() method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .find() and .children() methods are similar, except that the latter only travels a single level down the DOM tree.

        -

        The first signature for the .find()method accepts a selector expression of the same type that we can pass to the $() function. The elements will be filtered by testing whether they match this selector.

        +

        The first signature for the .find()method accepts a selector expression of the same type that we can pass to the $() function. The elements will be filtered by testing whether they match this selector. The expressions allowed include selectors like > p which will find all the paragraphs that are children of the elements in the jQuery object.

        Consider a page with a basic nested list on it:

        
         <ul class="level-1">
        
        From 6a2c8cd629feb3ba82a9ace9b2ef72de0455e818 Mon Sep 17 00:00:00 2001
        From: Aurelio De Rosa 
        Date: Mon, 16 Jan 2017 22:04:29 +0000
        Subject: [PATCH 779/998] 1.12.20
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index 3fb09190..ccd3be22 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": "1.12.19",
        +  "version": "1.12.20",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From ab9fcb05f3981bbc11b15beb5912e2289a94319f Mon Sep 17 00:00:00 2001
        From: Aurelio De Rosa 
        Date: Mon, 19 Dec 2016 16:57:19 +0000
        Subject: [PATCH 780/998] ajax: Specified behavior for a timeout of 0
        
        Fixes gh-979
        Closes gh-1006
        ---
         entries/jQuery.ajax.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
        index c35582bc..93fd2759 100644
        --- a/entries/jQuery.ajax.xml
        +++ b/entries/jQuery.ajax.xml
        @@ -170,7 +170,7 @@ $.ajax({
                 A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
               
               
        -        Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
        +        Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
               
               
                 Set this to true if you wish to use the traditional style of param serialization.
        
        From 79a5c0c9f8e2ed423a7bf9af7486dd47749b6a34 Mon Sep 17 00:00:00 2001
        From: Mike Pennisi 
        Date: Sat, 21 Jan 2017 23:19:37 -0500
        Subject: [PATCH 781/998] serializeArray: Document Behavior for Value-less
         Input Elements
        
        Close gh-1018
        ---
         entries/serializeArray.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/serializeArray.xml b/entries/serializeArray.xml
        index bc46e920..4a836265 100644
        --- a/entries/serializeArray.xml
        +++ b/entries/serializeArray.xml
        @@ -28,7 +28,7 @@
           </div>
         </form>
             
        -

        The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized.

        +

        The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized. Elements that do not contain a value attribute are represented with the empty string value.

        This method can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> element itself for serialization:

        
         $( "form" ).submit(function( event ) {
        
        From 874113df6ef381f34b0d3e27ddfd87f2b1955e1e Mon Sep 17 00:00:00 2001
        From: Karl Swedberg 
        Date: Sat, 21 Jan 2017 23:20:25 -0500
        Subject: [PATCH 782/998] 1.12.21
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index ccd3be22..368efd68 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": "1.12.20",
        +  "version": "1.12.21",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From af3f23e7360ea8260bea002b70340dae107f1791 Mon Sep 17 00:00:00 2001
        From: Aurelio De Rosa 
        Date: Tue, 20 Dec 2016 15:24:23 +0000
        Subject: [PATCH 783/998] load(): Specified that load event alias is removed
        
        Fixes #976
        Closes #1010
        ---
         entries/load.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/load.xml b/entries/load.xml
        index 951c43f6..3444cb90 100644
        --- a/entries/load.xml
        +++ b/entries/load.xml
        @@ -21,7 +21,7 @@
           Load data from the server and place the returned HTML into the matched element.
           
             
        -

        Note: The event handling suite also has a method named .load(). jQuery determines which method to fire based on the set of arguments passed to it.

        +

        Note: Prior to jQuery 3.0, the event handling suite also had a method named .load(). Older versions of jQuery determined which method to fire based on the set of arguments passed to it.

        This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

        
        
        From eceefcf142534cb51ae443157a4752c9357f3ebd Mon Sep 17 00:00:00 2001
        From: denis 
        Date: Mon, 20 Feb 2017 17:54:40 +0100
        Subject: [PATCH 784/998] jQuery.type: Add results for symbols (bare & boxed)
        
        Closes #1025
        ---
         entries/jQuery.type.xml | 2 ++
         1 file changed, 2 insertions(+)
        
        diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml
        index f77b3139..26dbe913 100644
        --- a/entries/jQuery.type.xml
        +++ b/entries/jQuery.type.xml
        @@ -32,6 +32,8 @@
                   
      • jQuery.type( new Array() ) === "array"
      • jQuery.type( new Date() ) === "date"
      • jQuery.type( new Error() ) === "error" // as of jQuery 1.9
      • +
      • jQuery.type( Symbol() ) === "symbol" // as of jQuery 1.9
      • +
      • jQuery.type( Object(Symbol()) ) === "symbol" // as of jQuery 1.12
      • jQuery.type( /test/ ) === "regexp"
      • From de9998303049b92d5e2f7cba88009cb55709e4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 1 Mar 2017 10:49:55 +0100 Subject: [PATCH 785/998] 1.12.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 368efd68..574ad9d9 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": "1.12.21", + "version": "1.12.22", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b7ec850f7c515318d24f268ff080d71ccdf7d33f Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Sat, 21 Jan 2017 23:42:41 -0500 Subject: [PATCH 786/998] jQuery.ajax: Improve the jqXHR properties/methods documentation * Alphabetize properties and methods * Add missing methods and parameters * Clarify getAllResponseHeaders * Standardize formatting * Document getResponseHeader argument Fixes gh-1019 Closes gh-1020 --- entries/jQuery.ajax.xml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 93fd2759..393bc83c 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -280,25 +280,32 @@ jqxhr.always(function() {
      • readyState
      • +
      • + responseXML and/or responseText when the underlying request responded with xml and/or text, respectively +
      • status
      • statusText
      • -
      • responseXML and/or responseText when the underlying request responded with xml and/or text, respectively
      • -
      • setRequestHeader(name, value) which departs from the standard by replacing the old value with the new one rather than concatenating the new value to the old one
      • - getAllResponseHeaders() + abort( [ statusText ] ) +
      • +
      • + getAllResponseHeaders() as a string +
      • +
      • + getResponseHeader( name )
      • - getResponseHeader() + overrideMimeType( mimeType )
      • - statusCode() + setRequestHeader( name, value ) which departs from the standard by replacing the old value with the new one rather than concatenating the new value to the old one
      • - abort() + statusCode( callbacksByStatusCode )
      • No onreadystatechange mechanism is provided, however, since done, fail, always, and statusCode cover all conceivable requirements.

        From b2b9d8acd523fa2da2147be1a18204217c17b361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 8 Mar 2017 10:41:29 +0100 Subject: [PATCH 787/998] 1.12.23 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 574ad9d9..64b6253c 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": "1.12.22", + "version": "1.12.23", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3ab6720bdbeefa64d34bdb7d79bc03468788f49f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 20 Mar 2017 15:34:07 -0700 Subject: [PATCH 788/998] jQuery.when: Add Thenable and Promise as acceptable types Technically replacing Deferred with Thenable would work, but mentioning Deferred and Promise directly should make this easier to understand for new and existing users. Fixes #906 Closes #1026 --- entries/jQuery.when.xml | 9 ++++++--- pages/Types.html | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index 09c8393e..a27f2adc 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -3,11 +3,14 @@ jQuery.when() 1.5 - - Zero or more Deferred objects, or plain JavaScript objects. + + Zero or more Thenable objects. + + + - Provides a way to execute callback functions based on zero or more objects, usually Deferred objects that represent asynchronous events. + Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.

        If no arguments are passed to jQuery.when(), it will return a resolved Promise.

        If a single Deferred is passed to jQuery.when(), its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise-compatible object and can be used this way:

        diff --git a/pages/Types.html b/pages/Types.html index 47f5ea74..5eb5eceb 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -93,6 +93,7 @@
      • jQuery
      • XMLHttpRequest
      • jqXHR
      • +
      • Thenable
      • Deferred Object
      • Promise Object
      • Callbacks Object
      • @@ -657,6 +658,8 @@

        XMLHttpRequest

        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

        +

        Thenable

        +

        Any object that has a then method.

        Deferred Object

        As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate, and relay the success or failure state of any synchronous or asynchronous function.

        From 21c1fb1615c1de368ebf87dd418fa89395faf0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Mon, 20 Mar 2017 23:34:41 +0100 Subject: [PATCH 789/998] 1.12.24 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64b6253c..a43380ff 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": "1.12.23", + "version": "1.12.24", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 65f99f984f2ab60b2ccd64f4024a6c641fc9a8c4 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 22 Mar 2017 01:59:24 -0700 Subject: [PATCH 790/998] Selector: Move from global to instance property category Follows-up e3c9d15239, which added it to the wrong category. Closes #1030 --- entries/selector.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/selector.xml b/entries/selector.xml index e9e61c1e..d64fc0aa 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -9,7 +9,7 @@

        The .selector property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as $.fn.foo = function( selector, options ) { /* plugin code goes here */ };, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} ); with the "div.bar" selector repeated as the first argument of .foo().

        - + From 7f1299441cfe8afb1b829795abf7d16ecc0ae334 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 22 Mar 2017 02:02:01 -0700 Subject: [PATCH 791/998] jQuery.ready: create page Also categorise jQuery.holdReady in events/document-loading and properties/global-jquery-object-properties, to match jQuery.ready. Fixes #205 Closes #983 --- entries/jQuery.holdReady.xml | 2 ++ entries/jQuery.ready.xml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 entries/jQuery.ready.xml diff --git a/entries/jQuery.holdReady.xml b/entries/jQuery.holdReady.xml index cb795f2f..016e951a 100644 --- a/entries/jQuery.holdReady.xml +++ b/entries/jQuery.holdReady.xml @@ -22,5 +22,7 @@ $.getScript( "myplugin.js", function() { ]]>
        + + diff --git a/entries/jQuery.ready.xml b/entries/jQuery.ready.xml new file mode 100644 index 00000000..cc1a98f1 --- /dev/null +++ b/entries/jQuery.ready.xml @@ -0,0 +1,36 @@ + + + jQuery.ready + A Promise-like object (or "thenable") that resolves when the document is ready. + + 1.8 + + +

        As of jQuery 3.0, use of this object is supported via jQuery.when or the native Promise.resolve(). Code should not make assumptions about whether this object is a jQuery.Deferred, native Promise, or some other type of promise object.

        +

        See also ready(), which makes use of this.

        +
        + + Listen for document ready using jQuery.when. + + + + Typical usage involving another promise, using jQuery.when. + + + + + + +
        From ca8f0526486bdfb9f746ce305563ded2a424465f Mon Sep 17 00:00:00 2001 From: Matt Flaschen Date: Wed, 22 Mar 2017 05:02:52 -0400 Subject: [PATCH 792/998] Add the warning about deep=false to the short description as well Closes #1031 --- entries/jQuery.extend.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index ee6fb4a7..42edb4ae 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -16,7 +16,7 @@ 1.1.4 - If true, the merge becomes recursive (aka. deep copy). + If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. The object to extend. It will receive the new properties. From 95dcca44d9e466b006d9884eb77f2881fc064954 Mon Sep 17 00:00:00 2001 From: eironman Date: Wed, 21 Dec 2016 16:50:00 +0100 Subject: [PATCH 793/998] show: fix incorrect information related to !important There was a contradiction between show() and css() documentation about !important behaviour. Closes #1015 --- entries/show.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/entries/show.xml b/entries/show.xml index fb150631..535b9c5d 100644 --- a/entries/show.xml +++ b/entries/show.xml @@ -32,10 +32,9 @@
        
         $( ".target" ).show();
             
        -

        The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling .css( "display", "block"), except that the display property is restored to whatever it was initially. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

        -

        Note: If using !important in your styles, such as - display: none !important, - it is necessary to override the style using .css( "display", "block !important") should you wish for .show() to function correctly.

        +

        The matched elements will be revealed immediately, with no animation. This is roughly equivalent to calling .css( "display", "block" ), except that the display property is restored to whatever it was initially. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

        +

        Note: If using !important in your styles, such as display: none !important, .show() will not override !important. + It is recommended to use different classes with .addClass(), .removeClass() or .toggleClass(). Another approach is using .attr( "style", "display: block !important;" ); be careful, though, as it overwrites the style attribute of the element.

        When a duration, a plain object, or a "complete" function is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        From 90321abaeb410b79dd734b0cc7fe1c927d4e8204 Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Wed, 22 Mar 2017 14:45:55 +0000 Subject: [PATCH 794/998] outerHeight: Specified type of passed arguments to callback Fixes gh-989 Closes gh-1009 --- entries/outerHeight.xml | 8 +++++++- entries/outerWidth.xml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml index c50dd23d..e1caaf55 100644 --- a/entries/outerHeight.xml +++ b/entries/outerHeight.xml @@ -56,7 +56,13 @@ $( "p:last" ).text(
        1.8.0 - + + + + + + + A function returning the outer height to set. Receives the index position of the element in the set and the old outer height as arguments. Within the function, this refers to the current element in the set. diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index bb37d571..4e613cc1 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -56,7 +56,13 @@ $( "p:last" ).text( 1.8.0 - + + + + + + + A function returning the outer width to set. Receives the index position of the element in the set and the old outer width as arguments. Within the function, this refers to the current element in the set. From 622c78ea4286bf8979f7fbded7a4c98ffa23c612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 22 Mar 2017 15:47:59 +0100 Subject: [PATCH 795/998] 1.12.25 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a43380ff..82f32942 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": "1.12.24", + "version": "1.12.25", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 06e4ce4d933c3456040669912e4b4164026a825c Mon Sep 17 00:00:00 2001 From: Jade Misenas Date: Wed, 22 Mar 2017 17:41:35 -0400 Subject: [PATCH 796/998] one: indicate where passed data will be available Closes #855 --- entries/one.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/one.xml b/entries/one.xml index 8d37f3f8..4b98e5f9 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -8,7 +8,7 @@ A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. - An object containing data that will be passed to the event handler. + Data to be passed to the handler in event.data when an event is triggered. A function to execute at the time the event is triggered. From 28884e399182f81ab3894b81eb0d95e15acfd0c1 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 25 Apr 2017 15:43:57 -0400 Subject: [PATCH 797/998] Offset: Be more precise about the origins for .offset() and .position() Ref https://github.com/jquery/jquery/pull/3487 Closes gh-1027 --- entries/offset.xml | 6 +++--- entries/position.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/entries/offset.xml b/entries/offset.xml index e626ac5a..9a588ca2 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -8,10 +8,10 @@ Get the current coordinates of the first element in the set of matched elements, relative to the document. -

        The .offset() method allows us to retrieve the current position of an element 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.

        +

        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 borders, margins, or padding set on the body 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.

        @@ -96,7 +96,7 @@ $( "*", document.body ).click(function( event ) { Set the current coordinates of every element in the set of matched elements, relative to the document. -

        The .offset() setter method allows us to reposition an element. The element's position is specified relative to the document. If the element's position style property is currently static, it will be set to relative to allow for this repositioning.

        +

        The .offset() setter method allows us to reposition an element. The element's border-box position is specified relative to the document. If the element's position style property is currently static, it will be set to relative to allow for this repositioning.

        Set the offset of the second paragraph: diff --git a/entries/position.xml b/entries/position.xml index 41bd0fb7..3eed46b4 100644 --- a/entries/position.xml +++ b/entries/position.xml @@ -6,10 +6,10 @@ Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. -

        The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful.

        +

        The .position() method allows us to retrieve the current position of an element (specifically its margin box) relative to the offset parent (specifically its padding box, which excludes margins and borders). Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful.

        Returns an object containing the properties top and left.

        -

        Note: jQuery does not support getting the position coordinates of hidden elements or accounting for borders, margins, or padding set on the body element.

        +

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

        From c905b5169f4f9b2ade1172edb418a6c7ca738e00 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 25 Apr 2017 15:44:41 -0400 Subject: [PATCH 798/998] 1.12.26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 82f32942..ab9ac01c 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": "1.12.25", + "version": "1.12.26", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From c021b3efd9b8332aca6eaa8a65119dccd77e78eb Mon Sep 17 00:00:00 2001 From: Jack Alma Date: Wed, 26 Jul 2017 02:58:05 -0600 Subject: [PATCH 799/998] mousedown: Fix a misplaced space Closes #1051 --- entries/mousedown.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/mousedown.xml b/entries/mousedown.xml index dc1626fd..ea8d9a0e 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -54,7 +54,7 @@ $( "#other" ).click(function() { });

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

        -

        The mousedown event is sent when any mouse button is clicked. To act only on specific buttons, we can use the event object's which property. Not all browsers support this property (Internet Explorer uses button instead), but jQuery normalizes the property so that it is safe to use in any browser. The value of which will be 1 for the left button, 2 for the middle button, or 3 for the right button.

        +

        The mousedown event is sent when any mouse button is clicked. To act only on specific buttons, we can use the event object's which property. Not all browsers support this property (Internet Explorer uses button instead), but jQuery normalizes the property so that it is safe to use in any browser. The value of which will be 1 for the left button, 2 for the middle button, or 3 for the right button.

        This event is primarily useful for ensuring that the primary button was used to begin a drag operation; if ignored, strange results can occur when the user attempts to use a context menu. While the middle and right buttons can be detected with these properties, this is not reliable. In Opera and Safari, for example, right mouse button clicks are not detectable by default.

        If the user clicks on an element, drags away from it, and releases the button, this is still counted as a mousedown event. This sequence of actions is treated as a "canceling" of the button press in most user interfaces, so it is usually better to use the click event unless we know that the mousedown event is preferable for a particular situation.

        From 8dabbaf7d382718827b10eedb61a7345d02a020c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 26 Jul 2017 11:18:51 +0200 Subject: [PATCH 800/998] Build: Add a package-lock.json --- package-lock.json | 666 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 666 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..2eaf2817 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,666 @@ +{ + "name": "api.jquery.com", + "version": "1.12.26", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=" + }, + "argparse": { + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=", + "requires": { + "underscore": "1.7.0", + "underscore.string": "2.4.0" + }, + "dependencies": { + "underscore.string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs=" + } + } + }, + "async": { + "version": "0.1.22", + "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz", + "integrity": "sha1-D8GqoIig4+8Ovi2IMbqw3PiEUGE=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "cheerio": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.17.0.tgz", + "integrity": "sha1-+lrkLMYBIRM9KW0LRtmDIV9yaOo=", + "requires": { + "CSSselect": "0.4.1", + "dom-serializer": "0.0.1", + "entities": "1.1.1", + "htmlparser2": "3.7.3", + "lodash": "2.4.2" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + } + } + }, + "coffee-script": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz", + "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ=" + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "CSSselect": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/CSSselect/-/CSSselect-0.4.1.tgz", + "integrity": "sha1-+Kt+H4QYzmPNput713ioXX7EkrI=", + "requires": { + "CSSwhat": "0.4.7", + "domutils": "1.4.3" + } + }, + "CSSwhat": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/CSSwhat/-/CSSwhat-0.4.7.tgz", + "integrity": "sha1-hn2g/zn3eGEyQsRM/qg/CqTr35s=" + }, + "dateformat": { + "version": "1.0.2-1.2.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz", + "integrity": "sha1-sCIMAt6YYXQztyhRz0fePfLNvuk=" + }, + "dom-serializer": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.0.1.tgz", + "integrity": "sha1-lYmCfx4y0iw3yCmtq9WbMkevjq8=", + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" + }, + "domhandler": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.1.tgz", + "integrity": "sha1-Wd+dzSJ+gIs2Wuc+H2aErD2Ub8I=", + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", + "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", + "requires": { + "domelementtype": "1.3.0" + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + }, + "esprima": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz", + "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=" + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=" + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, + "findup-sync": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz", + "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=", + "requires": { + "glob": "3.2.11", + "lodash": "2.4.2" + }, + "dependencies": { + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "requires": { + "inherits": "2.0.3", + "minimatch": "0.3.0" + } + }, + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=" + }, + "gilded-wordpress": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.3.tgz", + "integrity": "sha1-kh/iJ93yWyxAgp5QUjsOMXRDsz4=", + "requires": { + "async": "0.9.2", + "glob": "4.0.6", + "wordpress": "1.1.2" + }, + "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" + }, + "glob": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", + "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=", + "requires": { + "graceful-fs": "3.0.11", + "inherits": "2.0.3", + "minimatch": "1.0.0", + "once": "1.4.0" + } + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "requires": { + "natives": "1.1.0" + } + }, + "minimatch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" + } + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" + }, + "grunt": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz", + "integrity": "sha1-VpN81RlDJK3/bSB2MYMqnWuk5/A=", + "requires": { + "async": "0.1.22", + "coffee-script": "1.3.3", + "colors": "0.6.2", + "dateformat": "1.0.2-1.2.3", + "eventemitter2": "0.4.14", + "exit": "0.1.2", + "findup-sync": "0.1.3", + "getobject": "0.1.0", + "glob": "3.1.21", + "grunt-legacy-log": "0.1.3", + "grunt-legacy-util": "0.2.0", + "hooker": "0.2.3", + "iconv-lite": "0.2.11", + "js-yaml": "2.0.5", + "lodash": "0.9.2", + "minimatch": "0.2.14", + "nopt": "1.0.10", + "rimraf": "2.2.8", + "underscore.string": "2.2.1", + "which": "1.0.9" + } + }, + "grunt-check-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.0.0.tgz", + "integrity": "sha1-Y/9erkYTF5tKifaozTcfekAfd4I=" + }, + "grunt-cli": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.1.0.tgz", + "integrity": "sha1-r9eWmTTd8zYg6ER+3B+pTlHlWjQ=", + "requires": { + "findup-sync": "0.3.0", + "nopt": "3.0.6", + "resolve": "1.1.7" + }, + "dependencies": { + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "requires": { + "glob": "5.0.15" + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "requires": { + "abbrev": "1.1.0" + } + } + } + }, + "grunt-jquery-content": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.0.1.tgz", + "integrity": "sha1-aHdrx0G1SVEdaPBouVCsizd+g90=", + "requires": { + "async": "0.9.0", + "cheerio": "0.17.0", + "grunt-check-modules": "1.0.0", + "grunt-wordpress": "2.1.2", + "he": "0.5.0", + "highlight.js": "7.3.0", + "marked": "0.3.2", + "rimraf": "2.2.8", + "spawnback": "1.0.0", + "which": "1.0.5", + "wordpress": "1.1.2" + }, + "dependencies": { + "async": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", + "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=" + }, + "which": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", + "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk=" + } + } + }, + "grunt-legacy-log": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz", + "integrity": "sha1-7ClCboAwIa9ZAp+H0vnNczWgVTE=", + "requires": { + "colors": "0.6.2", + "grunt-legacy-log-utils": "0.1.1", + "hooker": "0.2.3", + "lodash": "2.4.2", + "underscore.string": "2.3.3" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + }, + "underscore.string": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" + } + } + }, + "grunt-legacy-log-utils": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz", + "integrity": "sha1-wHBrndkGThFvNvI/5OawSGcsD34=", + "requires": { + "colors": "0.6.2", + "lodash": "2.4.2", + "underscore.string": "2.3.3" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" + }, + "underscore.string": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=" + } + } + }, + "grunt-legacy-util": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz", + "integrity": "sha1-kzJIhNv343qf98Am3/RR2UqeVUs=", + "requires": { + "async": "0.1.22", + "exit": "0.1.2", + "getobject": "0.1.0", + "hooker": "0.2.3", + "lodash": "0.9.2", + "underscore.string": "2.2.1", + "which": "1.0.9" + } + }, + "grunt-wordpress": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/grunt-wordpress/-/grunt-wordpress-2.1.2.tgz", + "integrity": "sha1-ue3Lv5jp6HM9F6gsMmWf2zbO2LE=", + "requires": { + "gilded-wordpress": "1.0.3" + } + }, + "he": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", + "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=" + }, + "highlight.js": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.3.0.tgz", + "integrity": "sha1-bF8PZOcHj2ZAK82/yJEQw/0bqZ8=" + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" + }, + "htmlparser2": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz", + "integrity": "sha1-amTHdjfAjG8w7CqBV6UzM758sF4=", + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.2.1", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "requires": { + "dom-serializer": "0.0.1", + "domelementtype": "1.3.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" + } + } + }, + "iconv-lite": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz", + "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "js-yaml": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz", + "integrity": "sha1-olrmUJmZ6X3yeMZxnaEb0Gh3Q6g=", + "requires": { + "argparse": "0.1.16", + "esprima": "1.0.4" + } + }, + "lodash": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz", + "integrity": "sha1-jzSZxSRdNG1oLlsNO0B2fgnxqSw=" + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, + "marked": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", + "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + }, + "natives": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", + "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=" + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "requires": { + "abbrev": "1.1.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" + }, + "sax": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", + "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=" + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, + "spawnback": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", + "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "underscore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" + }, + "underscore.string": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz", + "integrity": "sha1-18D6KvXVoaZ/QlPa7pgTLnM/Dxk=" + }, + "which": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", + "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=" + }, + "wordpress": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.1.2.tgz", + "integrity": "sha1-uDZhhSBVSXESG8VsQ7A5yzgg94M=", + "requires": { + "xmlrpc": "1.3.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xmlbuilder": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-2.6.5.tgz", + "integrity": "sha1-b/etYPty0idk8AehZLd/K/FABSY=", + "requires": { + "lodash": "3.10.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + } + } + }, + "xmlrpc": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.1.tgz", + "integrity": "sha1-OqWCCG/vUwz+Hc2qDEyd3F0ORFE=", + "requires": { + "sax": "0.6.1", + "xmlbuilder": "2.6.5" + } + } + } +} From e0a236becabfd660f656ef74d0abb16a38efe8cc Mon Sep 17 00:00:00 2001 From: Levi Robertson Date: Wed, 26 Jul 2017 02:31:09 -0700 Subject: [PATCH 801/998] closest: Correct spelling of "highlight" Closes #1045 --- entries/closest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/closest.xml b/entries/closest.xml index 14c10a80..903ba1a7 100644 --- a/entries/closest.xml +++ b/entries/closest.xml @@ -109,7 +109,7 @@ $( "li.item-a" ) Show how event delegation can be done with closest. The closest list element toggles a yellow background when it or its descendent is clicked. @@ -134,7 +134,7 @@ $( document ).on( "click", function( event ) { From 39e4bf4dcf4060eec4e4a12739d50713c6c7b16a Mon Sep 17 00:00:00 2001 From: Dasheng Jonathan Zhang Date: Wed, 26 Jul 2017 05:32:58 -0400 Subject: [PATCH 802/998] stop: fix misplaced default value Closes #1037 --- entries/stop.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/stop.xml b/entries/stop.xml index b66c0bcc..c0f17348 100644 --- a/entries/stop.xml +++ b/entries/stop.xml @@ -13,10 +13,10 @@ 1.7 - + The name of the queue in which to stop animations. - + A Boolean indicating whether to remove queued animation as well. Defaults to false. From 5b7121ab1a7d2a1805e702eca20da180e336528c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 26 Jul 2017 11:54:49 +0200 Subject: [PATCH 803/998] 1.12.27 --- 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 2eaf2817..d3c03011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.26", + "version": "1.12.27", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ab9ac01c..6a5ba757 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": "1.12.26", + "version": "1.12.27", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9b33cd476b8c94378a672cac9e4efde7c16d1eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 11 Oct 2017 10:59:26 +0200 Subject: [PATCH 804/998] Add my new name to .mailmap --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 175ab74f..7f902dbd 100644 --- a/.mailmap +++ b/.mailmap @@ -1 +1,2 @@ Matic Potočnik +Michał Gołębiowski-Owczarek From 0c56670f38fd4e28f1f217e7fbe7de92849e0df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Kov=C3=A1cs?= Date: Wed, 22 Nov 2017 04:00:12 +0000 Subject: [PATCH 805/998] callbacks.fireWith: Update text and add value type information Fixes gh-1066 Closes gh-1067 --- entries/callbacks.fireWith.xml | 6 +++--- entries/event.stopImmediatePropagation.xml | 2 +- entries/event.stopPropagation.xml | 2 +- entries/jQuery.ajaxSetup.xml | 2 +- entries/jQuery.globalEval.xml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/entries/callbacks.fireWith.xml b/entries/callbacks.fireWith.xml index dfb2adb3..7527e182 100644 --- a/entries/callbacks.fireWith.xml +++ b/entries/callbacks.fireWith.xml @@ -3,11 +3,11 @@ callbacks.fireWith() 1.7 - + A reference to the context in which the callbacks in the list should be fired. - - An argument, or array of arguments, to pass to the callbacks in the list. + + An array or array-like object of arguments to pass to the callbacks in the list. If omitted or undefined, no arguments will be passed. Call all callbacks in a list with the given context and arguments. diff --git a/entries/event.stopImmediatePropagation.xml b/entries/event.stopImmediatePropagation.xml index b067e43a..e5b53eba 100644 --- a/entries/event.stopImmediatePropagation.xml +++ b/entries/event.stopImmediatePropagation.xml @@ -1,5 +1,5 @@ - + event.stopImmediatePropagation() 1.3 diff --git a/entries/event.stopPropagation.xml b/entries/event.stopPropagation.xml index adf4ea10..8d34bd4d 100644 --- a/entries/event.stopPropagation.xml +++ b/entries/event.stopPropagation.xml @@ -1,5 +1,5 @@ - + event.stopPropagation() 1.0 diff --git a/entries/jQuery.ajaxSetup.xml b/entries/jQuery.ajaxSetup.xml index d9589e3a..d175c54a 100644 --- a/entries/jQuery.ajaxSetup.xml +++ b/entries/jQuery.ajaxSetup.xml @@ -1,5 +1,5 @@ - + jQuery.ajaxSetup() 1.1 diff --git a/entries/jQuery.globalEval.xml b/entries/jQuery.globalEval.xml index ce510fe3..ad6b7d1e 100644 --- a/entries/jQuery.globalEval.xml +++ b/entries/jQuery.globalEval.xml @@ -1,5 +1,5 @@ - + jQuery.globalEval() 1.0.4 From b82f48de332840e347d723d269f2943d4ccebda0 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 21 Nov 2017 23:01:41 -0500 Subject: [PATCH 806/998] 1.12.28 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a5ba757..d388b15a 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": "1.12.27", + "version": "1.12.28", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 576a64b8f5986bb6a447e6f98764a80a152e06fb Mon Sep 17 00:00:00 2001 From: Michael Welling Date: Mon, 11 Dec 2017 14:58:38 -0500 Subject: [PATCH 807/998] unwrap: Update description to include return value information The `.unwrap()` method returns whatever content was unwrapped. Adding this to the description so that the behavior is documented. Closes gh-1071 --- entries/unwrap.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/unwrap.xml b/entries/unwrap.xml index d3a7b405..ff6d6100 100644 --- a/entries/unwrap.xml +++ b/entries/unwrap.xml @@ -12,7 +12,7 @@ Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. -

        The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

        +

        The .unwrap() method removes the element's parent and returns the unwrapped content. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.

        Wrap/unwrap a div around each of the paragraphs. From e50c07016b42a76103927c2d5f8dba84c553861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 6 Dec 2017 19:40:51 +0100 Subject: [PATCH 808/998] jQuery.cssHooks: remove the "O" Opera prefix jQuery 3.0+ doesn't support Opera Presto (versions <=12.x) so including its prefix in the docs doesn't make much sense. Closes gh-1069 --- entries/jQuery.cssHooks.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml index f7ecb170..19bb9054 100644 --- a/entries/jQuery.cssHooks.xml +++ b/entries/jQuery.cssHooks.xml @@ -45,7 +45,7 @@ function styleSupport( prop ) { // Capitalize first character of the prop to test vendor prefix capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ), - prefixes = [ "Moz", "Webkit", "O", "ms" ], + prefixes = [ "Moz", "Webkit", "ms" ], div = document.createElement( "div" ); if ( prop in div.style ) { @@ -89,7 +89,7 @@ if ( !$.cssHooks ) { function styleSupport( prop ) { var vendorProp, supportedProp, capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ), - prefixes = [ "Moz", "Webkit", "O", "ms" ], + prefixes = [ "Moz", "Webkit", "ms" ], div = document.createElement( "div" ); if ( prop in div.style ) { From 7a6ba164ee16317b375d2bfb59b025b13cf273a1 Mon Sep 17 00:00:00 2001 From: Wolfgang Hochleitner Date: Tue, 13 Jun 2017 11:38:15 +0200 Subject: [PATCH 809/998] Types: Updated XMLHttpRequest standard link W3C's XMLHttpRequest standardization process has been discontinued. Documentation now refers to the WHATWG living standard. Closes gh-1046 Fixes gh-1043 --- pages/Types.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/Types.html b/pages/Types.html index 5eb5eceb..b31c47ee 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -645,9 +645,9 @@

        jQuery

        XMLHttpRequest

        Some of jQuery's Ajax functions return the native XMLHttpRequest (XHR) object, or pass it as an argument to success/error/complete handlers, so that you can do additional processing or monitoring on the request. Note that Ajax functions only return or pass an XHR object when an XHR object is actually used in the request. For example, JSONP requests and cross-domain GET requests use a script element rather than an XHR object.

        -

        Although the XHR object is a standard, there are variations in its behavior on different browsers. Refer to the W3C site and browsers' documentation for more information: +

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

        -
        • W3C standard +
          • WHATWG living standard
          • Apple (Safari)
          • Mozilla (Firefox)
          • Microsoft (Internet Explorer) From db4ca52993c19a3ab5ef7481252db88e2843f750 Mon Sep 17 00:00:00 2001 From: Herst Date: Mon, 6 Nov 2017 14:10:42 +0100 Subject: [PATCH 810/998] contextmenu: Menu button trigger not just on root Closes gh-1065 --- entries/contextmenu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/contextmenu.xml b/entries/contextmenu.xml index 0c846169..a3645ef7 100644 --- a/entries/contextmenu.xml +++ b/entries/contextmenu.xml @@ -24,7 +24,7 @@

            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. Any HTML element can receive this event. + 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">
            
            From 5d32df8c1c8db2bdf023895155f7f9c58966f3ec Mon Sep 17 00:00:00 2001
            From: Richard Gibson 
            Date: Mon, 29 Jan 2018 22:12:31 -0500
            Subject: [PATCH 811/998] jQuery.isFunction: Resolve ambiguity about what is
             being tested
            
            Closes gh-1079
            Fixes gh-1034
            ---
             entries/jQuery.isFunction.xml | 6 +++---
             1 file changed, 3 insertions(+), 3 deletions(-)
            
            diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml
            index 689cdbf7..349061ef 100644
            --- a/entries/jQuery.isFunction.xml
            +++ b/entries/jQuery.isFunction.xml
            @@ -3,11 +3,11 @@
               jQuery.isFunction()
               
                 1.2
            -    
            -      Object to test whether or not it is a function.
            +    
            +      The value to be tested.
                 
               
            -  Determine if the argument passed is a JavaScript function object. 
            +  Determines if its argument is callable as a function.
               
                 

            Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

            From 82322be998f07ee7e95f9c691dfa00d0591526bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 7 Feb 2018 09:29:17 +0100 Subject: [PATCH 812/998] Build: Update Node from 0.12 to 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 86929762..3396aa4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - "0.12" + - "8" before_script: - npm install -g grunt-cli From c5ad660a194ad5efda8ffb81f0a6e17b23971712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 7 Feb 2018 09:38:25 +0100 Subject: [PATCH 813/998] Build: Don't install grunt-cli manually in Travis It's not needed as npm scripts have node_modules/.bin prepended to PATH. It's also better to have all versions as locked up as possible to prevent build instability. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3396aa4c..efb09833 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ language: node_js node_js: - "8" -before_script: - - npm install -g grunt-cli From 077f1bec6a1a9ff73cd364bdb1f75d5c09650a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 7 Feb 2018 09:40:00 +0100 Subject: [PATCH 814/998] Build: Install the libxml2-utils package on Travis, it's needed for xmllint Closes #1080 --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index efb09833..8b645e42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ language: node_js node_js: - "8" +addons: + apt: + packages: + - libxml2-utils From ba6e6a47dff7a83358d123ef4b57c416dc7f0b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 8 Feb 2018 22:17:55 +0100 Subject: [PATCH 815/998] 1.12.29 --- 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 d3c03011..3fb8caf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.27", + "version": "1.12.29", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d388b15a..fcf103c2 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": "1.12.28", + "version": "1.12.29", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From ca12161164e2c2bc996f405ec80c74360d90b72f Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 30 Jan 2018 02:22:56 +0000 Subject: [PATCH 816/998] Added note about the deprecation of jQuery.isFunction in version 3.3 Closes gh-1077 Fixes gh-1074 --- categories.xml | 5 +++++ entries/jQuery.isFunction.xml | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index 2ccd959e..4af831f8 100644 --- a/categories.xml +++ b/categories.xml @@ -70,6 +70,11 @@ + + + diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml index 349061ef..7aed5574 100644 --- a/entries/jQuery.isFunction.xml +++ b/entries/jQuery.isFunction.xml @@ -1,5 +1,5 @@ - + jQuery.isFunction() 1.2 @@ -9,6 +9,7 @@ Determines if its argument is callable as a function. +

            As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".

            Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

            @@ -57,4 +58,5 @@ true +
            From 9d03b3717a9e8d4b8a832866f8f8a7049e2f1cbb Mon Sep 17 00:00:00 2001 From: Aurelio De Rosa Date: Tue, 30 Jan 2018 02:49:12 +0000 Subject: [PATCH 817/998] Specified that jQuery.each accepts array-like objects Closes gh-1078 Fixes gh-1032 Ref gh-473 --- entries/jQuery.each.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index 67fe70cc..18836015 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -3,13 +3,13 @@ jQuery.each() 1.0 - - The array to iterate over. + + The array or array-like object to iterate over. - The function that will be executed on every object. + The function that will be executed on every value. @@ -20,13 +20,12 @@ - The function that will be executed on every object. + The function that will be executed on every value. A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

            The $.each() function is not the same as $(selector).each(), which is used to iterate, exclusively, over a jQuery object. The $.each() function can be used to iterate over any collection, whether it is an object or an array. In the case of an array, the callback is passed an array index and a corresponding array value each time. (The value can also be accessed through the this keyword, but Javascript will always wrap the this value as an Object even if it is a simple string or number value.) The method returns its first argument, the object that was iterated.

            -

            Note: The $.each() function internally retrieves and uses the length property of the passed collection. So, if the collection has a property called length — e.g. {bar: 'foo', length: 10} — the function might not work as expected.

            
             $.each([ 52, 97 ], function( index, value ) {
               alert( index + ": " + value );
            
            From 530dbceef1e332803a442486b1905915c324c98c Mon Sep 17 00:00:00 2001
            From: pinguin999 
            Date: Tue, 19 Dec 2017 14:20:03 +0100
            Subject: [PATCH 818/998] getJSON: Fix Example by using https
            
            Closes gh-1072
            
            Error was:
            
            Mixed Content: The page at 'https://api.jquery.com/jquery.getjson/' was loaded over HTTPS, but requested an insecure script 'http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=jQuery110203890736409927371_1513688901634&tags=mount+rainier&tagmode=any&format=json&_=1513688901635'. This request has been blocked; the content must be served over HTTPS.
            ---
             entries/jQuery.getJSON.xml | 2 +-
             1 file changed, 1 insertion(+), 1 deletion(-)
            
            diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
            index c3b1e1e2..b8a5ee49 100644
            --- a/entries/jQuery.getJSON.xml
            +++ b/entries/jQuery.getJSON.xml
            @@ -95,7 +95,7 @@ jqxhr.complete(function() {
                 Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API.
                 
            -
            +
               jQuery.isWindow()
               
                 1.4.3
            @@ -22,4 +22,5 @@ Is 'window' a window? 
               
               
               
            +  
             
            
            From 05caac8968b98aa45d066a382d45d4ce0510bae5 Mon Sep 17 00:00:00 2001
            From: Daniil Zhilin 
            Date: Mon, 26 Mar 2018 19:43:40 +0300
            Subject: [PATCH 820/998] jQuery.ajax: Change DataType to dataType
            
            Closes #1088
            ---
             entries/jQuery.ajax.xml | 2 +-
             1 file changed, 1 insertion(+), 1 deletion(-)
            
            diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml
            index 393bc83c..fa77edcd 100644
            --- a/entries/jQuery.ajax.xml
            +++ b/entries/jQuery.ajax.xml
            @@ -15,7 +15,7 @@
                 1.0
                 
                   A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
            -      
            +      
                     A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept request header. This header tells the server what kind of response it will accept in return. For example, the following defines a custom type mycustomtype to be sent with the request:
                       
            
             $.ajax({
            
            From 82380a70f10728b4274afe387b742b24f97a9dfa Mon Sep 17 00:00:00 2001
            From: Brahim Arkni 
            Date: Mon, 26 Mar 2018 17:44:56 +0100
            Subject: [PATCH 821/998] data: Replace URL markdown syntax with HTML
            
            Ref #943
            Closes #1087
            ---
             entries/data.xml | 2 +-
             1 file changed, 1 insertion(+), 1 deletion(-)
            
            diff --git a/entries/data.xml b/entries/data.xml
            index 3606395d..66ed7253 100644
            --- a/entries/data.xml
            +++ b/entries/data.xml
            @@ -89,7 +89,7 @@ alert( $( "body" ).data( "foo" ) ); // undefined
             $( "body" ).data( "bar", "foobar" );
             alert( $( "body" ).data( "bar" ) ); // foobar
                   
            -

            jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of [the algorithm of the Dataset API](http://www.w3.org/TR/html5/dom.html#dom-dataset). Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

            +

            jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

            HTML5 data-* Attributes

            From 0998d12d4e12ec6b89028aeb89661187421384a4 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Mon, 26 Mar 2018 12:48:56 -0400 Subject: [PATCH 822/998] jQuery.ajax: Adjust note about cross-domain ajax request with 'JSON' datatype Fixes #959 Closes #1021 --- entries/jQuery.ajax.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index fa77edcd..8d92e0f8 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -98,7 +98,7 @@ $.ajax({
          • "xml": Returns a XML document that can be processed via jQuery.
          • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
          • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
          • -
          • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
          • +
          • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests that have a callback placeholder, e.g. ?callback=?, are performed using JSONP unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
          • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
          • "text": A plain text string.
          • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
          • From 8e67f74e434adf26ab72903caae040fd85baf749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 26 Mar 2018 19:10:30 +0200 Subject: [PATCH 823/998] Misc: Change HTTP links to HTTPS where possible Closes #1089 --- CONTRIBUTING.md | 6 +++--- LICENSE.txt | 4 ++-- README.md | 6 +++--- categories.xml | 6 +++--- entries/animate.xml | 6 +++--- entries/attr.xml | 2 +- entries/contents.xml | 2 +- entries/data.xml | 8 ++++---- entries/empty-selector.xml | 2 +- entries/event.isImmediatePropagationStopped.xml | 2 +- entries/event.isPropagationStopped.xml | 2 +- entries/event.metaKey.xml | 4 ++-- entries/event.preventDefault.xml | 2 +- entries/fadeIn.xml | 2 +- entries/fadeOut.xml | 2 +- entries/fadeToggle.xml | 2 +- entries/hidden-selector.xml | 2 +- entries/hide.xml | 2 +- entries/html.xml | 2 +- entries/id-selector.xml | 2 +- entries/jQuery.ajax.xml | 10 +++++----- entries/jQuery.ajaxPrefilter.xml | 4 ++-- entries/jQuery.boxModel.xml | 2 +- entries/jQuery.browser.xml | 2 +- entries/jQuery.extend.xml | 2 +- entries/jQuery.fx.interval.xml | 2 +- entries/jQuery.getJSON.xml | 2 +- entries/jQuery.parseJSON.xml | 2 +- entries/jQuery.support.xml | 2 +- entries/jQuery.xml | 4 ++-- entries/keypress.xml | 2 +- entries/lang-selector.xml | 2 +- entries/map.xml | 2 +- entries/nth-child-selector.xml | 2 +- entries/nth-last-child-selector.xml | 2 +- entries/nth-last-of-type-selector.xml | 2 +- entries/nth-of-type-selector.xml | 2 +- entries/on.xml | 4 ++-- entries/parent-selector.xml | 2 +- entries/prop.xml | 2 +- entries/ready.xml | 2 +- entries/serialize.xml | 2 +- entries/serializeArray.xml | 2 +- entries/show.xml | 2 +- entries/slideDown.xml | 2 +- entries/slideToggle.xml | 2 +- entries/slideUp.xml | 2 +- entries/target-selector.xml | 4 ++-- entries/toggle.xml | 2 +- entries/visible-selector.xml | 2 +- notes.xsl | 4 ++-- pages/Types.html | 11 +++-------- 52 files changed, 76 insertions(+), 81 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba9f6b8f..9a004cd3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ -Welcome! Thanks for your interest in contributing to api.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [documentation](http://contribute.jquery.org/documentation). +Welcome! Thanks for your interest in contributing to api.jquery.com. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](https://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [documentation](https://contribute.jquery.org/documentation). -You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). +You may also want to take a look at our [commit & pull request guide](https://contribute.jquery.org/commits-and-pull-requests/) and [style guides](https://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](https://contribute.jquery.org/cla). -You can find us on [IRC](http://irc.jquery.org), specifically in #jquery-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). +You can find us on [IRC](https://irc.jquery.org), specifically in #jquery-dev and #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](https://contribute.jquery.org/open-source/). diff --git a/LICENSE.txt b/LICENSE.txt index 19a9bad2..203b68a7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright Packt Publishing (http://packtpub.com/), +Copyright Packt Publishing (https://www.packtpub.com/), jQuery Foundation (https://jquery.org/), and other contributors. This software consists of voluntary contributions made by many @@ -35,7 +35,7 @@ Copyright and related rights for sample code are waived via CC0. Sample code is defined as all source code displayed within the prose of the documentation and all examples and demos. -CC0: http://creativecommons.org/publicdomain/zero/1.0/ +CC0: https://creativecommons.org/publicdomain/zero/1.0/ ==== diff --git a/README.md b/README.md index 805e0442..1141cd22 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ ## Building and Deploying -To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](http://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/). +To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](https://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/). ### Requirements * [libxml2](http://xmlsoft.org/) * [libxslt](http://xmlsoft.org/libxslt/) -The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com. +The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from zlatkovic.com. **Note**: If you're using Windows and you receive the error "Error" when executing the task `build-xml-entries:all`, try to add the DLL `libwinpthread-1.dll` in the root of the project. @@ -49,7 +49,7 @@ The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Wi ### Code Style -Code in the API documentation should follow the [jQuery Core Style Guide](http://contribute.jquery.org/style-guide/) with the following addition: +Code in the API documentation should follow the [jQuery Core Style Guide](https://contribute.jquery.org/style-guide/) with the following addition: * **Document ready syntax**: Use `$( document ).ready(function() {` instead of `$(function() {` as it's harder for new users to distinguish the difference between the latter and an IIFE. diff --git a/categories.xml b/categories.xml index 4af831f8..b08956d9 100644 --- a/categories.xml +++ b/categories.xml @@ -68,12 +68,12 @@ @@ -428,7 +428,7 @@ var files = event.originalEvent.dataTransfer.files; diff --git a/entries/animate.xml b/entries/animate.xml index 5db2dcf6..97cac616 100644 --- a/entries/animate.xml +++ b/entries/animate.xml @@ -72,10 +72,10 @@ $( "#clickme" ).click(function() {

            The opacity of the image is already at its target value, so this property is not animated by the second click. Since the target value for left is a relative value, the image moves even farther to the right during this second animation.

            Directional properties (top, right, bottom, left) have no discernible effect on elements if their position style property is static, which it is by default.

            -

            Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

            +

            Note: The jQuery UI project extends the .animate() method by allowing some non-numeric styles such as colors to be animated. The project also includes mechanisms for specifying animations through CSS classes rather than individual attributes.

            -

            Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

            +

            Note: if attempting to animate an element with a height or width of 0px, where contents of the element are visible due to overflow, jQuery may clip this overflow during animation. By fixing the dimensions of the original element being hidden however, it is possible to ensure that the animation runs smoothly. A clearfix can be used to automatically fix the dimensions of your main element without the need to set this manually.

            Step Function

            The second version of .animate() provides a step option — a callback function that is fired at each step of the animation. This function is useful for enabling custom animation types or altering the animation as it is occurring. It accepts two arguments (now and fx), and this is set to the DOM element being animated.

            @@ -96,7 +96,7 @@ $( "li" ).animate({ });

            Easing

            -

            The remaining parameter of .animate() is a string naming an easing function to use. An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

            +

            The remaining parameter of .animate() is a string naming an easing function to use. An easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

            Per-property Easing

            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:

            diff --git a/entries/attr.xml b/entries/attr.xml index 2a963254..1628ec72 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -69,7 +69,7 @@
        - $(elem).prop("checked") + $( elem ).prop( "checked" ) true (Boolean) Will change with checkbox state
        - elem.getAttribute("checked") + elem.getAttribute( "checked" ) "checked" (String) Initial state of the checkbox; does not change
        - $(elem).attr("checked") + $( elem ).attr( "checked" ) (1.6) "checked" (String) Initial state of the checkbox; does not change
        - $(elem).attr("checked") + $( elem ).attr( "checked" ) (1.6.1+) "checked" (String) Will change with checkbox state
        - $(elem).attr("checked") + $( elem ).attr( "checked" ) (pre-1.6) true (Boolean) Changed with checkbox state " + inputEl[ 0 ].nodeName + inputType + "

        -

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        +

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does. Therefore, the cross-browser-compatible way to determine if a checkbox is checked is to use the property:

        • diff --git a/entries/contents.xml b/entries/contents.xml index 5bfe9fc6..70188f7b 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -46,7 +46,7 @@ $( "p" ) .wrap( "" ); ]]> diff --git a/entries/data.xml b/entries/data.xml index 66ed7253..71c6c10f 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -31,7 +31,7 @@ $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1,

          In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

          Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

          -

          jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

          +

          jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

          Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

          @@ -89,11 +89,11 @@ alert( $( "body" ).data( "foo" ) ); // undefined $( "body" ).data( "bar", "foobar" ); alert( $( "body" ).data( "bar" ) ); // foobar -

          jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

          +

          jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

          HTML5 data-* Attributes

          -

          As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

          +

          As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

          For example, given the following HTML:

          <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>

          All of the following jQuery code will work.

          @@ -105,7 +105,7 @@ $( "div" ).data( "options" ).name === "John";

          The second statement of the code above correctly refers to the data-last-value attribute of the element. In case no data is stored with the passed key, jQuery searches among the attributes of the element, converting a camel-cased string into a dashed string and then prepending data- to the result. So, the string lastValue is converted to data-last-value.

          Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

          -

          When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

          +

          When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

          To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

          The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

          Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

          diff --git a/entries/empty-selector.xml b/entries/empty-selector.xml index 8e06d87c..165e2112 100644 --- a/entries/empty-selector.xml +++ b/entries/empty-selector.xml @@ -9,7 +9,7 @@

          This is the inverse of :parent.

          One important thing to note with :empty (and :parent) is that child elements include text nodes.

          -

          The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

          +

          The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see https://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

          Finds all elements that are empty - they don't have child elements or text. diff --git a/entries/event.isImmediatePropagationStopped.xml b/entries/event.isImmediatePropagationStopped.xml index 44235564..4d8f3ad1 100644 --- a/entries/event.isImmediatePropagationStopped.xml +++ b/entries/event.isImmediatePropagationStopped.xml @@ -6,7 +6,7 @@ Returns whether event.stopImmediatePropagation() was ever called on this event object. -

          This property was introduced in DOM level 3.

          +

          This property was introduced in DOM level 3.

          Checks whether event.stopImmediatePropagation() was called. diff --git a/entries/event.isPropagationStopped.xml b/entries/event.isPropagationStopped.xml index ff7f7451..26a85b76 100644 --- a/entries/event.isPropagationStopped.xml +++ b/entries/event.isPropagationStopped.xml @@ -6,7 +6,7 @@ Returns whether event.stopPropagation() was ever called on this event object. -

          This event method is described in the W3C DOM Level 3 specification.

          +

          This event method is described in the W3C DOM Level 3 specification.

          Checks whether event.stopPropagation() was called diff --git a/entries/event.metaKey.xml b/entries/event.metaKey.xml index b83eeadd..f27b6e46 100644 --- a/entries/event.metaKey.xml +++ b/entries/event.metaKey.xml @@ -8,8 +8,8 @@

          Returns a boolean value (true or false) that indicates whether or not the META key was pressed at the time the event fired. This key might map to an alternative key name on some platforms.

          -

          On Macintosh keyboards, the META key maps to the Command key (⌘).

          -

          On Windows keyboards, the META key maps to the Windows key.

          +

          On Macintosh keyboards, the META key maps to the Command key (⌘).

          +

          On Windows keyboards, the META key maps to the Windows key.

          Determine whether the META key was pressed when the event fired. diff --git a/entries/event.preventDefault.xml b/entries/event.preventDefault.xml index 68f0a43a..ac534fcb 100644 --- a/entries/event.preventDefault.xml +++ b/entries/event.preventDefault.xml @@ -19,7 +19,7 @@ $( "a" ).click(function( event ) { }); ]]> diff --git a/entries/fadeIn.xml b/entries/fadeIn.xml index f3b2e9e2..0f4b6888 100644 --- a/entries/fadeIn.xml +++ b/entries/fadeIn.xml @@ -43,7 +43,7 @@ $( "#clickme" ).click(function() {
          Figure 1 - Illustration of the fadeIn() effect

          Easing

          -

          As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

          +

          As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

          Callback Function

          If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

          As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

          diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index 1bdddaf6..186056eb 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -47,7 +47,7 @@ $( "#clickme" ).click(function() {

          Note: To avoid unnecessary DOM manipulation, .fadeOut() will not hide an element that is already considered hidden. For information on which elements jQuery considers hidden, see :hidden Selector.

        Easing

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        Callback Function

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

        diff --git a/entries/fadeToggle.xml b/entries/fadeToggle.xml index 93bac084..f3906b45 100644 --- a/entries/fadeToggle.xml +++ b/entries/fadeToggle.xml @@ -17,7 +17,7 @@

        The .fadeToggle() method animates the opacity of the matched elements. When called on a visible element, the element's display style property is set to none once the opacity reaches 0, so the element no longer affects the layout of the page.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        Easing

        -

        The string representing an easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        The string representing an easing function specifies the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        Callback Function

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

        diff --git a/entries/hidden-selector.xml b/entries/hidden-selector.xml index 47c0bf6c..e44d732b 100644 --- a/entries/hidden-selector.xml +++ b/entries/hidden-selector.xml @@ -18,7 +18,7 @@

        Elements that are not in a document are not considered to be visible; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.

        This selector is the opposite of the :visible selector. So, every element selected by :hidden isn't selected by :visible and vice versa.

        During animations to show an element, the element is considered to be visible at the start of the animation.

        -

        How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

        +

        How :hidden is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore $( elem ).css( "visibility", "hidden" ).is( ":hidden" ) == false). The release notes outline the changes in more detail.

        jQuery 3 slightly modifies the meaning of :hidden (and therefore of :visible). Starting with this version, elements will be considered :hidden if they don't have any layout boxes. For example, br elements and inline elements with no content will not be selected by the :hidden selector.

        diff --git a/entries/hide.xml b/entries/hide.xml index 3a68ca15..b90aed05 100644 --- a/entries/hide.xml +++ b/entries/hide.xml @@ -35,7 +35,7 @@ $( ".target" ).hide();

        When a duration, a plain object, or a "complete" function is provided, .hide() becomes an animation method. The .hide() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0, the display style property is set to none to ensure that the element no longer affects the layout of the page.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        Note that .hide() is fired immediately and will override the animation queue if no duration or a duration of 0 is specified.

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        Note: This method may cause performance issues, especially when used on many elements. If you're encountering such issues, use performance testing tools to determine whether this method is causing them. Moreover, this method can cause problems with responsive layouts if the display value differs at different viewport sizes.

        diff --git a/entries/html.xml b/entries/html.xml index 7a4f2594..b830c566 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -118,7 +118,7 @@ $( "div.demo-container" ).html(function() { });

        Given a document with six paragraphs, this example will set the HTML of <div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.

        -

        This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

        +

        This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

        To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

        Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

        diff --git a/entries/id-selector.xml b/entries/id-selector.xml index 20aab992..3cc8b926 100644 --- a/entries/id-selector.xml +++ b/entries/id-selector.xml @@ -13,7 +13,7 @@

        For id selectors, jQuery uses the JavaScript function document.getElementById(), which is extremely efficient. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match.

        Calling jQuery() (or $()) with an id selector as its argument will return a jQuery object containing a collection of either zero or one DOM element.

        Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.

        -

        If the id contains characters like periods or colons you have to escape those characters with backslashes.

        +

        If the id contains characters like periods or colons you have to escape those characters with backslashes.

        Select the element with the id "myDiv" and give it a red border. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 8d92e0f8..80157d28 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -98,8 +98,8 @@ $.ajax({
      • "xml": Returns a XML document that can be processed via jQuery.
      • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
      • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
      • -
      • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests that have a callback placeholder, e.g. ?callback=?, are performed using JSONP unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • -
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • +
      • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests that have a callback placeholder, e.g. ?callback=?, are performed using JSONP unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
      • +
      • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
      • "text": A plain text string.
      • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
      • @@ -217,7 +217,7 @@ $.ajax();

        As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header:

        
         $.ajax({
        -  url: "http://fiddle.jshell.net/favicon.png",
        +  url: "https://fiddle.jshell.net/favicon.png",
           beforeSend: function( xhr ) {
             xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
           }
        @@ -326,11 +326,11 @@ jqxhr.always(function() {
             

        Different types of response to $.ajax() call are subjected to different kinds of pre-processing before being passed to the success handler. The type of pre-processing depends by default upon the Content-Type of the response, but can be set explicitly using the dataType option. If the dataType option is provided, the Content-Type header of the response will be disregarded.

        The available data types are text, html, xml, json, jsonp, and script.

        If text or html is specified, no pre-processing occurs. The data is simply passed on to the success handler, and made available through the responseText property of the jqXHR object.

        -

        If xml is specified, the response is parsed using jQuery.parseXML before being passed, as an XMLDocument, to the success handler. The XML document is made available through the responseXML property of the jqXHR object.

        +

        If xml is specified, the response is parsed using jQuery.parseXML before being passed, as an XMLDocument, to the success handler. The XML document is made available through the responseXML property of the jqXHR object.

        If json is specified, the response is parsed using jQuery.parseJSON before being passed, as an object, to the success handler. The parsed JSON object is made available through the responseJSON property of the jqXHR object.

        If script is specified, $.ajax() will execute the JavaScript that is received from the server before passing it on to the success handler as a string.

        If jsonp is specified, $.ajax() will automatically append a query string parameter of (by default) callback=? to the URL. The jsonp and jsonpCallback properties of the settings passed to $.ajax() can be used to specify, respectively, the name of the query string parameter and the name of the JSONP callback function. The server should return valid JavaScript that passes the JSON response into the callback function. $.ajax() will execute the returned JavaScript, calling the JSONP callback function, before passing the JSON object contained in the response to the $.ajax() success handler.

        -

        For more information on JSONP, see the original post detailing its use.

        +

        For more information on JSONP, see the original post detailing its use.

        Sending Data to the Server

        By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.

        The data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type.

        diff --git a/entries/jQuery.ajaxPrefilter.xml b/entries/jQuery.ajaxPrefilter.xml index f82d8d02..708ca829 100644 --- a/entries/jQuery.ajaxPrefilter.xml +++ b/entries/jQuery.ajaxPrefilter.xml @@ -40,11 +40,11 @@ $.ajaxPrefilter(function( options, originalOptions, jqXHR ) { } });
        -

        Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through http://mydomain.net/proxy/:

        +

        Prefilters can also be used to modify existing options. For example, the following proxies cross-domain requests through https://mydomain.net/proxy/:

        
         $.ajaxPrefilter(function( options ) {
           if ( options.crossDomain ) {
        -    options.url = "http://mydomain.net/proxy/" + encodeURIComponent( options.url );
        +    options.url = "https://mydomain.net/proxy/" + encodeURIComponent( options.url );
             options.crossDomain = false;
           }
         });
        diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml
        index f260538a..ac464850 100644
        --- a/entries/jQuery.boxModel.xml
        +++ b/entries/jQuery.boxModel.xml
        @@ -4,7 +4,7 @@
           
             1.0
           
        -  States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. This property was removed in jQuery 1.8. Please try to use feature detection instead.
        +  States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. This property was removed in jQuery 1.8. Please try to use feature detection instead.
           
           
           
        diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml
        index e7c690ac..667ed5f1 100644
        --- a/entries/jQuery.browser.xml
        +++ b/entries/jQuery.browser.xml
        @@ -18,7 +18,7 @@
               
               

        This property is available immediately. It is therefore safe to use it to determine whether or not to call $(document).ready(). The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

        -

        Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

        +

        Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. Instead of relying on $.browser it's better to use libraries like Modernizr.

        Show the browser info. diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 42edb4ae..b28ec2e0 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -38,7 +38,7 @@

        Warning: Passing false for the first argument is not supported.

        Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

        On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not. Deep-extending a cyclical data structure will result in an error.

        -

        For needs that fall outside of this behavior, write a custom extend method instead, or use a library like lodash.

        +

        For needs that fall outside of this behavior, write a custom extend method instead, or use a library like lodash.

        Merge two objects, modifying the first. diff --git a/entries/jQuery.fx.interval.xml b/entries/jQuery.fx.interval.xml index 5516d75c..2dfd1719 100644 --- a/entries/jQuery.fx.interval.xml +++ b/entries/jQuery.fx.interval.xml @@ -6,7 +6,7 @@ 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.getJSON.xml b/entries/jQuery.getJSON.xml index b8a5ee49..11a26341 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -56,7 +56,7 @@ $.getJSON( "ajax/test.json", function( data ) {

        The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

        As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

        -

        Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

        +

        Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

        JSONP

        If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

        diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index 054663df..d47eab4b 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -25,7 +25,7 @@
      • "NaN" (NaN cannot be represented in a JSON string; direct representation of Infinity is also not permitted).
      • The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

        -

        Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

        +

        Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

        Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

        diff --git a/entries/jQuery.support.xml b/entries/jQuery.support.xml index c44b2b42..636ec72e 100644 --- a/entries/jQuery.support.xml +++ b/entries/jQuery.support.xml @@ -4,7 +4,7 @@ 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; 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. diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 80e5bf19..a0ff76d1 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -177,9 +177,9 @@ $( myForm.elements ).hide();

        By default, elements are created with an .ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

        If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's .innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function.

        When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

        -

        Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

        +

        Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

        To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

        -
        $( "<a href='http://jquery.com'></a>" );
        +
        $( "<a href='https://jquery.com'></a>" );

        Tags that cannot contain elements may be quick-closed or not:

        
         $( "<img>" );
        diff --git a/entries/keypress.xml b/entries/keypress.xml
        index 96b6b6c6..0fd28cf3 100644
        --- a/entries/keypress.xml
        +++ b/entries/keypress.xml
        @@ -61,7 +61,7 @@ $( "#other" ).click(function() {
           
           
           
        -    Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (http://api.jquery.com/resources/events.js) for the event object's output.
        +    Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (https://api.jquery.com/resources/events.js) for the event object's output.
             
           
        diff --git a/entries/nth-child-selector.xml b/entries/nth-child-selector.xml
        index 40d46787..68da261d 100644
        --- a/entries/nth-child-selector.xml
        +++ b/entries/nth-child-selector.xml
        @@ -12,7 +12,7 @@
           
             

        Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing two <li>s, $( "li:nth-child(1)" ) selects the first <li> while $( "li:eq(1)" ) selects the second.

        The :nth-child(n) pseudo-class is easily confused with :eq(n), even though the two can result in dramatically different matched elements. With :nth-child(n), all children are counted, regardless of what they are, and the specified element is selected only if it matches the selector attached to the pseudo-class. With :eq(n) only the selector attached to the pseudo-class is counted, not limited to children of any other element, and the (n+1)th one (n is 0-based) is selected.

        -

        Further discussion of this unusual usage can be found in the W3C CSS specification.

        +

        Further discussion of this unusual usage can be found in the W3C CSS specification.

        Find the second li in each matched ul and note it. diff --git a/entries/nth-last-child-selector.xml b/entries/nth-last-child-selector.xml index ce21de1f..9d63636a 100644 --- a/entries/nth-last-child-selector.xml +++ b/entries/nth-last-child-selector.xml @@ -11,7 +11,7 @@ Selects all elements that are the nth-child of their parent, counting from the last element to the first.

        Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing three <li>s, $( "li:nth-last-child(1)" ) selects the third, last, <li>.

        -

        Further discussion of this usage can be found in the W3C CSS specification.

        +

        Further discussion of this usage can be found in the W3C CSS specification.

        Find the second to last li in each matched ul and note it. diff --git a/entries/nth-last-of-type-selector.xml b/entries/nth-last-of-type-selector.xml index eb96db43..602d430a 100644 --- a/entries/nth-last-of-type-selector.xml +++ b/entries/nth-last-of-type-selector.xml @@ -11,7 +11,7 @@ Selects all the elements that are the nth-child of their parent in relation to siblings with the same element name, counting from the last element to the first.

        Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing three <li>s, $('li:nth-last-of-type(1)') selects the third, last, <li>.

        -

        Further discussion of this usage can be found in the W3C CSS specification.

        +

        Further discussion of this usage can be found in the W3C CSS specification.

        Find the second to last li in each matched ul and note it. diff --git a/entries/nth-of-type-selector.xml b/entries/nth-of-type-selector.xml index 839cb8f0..89e6d452 100644 --- a/entries/nth-of-type-selector.xml +++ b/entries/nth-of-type-selector.xml @@ -11,7 +11,7 @@ Selects all elements that are the nth child of their parent in relation to siblings with the same element name.

        Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting.

        -

        Further discussion of this usage can be found in the W3C CSS specification.

        +

        Further discussion of this usage can be found in the W3C CSS specification.

        Find each span that is second in relation to its sibling spans. diff --git a/entries/on.xml b/entries/on.xml index 18a17cae..622fff6a 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -66,7 +66,7 @@ $( "button" ).on( "click", notify );

        When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an Event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

        By default, most events bubble up from the original event target to the document element. At each element along the way, jQuery calls any matching event handlers that have been attached. A handler can prevent the event from bubbling further up the document tree (and thus prevent handlers on those elements from running) by calling event.stopPropagation(). Any other handlers attached on the current element will run however. To prevent that, call event.stopImmediatePropagation(). (Event handlers bound to an element are called in the same order that they were bound.)

        -

        Similarly, a handler can call event.preventDefault() to cancel any default action that the browser may have for this event; for example, the default action on a click event is to follow the link. Not all browser events have default actions, and not all default actions can be canceled. See the W3C Events Specification for details.

        +

        Similarly, a handler can call event.preventDefault() to cancel any default action that the browser may have for this event; for example, the default action on a click event is to follow the link. Not all browser events have default actions, and not all default actions can be canceled. See the W3C Events Specification for details.

        Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $( "a.disabled" ).on( "click", false ); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

        When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $( this ).

        Passing data to the handler

        @@ -96,7 +96,7 @@ $( "button" ).on( "click", {

        The focus and blur events are specified by the W3C to not bubble, but jQuery defines cross-browser focusin and focusout events that do bubble. When focus and blur are used to attach delegated event handlers, jQuery maps the names and delivers them as focusin and focusout respectively. For consistency and clarity, use the bubbling event type names.

        In all browsers, the load, scroll, and error events (e.g., on an <img> element) do not bubble. In Internet Explorer 8 and lower, the paste and reset events do not bubble. Such events are not supported for use with delegation, but they can be used when the event handler is directly attached to the element generating the event.

        The error event on the window object uses nonstandard arguments and return value conventions, so it is not supported by jQuery. Instead, assign a handler function directly to the window.onerror property.

        -

        The handler list for an element is set when the event is first delivered. Adding or removing event handlers on the current element won't take effect until the next time the event is handled. To prevent any further event handlers from executing on an element within an event handler, call event.stopImmediatePropagation(). This behavior goes against the W3C events specification. To better understand this case, consider the following code:

        +

        The handler list for an element is set when the event is first delivered. Adding or removing event handlers on the current element won't take effect until the next time the event is handled. To prevent any further event handlers from executing on an element within an event handler, call event.stopImmediatePropagation(). This behavior goes against the W3C events specification. To better understand this case, consider the following code:

        var $test = $( "#test" );
         
         function handler1() {
        diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml
        index 424cd36e..72832a23 100644
        --- a/entries/parent-selector.xml
        +++ b/entries/parent-selector.xml
        @@ -9,7 +9,7 @@
           
             

        This is the inverse of :empty.

        One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

        -

        The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

        +

        The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

        To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

        diff --git a/entries/prop.xml b/entries/prop.xml index 419c3cc2..49ccceda 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -62,7 +62,7 @@
        -

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        +

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does. Therefore, the cross-browser-compatible way to determine if a checkbox is checked is to use the property:

        • diff --git a/entries/ready.xml b/entries/ready.xml index 9f14ae52..20cdafa6 100644 --- a/entries/ready.xml +++ b/entries/ready.xml @@ -11,7 +11,7 @@

          The .ready() method offers a way to run JavaScript code as soon as the page's Document Object Model (DOM) becomes safe to manipulate. This will often be a good time to perform tasks that are needed before the user views or interacts with the page, for example to add event handlers and initialize plugins. When multiple functions are added via successive calls to this method, they run when the DOM is ready in the order in which they are added. As of jQuery 3.0, jQuery ensures that an exception occuring in one handler does not prevent subsequently added handlers from executing.

          -

          Most browsers provide similar functionality in the form of a DOMContentLoaded event. However, jQuery's .ready() method differs in an important and useful way: If the DOM becomes ready and the browser fires DOMContentLoaded before the code calls .ready( handler ), the function handler will still be executed. In contrast, a DOMContentLoaded event listener added after the event fires is never executed.

          +

          Most browsers provide similar functionality in the form of a DOMContentLoaded event. However, jQuery's .ready() method differs in an important and useful way: If the DOM becomes ready and the browser fires DOMContentLoaded before the code calls .ready( handler ), the function handler will still be executed. In contrast, a DOMContentLoaded event listener added after the event fires is never executed.

          Browsers also provide the load event on the window object. When this event fires it indicates that all assets on the page have loaded, including images. This event can be watched in jQuery using $( window ).on( "load", handler ). In cases where code relies on loaded assets (for example, if the dimensions of an image are required), the code should be placed in a handler for the load event instead.

          diff --git a/entries/serialize.xml b/entries/serialize.xml index c5c99ccb..55dd099f 100644 --- a/entries/serialize.xml +++ b/entries/serialize.xml @@ -15,7 +15,7 @@ $( "form" ).on( "submit", function( event ) { });

        In this case, jQuery serializes the successful controls within the form. Only form elements are examined for inputs they contain, in all other cases the input elements to be serialized should be part of the set passed to the .serialize() method. Selecting both the form and its children in a set will cause duplicates in the serialized string.

        -

        Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

        +

        Note: Only "successful controls" are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a name attribute. Values from checkboxes and radio buttons (inputs of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.

        Serialize a form to a query string that could be sent to a server in an Ajax request. diff --git a/entries/serializeArray.xml b/entries/serializeArray.xml index 4a836265..b2df233e 100644 --- a/entries/serializeArray.xml +++ b/entries/serializeArray.xml @@ -28,7 +28,7 @@ </div> </form>
        -

        The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized. Elements that do not contain a value attribute are represented with the empty string value.

        +

        The .serializeArray() method uses the standard W3C rules for successful controls to determine which elements it should include; in particular the element cannot be disabled and must contain a name attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized. Elements that do not contain a value attribute are represented with the empty string value.

        This method can act on a jQuery object that has selected individual form controls, such as <input>, <textarea>, and <select>. However, it is typically easier to select the <form> element itself for serialization:

        
         $( "form" ).submit(function( event ) {
        diff --git a/entries/show.xml b/entries/show.xml
        index 535b9c5d..c47faccc 100644
        --- a/entries/show.xml
        +++ b/entries/show.xml
        @@ -37,7 +37,7 @@ $( ".target" ).show();
             It is recommended to use different classes with .addClass(), .removeClass() or .toggleClass(). Another approach is using .attr( "style", "display: block !important;" ); be careful, though, as it overwrites the style attribute of the element.

        When a duration, a plain object, or a "complete" function is provided, .show() becomes an animation method. The .show() method animates the width, height, and opacity of the matched elements simultaneously.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        Note: This method may cause performance issues, especially when used on many elements. If you're encountering such issues, use performance testing tools to determine whether this method is causing them. Moreover, this method can cause problems with responsive layouts if the display value differs at different viewport sizes.

        diff --git a/entries/slideDown.xml b/entries/slideDown.xml index 7ca77825..d4f27544 100644 --- a/entries/slideDown.xml +++ b/entries/slideDown.xml @@ -44,7 +44,7 @@ $( "#clickme" ).click(function() {
        Figure 1 - Illustration of the slideDown() effect

        Easing

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        Callback Function

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

        diff --git a/entries/slideToggle.xml b/entries/slideToggle.xml index 12b97ad1..ecf801a6 100644 --- a/entries/slideToggle.xml +++ b/entries/slideToggle.xml @@ -53,7 +53,7 @@ $( "#clickme" ).click(function() {
        Figure 2 - Illustration of the slideToggle() effect when showing the image

        Easing

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        Callback Function

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

        diff --git a/entries/slideUp.xml b/entries/slideUp.xml index 8db63468..648665c9 100644 --- a/entries/slideUp.xml +++ b/entries/slideUp.xml @@ -44,7 +44,7 @@ $( "#clickme" ).click(function() {
        Figure 1 - Illustration of the slideUp() effect

        Easing

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        Callback Function

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        As of jQuery 1.6, the .promise() method can be used in conjunction with the deferred.done() method to execute a single callback for the animation as a whole when all matching elements have completed their animations ( See the example for .promise() ).

        diff --git a/entries/target-selector.xml b/entries/target-selector.xml index 5d60f3da..b010a5ce 100644 --- a/entries/target-selector.xml +++ b/entries/target-selector.xml @@ -7,8 +7,8 @@ Selects the target element indicated by the fragment identifier of the document's URI. -

        If the document's URI contains a fragment identifier, or hash, then the :target selector will match the element with an ID that matches the identifier. For example, given a document with a URI of http://example.com/#foo, $( "p:target" ) will select the <p id="foo"> element.

        -

        Further discussion of this usage can be found in the W3C CSS specification.

        +

        If the document's URI contains a fragment identifier, or hash, then the :target selector will match the element with an ID that matches the identifier. For example, given a document with a URI of https://example.com/#foo, $( "p:target" ) will select the <p id="foo"> element.

        +

        Further discussion of this usage can be found in the W3C CSS specification.

        diff --git a/entries/toggle.xml b/entries/toggle.xml index 6c290220..deb0224d 100644 --- a/entries/toggle.xml +++ b/entries/toggle.xml @@ -40,7 +40,7 @@ $( ".target" ).toggle();

        The matched elements will be revealed or hidden immediately, with no animation, by changing the CSS display property. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline.

        When a duration, a plain object, or a single "complete" function is provided, .toggle() becomes an animation method. The .toggle() method animates the width, height, and opacity of the matched elements simultaneously. When these properties reach 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.

        Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

        -

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        +

        As of jQuery 1.4.3, an optional string naming an easing function may be used. Easing functions specify the speed at which the animation progresses at different points within the animation. The only easing implementations in the jQuery library are the default, called swing, and one that progresses at a constant pace, called linear. More easing functions are available with the use of plug-ins, most notably the jQuery UI suite.

        If supplied, the callback is fired once the animation is complete. This can be useful for stringing different animations together in sequence. The callback is not sent any arguments, but this is set to the DOM element being animated. If multiple elements are animated, it is important to note that the callback is executed once per matched element, not once for the animation as a whole.

        We can animate any element, such as a simple image:

        
        diff --git a/entries/visible-selector.xml b/entries/visible-selector.xml
        index 6b159740..45c5b973 100644
        --- a/entries/visible-selector.xml
        +++ b/entries/visible-selector.xml
        @@ -13,7 +13,7 @@
             

        This selector is the opposite of the :hidden selector. So, every element selected by :visible isn't selected by :hidden and vice versa.

        All option elements are considered hidden, regardless of their selected state.

        During animations that hide an element, the element is considered visible until the end of the animation. During animations to show an element, the element is considered visible at the start at the animation.

        -

        How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

        +

        How :visible is calculated was changed in jQuery 1.3.2. The release notes outline the changes in more detail.

        jQuery 3 slightly modifies the meaning of :visible (and therefore of :hidden). Starting with this version, elements will be considered :visible if they have any layout boxes, including those of zero width and/or height. For example, br elements and inline elements with no content will be selected by the :visible selector.

        diff --git a/notes.xsl b/notes.xsl index 50f94fc0..cfaf9bfb 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. @@ -44,7 +44,7 @@ The method removes all data and event handlers associated with the removed nodes. - Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol. + Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol. Script and JSONP requests are not subject to the same origin policy restrictions. diff --git a/pages/Types.html b/pages/Types.html index b31c47ee..612caa10 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -11,7 +11,7 @@

        This page documents data types appearing in jQuery function signatures, whether defined by JavaScript itself or further restricted by jQuery. Unless explicitly stated otherwise, jQuery functions require primitive values where applicable, and do not accept their Object-wrapped forms. If you want to study these concepts in depth, take a look at MDN.

        -

        You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox). +

        You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console.

        Whenever an example mentions that a type defaults to a boolean value, the result is good to know when using that type in a boolean context:

        @@ -645,16 +645,11 @@

        jQuery

        XMLHttpRequest

        Some of jQuery's Ajax functions return the native XMLHttpRequest (XHR) object, or pass it as an argument to success/error/complete handlers, so that you can do additional processing or monitoring on the request. Note that Ajax functions only return or pass an XHR object when an XHR object is actually used in the request. For example, JSONP requests and cross-domain GET requests use a script element rather than an XHR object.

        -

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

        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:

        -

        Google does not appear to have an official page for their XHR documentation for Chrome. As of version 5, Chrome does not support the use of the file protocol for XHR requests. -

        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 fb25247da95dc147faa36800143e0d8cd2092dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 30 Mar 2018 16:42:11 +0200 Subject: [PATCH 824/998] 1.12.30 --- 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 3fb8caf1..c473dadc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.29", + "version": "1.12.30", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fcf103c2..cf6a5be8 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": "1.12.29", + "version": "1.12.30", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From d2d71d72d85ac117d5f0927204290bbdca9f321d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 30 Mar 2018 16:47:37 +0200 Subject: [PATCH 825/998] Misc: Convert a few remaining HTTP links to HTTPS --- entries/attr.xml | 2 +- entries/data.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/attr.xml b/entries/attr.xml index 1628ec72..2dc8a25e 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -69,7 +69,7 @@
        -

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        +

        According to the W3C forms specification, the checked attribute is a boolean attribute, which means the corresponding property is true if the attribute is present at all—even if, for example, the attribute has no value or is set to empty string value or even "false". This is true of all boolean attributes.

        Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does. Therefore, the cross-browser-compatible way to determine if a checkbox is checked is to use the property:

        • diff --git a/entries/data.xml b/entries/data.xml index 71c6c10f..a8ff396c 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -31,7 +31,7 @@ $( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1,

        In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

        Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

        -

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        +

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

        @@ -89,11 +89,11 @@ alert( $( "body" ).data( "foo" ) ); // undefined $( "body" ).data( "bar", "foobar" ); alert( $( "body" ).data( "bar" ) ); // foobar
        -

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        +

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        HTML5 data-* Attributes

        -

        As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

        +

        As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

        For example, given the following HTML:

        <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>

        All of the following jQuery code will work.

        From 385c4db76d613a6409c7e0aa69a65c821d0c2ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 30 Mar 2018 16:55:44 +0200 Subject: [PATCH 826/998] 1.12.31 --- 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 c473dadc..fb070fc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.30", + "version": "1.12.31", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cf6a5be8..4bfeeb70 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": "1.12.30", + "version": "1.12.31", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From bcdb151494299fa840db8b7bb7721985684c26e3 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Tue, 24 Apr 2018 05:03:23 -0400 Subject: [PATCH 827/998] Event: Clarify valid chars for events and namespaces Fixes #1086 Fixes #1085 Closes #1093 --- entries/on.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entries/on.xml b/entries/on.xml index 622fff6a..735f82b4 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -35,14 +35,14 @@

        The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()

        Event names and namespaces

        Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon characters.

        -

        An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces beginning with an underscore are reserved for jQuery's use.

        +

        An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces should contain upper/lowercase letters and digits only.

        In the second form of .on(), the events argument is a plain object. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

        -

        Direct and delegated events

        +

        Direct and delegated event handlers

        The majority of browser events bubble, or propagate, from the deepest, innermost element (the event target) in the document where they occur all the way up to the body and the document element. In Internet Explorer 8 and lower, a few events such as change and submit do not natively bubble but jQuery patches these to bubble and create consistent cross-browser behavior.

        If selector is omitted or is null, the event handler is referred to as direct or directly-bound. The handler is called every time an event occurs on the selected elements, whether it occurs directly on the element or bubbles from a descendant (inner) element.

        When a selector is provided, the event handler is referred to as delegated. The handler is not called when the event occurs directly on the bound element, but only for descendants (inner elements) that match the selector. jQuery bubbles the event from the event target up to the element where the handler is attached (i.e., innermost to outermost element) and runs the handler for any elements along that path matching the selector.

        Event handlers are bound only to the currently selected elements; they must exist at the time your code makes the call to .on(). To ensure the elements are present and can be selected, place scripts after the elements in the HTML markup or perform event binding inside a document ready handler. Alternatively, use delegated events to attach event handlers.

        -

        Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

        +

        Delegated event handlers have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

        In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored. On a data table with 1,000 rows in its tbody, this example attaches a handler to 1,000 elements:

        
         $( "#dataTable tbody tr" ).on( "click", function() {
        @@ -55,7 +55,7 @@ $( "#dataTable tbody" ).on( "click", "tr", function() {
           console.log( $( this ).text() );
         });
             
        -

        Note: Delegated events do not work for SVG.

        +

        Note: Delegated event handlers do not work for SVG.

        The event handler and its environment

        The handler argument is a function (or the value false, see below), and is required unless you pass an object for the events argument. You can provide an anonymous handler function at the point of the .on() call, as the examples have done above, or declare a named function and pass its name:

        
        
        From 07fab9b17cb8727bee1d60e5d2b122ee75f3a538 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
         
        Date: Wed, 13 Jun 2018 14:29:59 +0200
        Subject: [PATCH 828/998] Misc: Convert a few more remaining links to HTTPS
        
        ---
         README.md                    | 2 +-
         categories.xml               | 2 +-
         entries/contents.xml         | 2 +-
         entries/jQuery.getJSON.xml   | 2 +-
         entries/jQuery.parseJSON.xml | 2 +-
         entries/parent-selector.xml  | 2 +-
         pages/Types.html             | 2 +-
         7 files changed, 7 insertions(+), 7 deletions(-)
        
        diff --git a/README.md b/README.md
        index 1141cd22..f7920803 100644
        --- a/README.md
        +++ b/README.md
        @@ -2,7 +2,7 @@
         
         ## Building and Deploying
         
        -To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](https://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](http://contribute.jquery.org/web-sites/).
        +To build and deploy your changes for previewing in a [`jquery-wp-content`](https://github.com/jquery/jquery-wp-content) instance, follow the [workflow instructions](https://contribute.jquery.org/web-sites/#workflow) from our documentation on [contributing to jQuery Foundation web sites](https://contribute.jquery.org/web-sites/).
         
         ### Requirements
         
        diff --git a/categories.xml b/categories.xml
        index b08956d9..d247f835 100644
        --- a/categories.xml
        +++ b/categories.xml
        @@ -68,7 +68,7 @@
             
             
               
             
         	
        diff --git a/entries/contents.xml b/entries/contents.xml
        index 70188f7b..f4118e0c 100644
        --- a/entries/contents.xml
        +++ b/entries/contents.xml
        @@ -55,7 +55,7 @@ $( "p" )
         $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" );
         ]]>
             
           
           
        diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
        index 11a26341..07a926cc 100644
        --- a/entries/jQuery.getJSON.xml
        +++ b/entries/jQuery.getJSON.xml
        @@ -56,7 +56,7 @@ $.getJSON( "ajax/test.json", function( data ) {
             

        The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

        As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

        -

        Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

        +

        Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see https://json.org/.

        JSONP

        If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

        diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index d47eab4b..16e1f6dd 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -25,7 +25,7 @@
      • "NaN" (NaN cannot be represented in a JSON string; direct representation of Infinity is also not permitted).
      • The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

        -

        Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

        +

        Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see https://json.org/.

        Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

        diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml index 72832a23..bd3fd743 100644 --- a/entries/parent-selector.xml +++ b/entries/parent-selector.xml @@ -9,7 +9,7 @@

        This is the inverse of :empty.

        One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

        -

        The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

        +

        The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see https://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

        To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

        diff --git a/pages/Types.html b/pages/Types.html index 612caa10..de56ce02 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -666,4 +666,4 @@

        Callbacks Object

        XML Document

        A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

        Assert

        -

        A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

        +

        A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

        From 6cbafd74922ba8de0f88bf1fc5f8198902e26bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 13 Jun 2018 14:30:07 +0200 Subject: [PATCH 829/998] 1.12.32 --- 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 fb070fc4..3704bcb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.31", + "version": "1.12.32", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4bfeeb70..3de1003d 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": "1.12.31", + "version": "1.12.32", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 613f22cd40f8b2a9af772b0ac8c0072cd545ed43 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Mon, 23 Jul 2018 16:11:01 +0800 Subject: [PATCH 830/998] Categories: Fix a syntax error in a link to the blogpost Closes #1100 --- categories.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/categories.xml b/categories.xml index d247f835..c02b93b3 100644 --- a/categories.xml +++ b/categories.xml @@ -73,7 +73,7 @@
        From 53308ef90ca423e35b101aea27055a48c1c67b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 23 Jul 2018 10:12:50 +0200 Subject: [PATCH 831/998] 1.12.33 --- 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 3704bcb7..5e1b2f79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.32", + "version": "1.12.33", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3de1003d..509a4a72 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": "1.12.32", + "version": "1.12.33", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3a94c501985adee0c01af01df4bc79968d82bb7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 23 Jul 2018 19:09:21 +0200 Subject: [PATCH 832/998] 1.12.34 --- 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 5e1b2f79..95efd8ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.33", + "version": "1.12.34", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 509a4a72..9584d1eb 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": "1.12.33", + "version": "1.12.34", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 8407a384caf4895692bb3786cdaf0c6ec8b2ba68 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Wed, 26 Sep 2018 02:03:05 +0530 Subject: [PATCH 833/998] deferred.catch: Add a missing word Closes gh-1106 --- entries/deferred.catch.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/deferred.catch.xml b/entries/deferred.catch.xml index 17df8dda..e6e3d95a 100644 --- a/entries/deferred.catch.xml +++ b/entries/deferred.catch.xml @@ -15,7 +15,7 @@

        deferred.catch( fn ) is an alias to deferred.then( null, fn ). Read its page for more information.

        - Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can rejection handlers using the .catch method. + Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can add rejection handlers using the .catch method. + diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index b31ce023..56a8ced5 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -43,4 +43,5 @@ $( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." ) + diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index dfe45f2d..51bdf746 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -208,5 +208,6 @@ $( "a" ).on( "click", function( event ) {
        This signature (only!) is deprecated as of jQuery 3.0.
        + \ No newline at end of file From ed497086495d7cb6f7379b42c8cc2fb77bc6812b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Tue, 13 Nov 2018 17:52:48 +0100 Subject: [PATCH 835/998] 1.12.35 --- 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 95efd8ae..a3cc492e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.34", + "version": "1.12.35", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9584d1eb..f06fac96 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": "1.12.34", + "version": "1.12.35", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 3d88fc63dc82f5d4ddf390076f537dcadbe4cf64 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 21 Nov 2018 10:51:43 -0500 Subject: [PATCH 836/998] data: Explicitly disavow writing data-* attributes (#1112) Also includes general cleanup. Fixes gh-1023 Closes gh-1112 --- entries/data.xml | 54 ++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/entries/data.xml b/entries/data.xml index a8ff396c..7e742da1 100644 --- a/entries/data.xml +++ b/entries/data.xml @@ -24,14 +24,14 @@

        We can set several distinct values for a single element and retrieve them later:

        
         $( "body" ).data( "foo", 52 );
        -$( "body" ).data( "bar", { myType: "test", count: 40 } );
        +$( "body" ).data( "bar", { isManual: true } );
         $( "body" ).data( { baz: [ 1, 2, 3 ] } );
         $( "body" ).data( "foo" ); // 52
        -$( "body" ).data(); // { foo: 52, bar: { myType: "test", count: 40 }, baz: [ 1, 2, 3 ] }
        +$( "body" ).data(); // { foo: 52, bar: { isManual: true }, baz: [ 1, 2, 3 ] }
               
        -

        In jQuery 1.4.3 setting an element's data object with .data(obj) extends the data previously stored with that element.

        -

        Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

        -

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        +

        Using the data() method to update data does not affect attributes in the DOM. To set a data-* attribute value, use attr.

        +

        Prior to jQuery 1.4.3, .data( obj ) completely replaced all data. Since jQuery 1.4.3, data is instead extended by shallow merge.

        +

        Since jQuery 3, every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter in a key is replaced by the uppercase version of the letter, in alignment with the HTML dataset API. A statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

        @@ -76,46 +76,36 @@ $( "span:last" ).text( $( "div" ).data( "test" ).last ); 1.4 - Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + Return arbitrary data associated with the first element in the jQuery collection, as set by data() or by an HTML5 data-* attribute. -

        The .data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks. We can retrieve several distinct values for a single element one at a time, or as a set:

        +

        The .data() method allows us to read data previously associated with DOM elements. We can retrieve several distinct values for a single element one at a time, or as a set:

        
        -alert( $( "body" ).data( "foo" ) );
        -alert( $( "body" ).data() );
        -      
        -

        The above lines alert the data values that were set on the body element. If no data at all was set on that element, undefined is returned.

        -
        
        -alert( $( "body" ).data( "foo" ) ); // undefined
        -$( "body" ).data( "bar", "foobar" );
        -alert( $( "body" ).data( "bar" ) ); // foobar
        +var elem = document.createElement( "span" );
        +$( elem ).data( "foo" ); // undefined
        +$( elem ).data(); // {}
        +
        +$( elem ).data( "foo", 42 );
        +$( elem ).data( "foo" ); // 42
        +$( elem ).data(); // { foo: 42 }
               
        -

        jQuery 3 changes the behavior of this method to align it to the Dataset API specifications. Specifically, jQuery 3 transforms every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter by the uppercase version of the letter as per definition of the algorithm of the Dataset API. Writing a statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        +

        Calling .data() with no parameters returns a JavaScript object containing each stored value as a property. The object can be used directly to get data values (but note that property names originally containing dashes will have been modified as described below).

        +

        Since jQuery 3, every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter in a key is replaced by the uppercase version of the letter, in alignment with the HTML dataset API. A statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }.

        - HTML5 data-* Attributes + HTML5 data-* Attributes

        -

        As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. The treatment of attributes with embedded dashes was changed in jQuery 1.6 to conform to the W3C HTML5 specification.

        +

        Since jQuery 1.4.3, data-* attributes are used to initialize jQuery data. An element's data-* attributes are retrieved the first time the data() method is invoked upon it, and then are no longer accessed or mutated (all values are stored internally by jQuery).

        +

        Every attempt is made to convert the attribute's string value to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A string is only converted to a number if doing so doesn't change its representation (for example, the string "100" is converted to the number 100, but "1E02" and "100.000" are left as strings because their numeric value of 100 serializes to "100"). When a string starts with '{' or '[', then jQuery.parseJSON is used to parse it; it must follow valid JSON syntax including quoted property names. A string not parseable as a JavaScript value is not converted.

        +

        To retrieve a data-* attribute value as an unconverted string, use the attr() method.

        +

        Since jQuery 1.6, dashes in data-* attribute names have been processed in alignment with the HTML dataset API.

        For example, given the following HTML:

        <div data-role="page" data-last-value="43" data-hidden="true" data-options='{"name":"John"}'></div>
        -

        All of the following jQuery code will work.

        +

        The following comparisons are all true:

        
         $( "div" ).data( "role" ) === "page";
         $( "div" ).data( "lastValue" ) === 43;
         $( "div" ).data( "hidden" ) === true;
         $( "div" ).data( "options" ).name === "John";
               
        -

        The second statement of the code above correctly refers to the data-last-value attribute of the element. In case no data is stored with the passed key, jQuery searches among the attributes of the element, converting a camel-cased string into a dashed string and then prepending data- to the result. So, the string lastValue is converted to data-last-value.

        -

        Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A value is only converted to a number if doing so doesn't change the value's representation. For example, "1E02" and "100.000" are equivalent as numbers (numeric value 100) but converting them would alter their representation so they are left as strings. The string value "100" is converted to the number 100.

        -

        When the data attribute is an object (starts with '{') or array (starts with '[') then jQuery.parseJSON is used to parse the string; it must follow valid JSON syntax including quoted property names. If the value isn't parseable as a JavaScript value, it is left as a string.

        -

        To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.

        -

        The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

        -

        Calling .data() with no parameters retrieves all of the values as a JavaScript object. This object can be safely cached in a variable as long as a new object is not set with .data(obj). Using the object directly to get or set values is faster than making individual calls to .data() to get or set each value:

        -
        
        -var mydata = $( "#mydiv" ).data();
        -if ( mydata.count < 9 ) {
        -  mydata.count = 43;
        -  mydata.status = "embiggened";
        -}
        -    
        From fb2edb2c941ef7a44cac66a0e4be45e630ae48d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 21 Nov 2018 16:52:32 +0100 Subject: [PATCH 837/998] 1.12.36 --- 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 a3cc492e..e3059772 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.35", + "version": "1.12.36", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f06fac96..34ef2b83 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": "1.12.35", + "version": "1.12.36", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 812e1326b3323bbf6c32ac284e3e50be17b3cff4 Mon Sep 17 00:00:00 2001 From: Matt Doyle Date: Wed, 28 Nov 2018 08:19:06 +1100 Subject: [PATCH 838/998] width: Add quotes around .css() width argument (#1118) Fixes gh-1102 Closes gh-1118 --- entries/width.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/width.xml b/entries/width.xml index f073145a..c197119c 100644 --- a/entries/width.xml +++ b/entries/width.xml @@ -8,7 +8,7 @@ Get the current computed width for the first element in the set of matched elements. -

        The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation.

        +

        The difference between .css( "width" ) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation.

        Figure 1 - Illustration of the measured width
        From e56c5736cc65dd9ee7d6b08584afaf7387e1fe9c Mon Sep 17 00:00:00 2001 From: Philippe Cloutier Date: Sun, 10 Feb 2019 18:06:13 -0500 Subject: [PATCH 839/998] load: Fix singular references to matched elements Fixes #1125 Closes #1126 --- entries/load.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/load.xml b/entries/load.xml index 3444cb90..c0f6a46f 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -18,12 +18,12 @@ A callback function that is executed when the request completes. - Load data from the server and place the returned HTML into the matched element. + Load data from the server and place the returned HTML into the matched elements.

        Note: Prior to jQuery 3.0, the event handling suite also had a method named .load(). Older versions of jQuery determined which method to fire based on the set of arguments passed to it.

        -

        This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

        +

        This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched elements to the returned data. This means that most uses of the method can be quite simple:

        
         $( "#result" ).load( "ajax/test.html" );
             
        From 4b6b1e9f08412e892cfb6a76db36898114f1a04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 8 Apr 2019 11:06:08 +0200 Subject: [PATCH 840/998] 1.12.37 --- 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 e3059772..a70406ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.36", + "version": "1.12.37", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 34ef2b83..11fc459d 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": "1.12.36", + "version": "1.12.37", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 51f3979e25b4dc0c13d38e588fef602d8d288415 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Mon, 15 Apr 2019 11:20:39 -0400 Subject: [PATCH 841/998] Ajax: Add scriptAttrs Fixes #1091 Closes #1092 Can be landed once https://github.com/jquery/jquery/issues/3028 is closed and we know a specific version for the feature. I've assume 3.4.0 here. --- entries/jQuery.ajax.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 80157d28..f75de949 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -145,8 +145,11 @@ $.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. + - Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + Only applies when the "script" transport is used. Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. Alternatively, the charset attribute can be specified in scriptAttrs instead, which will also ensure the use of the "script" transport. From 05e21403b1a807adb0e3bae152cee68773996100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 29 Apr 2019 18:49:13 +0200 Subject: [PATCH 842/998] jQuery.globalEval: Document the nonce option Fixes #1123 Closes #1131 --- entries/jQuery.globalEval.xml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.globalEval.xml b/entries/jQuery.globalEval.xml index ad6b7d1e..1900cd78 100644 --- a/entries/jQuery.globalEval.xml +++ b/entries/jQuery.globalEval.xml @@ -7,6 +7,17 @@ The JavaScript code to execute. + + 3.4.0 + + The JavaScript code to execute. + + + + The nonce attribute passed to the executed script. + + + Execute some JavaScript code globally.

        This method behaves differently from using a normal JavaScript eval() in that it's executed within the global context (which is important for loading external scripts dynamically).

        @@ -15,7 +26,19 @@ Execute a script in the global context. + + + Execute a script with a nonce value on a site with Content Security Policy enabled. + Date: Sun, 5 May 2019 20:58:19 +0100 Subject: [PATCH 844/998] Replaced "delegated events" with "delegated event handlers" Closes gh-1132 Fixes gh-1103 --- entries/on.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entries/on.xml b/entries/on.xml index 735f82b4..568f3be6 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -41,9 +41,9 @@

        The majority of browser events bubble, or propagate, from the deepest, innermost element (the event target) in the document where they occur all the way up to the body and the document element. In Internet Explorer 8 and lower, a few events such as change and submit do not natively bubble but jQuery patches these to bubble and create consistent cross-browser behavior.

        If selector is omitted or is null, the event handler is referred to as direct or directly-bound. The handler is called every time an event occurs on the selected elements, whether it occurs directly on the element or bubbles from a descendant (inner) element.

        When a selector is provided, the event handler is referred to as delegated. The handler is not called when the event occurs directly on the bound element, but only for descendants (inner elements) that match the selector. jQuery bubbles the event from the event target up to the element where the handler is attached (i.e., innermost to outermost element) and runs the handler for any elements along that path matching the selector.

        -

        Event handlers are bound only to the currently selected elements; they must exist at the time your code makes the call to .on(). To ensure the elements are present and can be selected, place scripts after the elements in the HTML markup or perform event binding inside a document ready handler. Alternatively, use delegated events to attach event handlers.

        -

        Delegated event handlers have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

        -

        In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored. On a data table with 1,000 rows in its tbody, this example attaches a handler to 1,000 elements:

        +

        Event handlers are bound only to the currently selected elements; they must exist at the time your code makes the call to .on(). To ensure the elements are present and can be selected, place scripts after the elements in the HTML markup or perform event binding inside a document ready handler. Alternatively, use delegated event handlers to attach event handlers.

        +

        Delegated event handlers have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated event handlers to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

        +

        In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated event handlers is their potential for much lower overhead when many elements must be monitored. On a data table with 1,000 rows in its tbody, this example attaches a handler to 1,000 elements:

        
         $( "#dataTable tbody tr" ).on( "click", function() {
           console.log( $( this ).text() );
        
        From 25b47f5b54cf574e53f793eb0035dbf6107a3797 Mon Sep 17 00:00:00 2001
        From: Aurelio De Rosa 
        Date: Mon, 6 May 2019 15:13:04 +0100
        Subject: [PATCH 845/998] Document optional includeMargin argument
        
        Closes gh-1133
        Fixes gh-1107
        ---
         entries/outerHeight.xml | 3 +++
         entries/outerWidth.xml  | 3 +++
         2 files changed, 6 insertions(+)
        
        diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml
        index e1caaf55..09aa255e 100644
        --- a/entries/outerHeight.xml
        +++ b/entries/outerHeight.xml
        @@ -53,6 +53,9 @@ $( "p:last" ).text(
               
               A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string).
             
        +    
        +      A Boolean indicating whether to new value should account for the element's margin.
        +    
           
           
             1.8.0
        diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml
        index 4e613cc1..cfb07bc8 100644
        --- a/entries/outerWidth.xml
        +++ b/entries/outerWidth.xml
        @@ -53,6 +53,9 @@ $( "p:last" ).text(
               
               A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string).
             
        +    
        +      A Boolean indicating whether to new value should account for the element's margin.
        +    
           
           
             1.8.0
        
        From 7cd5ae8e5756bdacaeda503abe8ebc3ed4e3be4d Mon Sep 17 00:00:00 2001
        From: biziclop <904630+biziclop@users.noreply.github.com>
        Date: Thu, 6 Jun 2019 23:18:32 +0200
        Subject: [PATCH 846/998] "Returning an Empty Set" clarifications (#1137)
        
        Fixes #1136
        ---
         entries/jQuery.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/jQuery.xml b/entries/jQuery.xml
        index a0ff76d1..b31102b5 100644
        --- a/entries/jQuery.xml
        +++ b/entries/jQuery.xml
        @@ -77,7 +77,7 @@ $.post( "url.xml", function( data ) {
               

        When a jQuery object is passed to the $() function, a clone of the object is created. This new jQuery object references the same DOM elements as the initial one.

        Returning an Empty Set

        -

        As of jQuery 1.4, calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). In previous versions of jQuery, this would return a set containing the document node.

        +

        Calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). Similarly, if an argument of null, undefined, an empty array ([]), or an empty string ("") is passed, the set contains no elements.

        Working With Plain Objects

        At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.on(), .off(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

        
        
        From 49e1e7c6b9bfe8650cd4d12b51d6e5b53e168cf0 Mon Sep 17 00:00:00 2001
        From: ryenus 
        Date: Thu, 18 Jul 2019 06:21:17 +0800
        Subject: [PATCH 847/998] Types: Fix a typo: "{a,i}s passed as"
        
        Closes gh-1139
        ---
         pages/Types.html | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/pages/Types.html b/pages/Types.html
        index de56ce02..fd4df2ca 100644
        --- a/pages/Types.html
        +++ b/pages/Types.html
        @@ -149,7 +149,7 @@ 

        Boolean Default

        htmlString

        A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it contained <tag ... > anywhere within the string.

        -

        When a string as passed as an argument to a manipulation method such as .append(), it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.

        +

        When a string is passed as an argument to a manipulation method such as .append(), it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.

        For explicit parsing of a string to HTML, the $.parseHTML() method is available as of jQuery 1.8.

        // Appends hello:
         $( "hello" ).appendTo( "body" );
        
        From 0fca273075cd8fbcebc7b3b10199881700d69123 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
         
        Date: Thu, 18 Jul 2019 00:21:57 +0200
        Subject: [PATCH 848/998] 1.12.39
        
        ---
         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 3efd0132..d2b7ebfd 100644
        --- a/package-lock.json
        +++ b/package-lock.json
        @@ -1,6 +1,6 @@
         {
           "name": "api.jquery.com",
        -  "version": "1.12.38",
        +  "version": "1.12.39",
           "lockfileVersion": 1,
           "requires": true,
           "dependencies": {
        diff --git a/package.json b/package.json
        index 8dbb378c..355f6217 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": "1.12.38",
        +  "version": "1.12.39",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From d3b821b1a5ed1516153076c2dc3eb40182c4c362 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
         
        Date: Fri, 30 Aug 2019 00:18:09 +0200
        Subject: [PATCH 849/998] Build: Make the build compatible with Node.js 12
        
        ---
         .nvmrc            |    1 +
         package-lock.json | 2360 +++++++++++++++++++++++++++++++++++++--------
         package.json      |    6 +-
         3 files changed, 1955 insertions(+), 412 deletions(-)
         create mode 100644 .nvmrc
        
        diff --git a/.nvmrc b/.nvmrc
        new file mode 100644
        index 00000000..f599e28b
        --- /dev/null
        +++ b/.nvmrc
        @@ -0,0 +1 @@
        +10
        diff --git a/package-lock.json b/package-lock.json
        index d2b7ebfd..c0781a3e 100644
        --- a/package-lock.json
        +++ b/package-lock.json
        @@ -4,56 +4,239 @@
           "lockfileVersion": 1,
           "requires": true,
           "dependencies": {
        +    "CSSselect": {
        +      "version": "0.4.1",
        +      "resolved": "https://registry.npmjs.org/CSSselect/-/CSSselect-0.4.1.tgz",
        +      "integrity": "sha1-+Kt+H4QYzmPNput713ioXX7EkrI=",
        +      "requires": {
        +        "CSSwhat": "0.4",
        +        "domutils": "1.4"
        +      }
        +    },
        +    "CSSwhat": {
        +      "version": "0.4.7",
        +      "resolved": "https://registry.npmjs.org/CSSwhat/-/CSSwhat-0.4.7.tgz",
        +      "integrity": "sha1-hn2g/zn3eGEyQsRM/qg/CqTr35s="
        +    },
             "abbrev": {
        -      "version": "1.1.0",
        -      "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
        -      "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8="
        +      "version": "1.1.1",
        +      "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
        +      "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
        +    },
        +    "ansi-styles": {
        +      "version": "3.2.1",
        +      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
        +      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
        +      "requires": {
        +        "color-convert": "^1.9.0"
        +      }
             },
             "argparse": {
        -      "version": "0.1.16",
        -      "resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz",
        -      "integrity": "sha1-z9AeD7uj1srtBJ+9dY1A9lGW9Xw=",
        +      "version": "1.0.10",
        +      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
        +      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
               "requires": {
        -        "underscore": "1.7.0",
        -        "underscore.string": "2.4.0"
        +        "sprintf-js": "~1.0.2"
               },
               "dependencies": {
        -        "underscore.string": {
        -          "version": "2.4.0",
        -          "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz",
        -          "integrity": "sha1-jN2PusTi0uoefi6Al8QvRCKA+Fs="
        +        "sprintf-js": {
        +          "version": "1.0.3",
        +          "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
        +          "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
                 }
               }
             },
        +    "arr-diff": {
        +      "version": "4.0.0",
        +      "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
        +      "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA="
        +    },
        +    "arr-flatten": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
        +      "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg=="
        +    },
        +    "arr-union": {
        +      "version": "3.1.0",
        +      "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
        +      "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ="
        +    },
        +    "array-each": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
        +      "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8="
        +    },
        +    "array-find-index": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
        +      "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E="
        +    },
        +    "array-slice": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
        +      "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w=="
        +    },
        +    "array-unique": {
        +      "version": "0.3.2",
        +      "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
        +      "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="
        +    },
        +    "assign-symbols": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
        +      "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c="
        +    },
             "async": {
        -      "version": "0.1.22",
        -      "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz",
        -      "integrity": "sha1-D8GqoIig4+8Ovi2IMbqw3PiEUGE="
        +      "version": "1.5.2",
        +      "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
        +      "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
        +    },
        +    "atob": {
        +      "version": "2.1.2",
        +      "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
        +      "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
             },
             "balanced-match": {
               "version": "1.0.0",
               "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
               "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
             },
        +    "base": {
        +      "version": "0.11.2",
        +      "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
        +      "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
        +      "requires": {
        +        "cache-base": "^1.0.1",
        +        "class-utils": "^0.3.5",
        +        "component-emitter": "^1.2.1",
        +        "define-property": "^1.0.0",
        +        "isobject": "^3.0.1",
        +        "mixin-deep": "^1.2.0",
        +        "pascalcase": "^0.1.1"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
        +          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
        +          "requires": {
        +            "is-descriptor": "^1.0.0"
        +          }
        +        },
        +        "is-accessor-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-data-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-descriptor": {
        +          "version": "1.0.2",
        +          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
        +          "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
        +          "requires": {
        +            "is-accessor-descriptor": "^1.0.0",
        +            "is-data-descriptor": "^1.0.0",
        +            "kind-of": "^6.0.2"
        +          }
        +        }
        +      }
        +    },
             "brace-expansion": {
        -      "version": "1.1.8",
        -      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
        -      "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
        +      "version": "1.1.11",
        +      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
        +      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
               "requires": {
        -        "balanced-match": "1.0.0",
        +        "balanced-match": "^1.0.0",
                 "concat-map": "0.0.1"
               }
             },
        +    "braces": {
        +      "version": "2.3.2",
        +      "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
        +      "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
        +      "requires": {
        +        "arr-flatten": "^1.1.0",
        +        "array-unique": "^0.3.2",
        +        "extend-shallow": "^2.0.1",
        +        "fill-range": "^4.0.0",
        +        "isobject": "^3.0.1",
        +        "repeat-element": "^1.1.2",
        +        "snapdragon": "^0.8.1",
        +        "snapdragon-node": "^2.0.1",
        +        "split-string": "^3.0.2",
        +        "to-regex": "^3.0.1"
        +      },
        +      "dependencies": {
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
        +          "requires": {
        +            "is-extendable": "^0.1.0"
        +          }
        +        }
        +      }
        +    },
        +    "cache-base": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
        +      "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
        +      "requires": {
        +        "collection-visit": "^1.0.0",
        +        "component-emitter": "^1.2.1",
        +        "get-value": "^2.0.6",
        +        "has-value": "^1.0.0",
        +        "isobject": "^3.0.1",
        +        "set-value": "^2.0.0",
        +        "to-object-path": "^0.3.0",
        +        "union-value": "^1.0.0",
        +        "unset-value": "^1.0.0"
        +      }
        +    },
        +    "camelcase": {
        +      "version": "2.1.1",
        +      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
        +      "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8="
        +    },
        +    "camelcase-keys": {
        +      "version": "2.1.0",
        +      "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
        +      "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
        +      "requires": {
        +        "camelcase": "^2.0.0",
        +        "map-obj": "^1.0.0"
        +      }
        +    },
        +    "chalk": {
        +      "version": "2.4.2",
        +      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
        +      "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
        +      "requires": {
        +        "ansi-styles": "^3.2.1",
        +        "escape-string-regexp": "^1.0.5",
        +        "supports-color": "^5.3.0"
        +      }
        +    },
             "cheerio": {
               "version": "0.17.0",
               "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.17.0.tgz",
               "integrity": "sha1-+lrkLMYBIRM9KW0LRtmDIV9yaOo=",
               "requires": {
        -        "CSSselect": "0.4.1",
        -        "dom-serializer": "0.0.1",
        -        "entities": "1.1.1",
        -        "htmlparser2": "3.7.3",
        -        "lodash": "2.4.2"
        +        "CSSselect": "~0.4.0",
        +        "dom-serializer": "~0.0.0",
        +        "entities": "~1.1.1",
        +        "htmlparser2": "~3.7.2",
        +        "lodash": "~2.4.1"
               },
               "dependencies": {
                 "lodash": {
        @@ -63,52 +246,163 @@
                 }
               }
             },
        -    "coffee-script": {
        -      "version": "1.3.3",
        -      "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz",
        -      "integrity": "sha1-FQ1rTLUiiUNp7+1qIQHCC8f0pPQ="
        +    "class-utils": {
        +      "version": "0.3.6",
        +      "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
        +      "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
        +      "requires": {
        +        "arr-union": "^3.1.0",
        +        "define-property": "^0.2.5",
        +        "isobject": "^3.0.0",
        +        "static-extend": "^0.1.1"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "0.2.5",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
        +          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
        +          "requires": {
        +            "is-descriptor": "^0.1.0"
        +          }
        +        }
        +      }
        +    },
        +    "coffeescript": {
        +      "version": "1.10.0",
        +      "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz",
        +      "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4="
        +    },
        +    "collection-visit": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
        +      "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
        +      "requires": {
        +        "map-visit": "^1.0.0",
        +        "object-visit": "^1.0.0"
        +      }
        +    },
        +    "color-convert": {
        +      "version": "1.9.3",
        +      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
        +      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
        +      "requires": {
        +        "color-name": "1.1.3"
        +      }
        +    },
        +    "color-name": {
        +      "version": "1.1.3",
        +      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
        +      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
             },
             "colors": {
        -      "version": "0.6.2",
        -      "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
        -      "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w="
        +      "version": "1.1.2",
        +      "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
        +      "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM="
        +    },
        +    "component-emitter": {
        +      "version": "1.3.0",
        +      "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
        +      "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
             },
             "concat-map": {
               "version": "0.0.1",
               "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
               "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
             },
        +    "copy-descriptor": {
        +      "version": "0.1.1",
        +      "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
        +      "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40="
        +    },
             "core-util-is": {
               "version": "1.0.2",
               "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
               "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
             },
        -    "CSSselect": {
        +    "currently-unhandled": {
               "version": "0.4.1",
        -      "resolved": "https://registry.npmjs.org/CSSselect/-/CSSselect-0.4.1.tgz",
        -      "integrity": "sha1-+Kt+H4QYzmPNput713ioXX7EkrI=",
        +      "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
        +      "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
               "requires": {
        -        "CSSwhat": "0.4.7",
        -        "domutils": "1.4.3"
        +        "array-find-index": "^1.0.1"
               }
             },
        -    "CSSwhat": {
        -      "version": "0.4.7",
        -      "resolved": "https://registry.npmjs.org/CSSwhat/-/CSSwhat-0.4.7.tgz",
        -      "integrity": "sha1-hn2g/zn3eGEyQsRM/qg/CqTr35s="
        -    },
             "dateformat": {
        -      "version": "1.0.2-1.2.3",
        -      "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz",
        -      "integrity": "sha1-sCIMAt6YYXQztyhRz0fePfLNvuk="
        +      "version": "1.0.12",
        +      "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz",
        +      "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=",
        +      "requires": {
        +        "get-stdin": "^4.0.1",
        +        "meow": "^3.3.0"
        +      }
        +    },
        +    "debug": {
        +      "version": "2.6.9",
        +      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
        +      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
        +      "requires": {
        +        "ms": "2.0.0"
        +      }
        +    },
        +    "decamelize": {
        +      "version": "1.2.0",
        +      "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
        +      "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
        +    },
        +    "decode-uri-component": {
        +      "version": "0.2.0",
        +      "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
        +      "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
        +    },
        +    "define-property": {
        +      "version": "2.0.2",
        +      "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
        +      "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
        +      "requires": {
        +        "is-descriptor": "^1.0.2",
        +        "isobject": "^3.0.1"
        +      },
        +      "dependencies": {
        +        "is-accessor-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-data-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-descriptor": {
        +          "version": "1.0.2",
        +          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
        +          "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
        +          "requires": {
        +            "is-accessor-descriptor": "^1.0.0",
        +            "is-data-descriptor": "^1.0.0",
        +            "kind-of": "^6.0.2"
        +          }
        +        }
        +      }
        +    },
        +    "detect-file": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
        +      "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc="
             },
             "dom-serializer": {
               "version": "0.0.1",
               "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.0.1.tgz",
               "integrity": "sha1-lYmCfx4y0iw3yCmtq9WbMkevjq8=",
               "requires": {
        -        "domelementtype": "1.1.3",
        -        "entities": "1.1.1"
        +        "domelementtype": "~1.1.1",
        +        "entities": "~1.1.1"
               },
               "dependencies": {
                 "domelementtype": {
        @@ -119,16 +413,16 @@
               }
             },
             "domelementtype": {
        -      "version": "1.3.0",
        -      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
        -      "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI="
        +      "version": "1.3.1",
        +      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
        +      "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w=="
             },
             "domhandler": {
               "version": "2.2.1",
               "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.1.tgz",
               "integrity": "sha1-Wd+dzSJ+gIs2Wuc+H2aErD2Ub8I=",
               "requires": {
        -        "domelementtype": "1.3.0"
        +        "domelementtype": "1"
               }
             },
             "domutils": {
        @@ -136,18 +430,31 @@
               "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz",
               "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=",
               "requires": {
        -        "domelementtype": "1.3.0"
        +        "domelementtype": "1"
               }
             },
             "entities": {
        -      "version": "1.1.1",
        -      "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
        -      "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
        +      "version": "1.1.2",
        +      "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
        +      "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
        +    },
        +    "error-ex": {
        +      "version": "1.3.2",
        +      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
        +      "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
        +      "requires": {
        +        "is-arrayish": "^0.2.1"
        +      }
        +    },
        +    "escape-string-regexp": {
        +      "version": "1.0.5",
        +      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
        +      "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
             },
             "esprima": {
        -      "version": "1.0.4",
        -      "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
        -      "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
        +      "version": "4.0.1",
        +      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
        +      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
             },
             "eventemitter2": {
               "version": "0.4.14",
        @@ -159,288 +466,499 @@
               "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
               "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw="
             },
        -    "findup-sync": {
        -      "version": "0.1.3",
        -      "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz",
        -      "integrity": "sha1-fz56l7gjksZTvwZYm9hRkOk8NoM=",
        +    "expand-brackets": {
        +      "version": "2.1.4",
        +      "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
        +      "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
               "requires": {
        -        "glob": "3.2.11",
        -        "lodash": "2.4.2"
        +        "debug": "^2.3.3",
        +        "define-property": "^0.2.5",
        +        "extend-shallow": "^2.0.1",
        +        "posix-character-classes": "^0.1.0",
        +        "regex-not": "^1.0.0",
        +        "snapdragon": "^0.8.1",
        +        "to-regex": "^3.0.1"
               },
               "dependencies": {
        -        "glob": {
        -          "version": "3.2.11",
        -          "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz",
        -          "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=",
        +        "define-property": {
        +          "version": "0.2.5",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
        +          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
                   "requires": {
        -            "inherits": "2.0.3",
        -            "minimatch": "0.3.0"
        +            "is-descriptor": "^0.1.0"
                   }
                 },
        -        "lodash": {
        -          "version": "2.4.2",
        -          "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz",
        -          "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4="
        -        },
        -        "minimatch": {
        -          "version": "0.3.0",
        -          "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
        -          "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=",
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
                   "requires": {
        -            "lru-cache": "2.7.3",
        -            "sigmund": "1.0.1"
        +            "is-extendable": "^0.1.0"
                   }
                 }
               }
             },
        -    "getobject": {
        -      "version": "0.1.0",
        -      "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
        -      "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw="
        +    "expand-tilde": {
        +      "version": "2.0.2",
        +      "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
        +      "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=",
        +      "requires": {
        +        "homedir-polyfill": "^1.0.1"
        +      }
             },
        -    "gilded-wordpress": {
        -      "version": "1.0.3",
        -      "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.3.tgz",
        -      "integrity": "sha1-kh/iJ93yWyxAgp5QUjsOMXRDsz4=",
        +    "extend": {
        +      "version": "3.0.2",
        +      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
        +      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
        +    },
        +    "extend-shallow": {
        +      "version": "3.0.2",
        +      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
        +      "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
               "requires": {
        -        "async": "0.9.2",
        -        "glob": "4.0.6",
        -        "wordpress": "1.1.2"
        +        "assign-symbols": "^1.0.0",
        +        "is-extendable": "^1.0.1"
               },
               "dependencies": {
        -        "async": {
        -          "version": "0.9.2",
        -          "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
        -          "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
        +        "is-extendable": {
        +          "version": "1.0.1",
        +          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
        +          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
        +          "requires": {
        +            "is-plain-object": "^2.0.4"
        +          }
        +        }
        +      }
        +    },
        +    "extglob": {
        +      "version": "2.0.4",
        +      "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
        +      "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
        +      "requires": {
        +        "array-unique": "^0.3.2",
        +        "define-property": "^1.0.0",
        +        "expand-brackets": "^2.1.4",
        +        "extend-shallow": "^2.0.1",
        +        "fragment-cache": "^0.2.1",
        +        "regex-not": "^1.0.0",
        +        "snapdragon": "^0.8.1",
        +        "to-regex": "^3.0.1"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
        +          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
        +          "requires": {
        +            "is-descriptor": "^1.0.0"
        +          }
                 },
        -        "glob": {
        -          "version": "4.0.6",
        -          "resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz",
        -          "integrity": "sha1-aVxQvdTi+1xdNwsJHziNNwfikac=",
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
                   "requires": {
        -            "graceful-fs": "3.0.11",
        -            "inherits": "2.0.3",
        -            "minimatch": "1.0.0",
        -            "once": "1.4.0"
        +            "is-extendable": "^0.1.0"
                   }
                 },
        -        "graceful-fs": {
        -          "version": "3.0.11",
        -          "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz",
        -          "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
        +        "is-accessor-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
                   "requires": {
        -            "natives": "1.1.0"
        +            "kind-of": "^6.0.0"
                   }
                 },
        -        "minimatch": {
        +        "is-data-descriptor": {
                   "version": "1.0.0",
        -          "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz",
        -          "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=",
        +          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-descriptor": {
        +          "version": "1.0.2",
        +          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
        +          "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
                   "requires": {
        -            "lru-cache": "2.7.3",
        -            "sigmund": "1.0.1"
        +            "is-accessor-descriptor": "^1.0.0",
        +            "is-data-descriptor": "^1.0.0",
        +            "kind-of": "^6.0.2"
                   }
                 }
               }
             },
        -    "glob": {
        -      "version": "3.1.21",
        -      "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz",
        -      "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=",
        +    "fill-range": {
        +      "version": "4.0.0",
        +      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
        +      "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
               "requires": {
        -        "graceful-fs": "1.2.3",
        -        "inherits": "1.0.2",
        -        "minimatch": "0.2.14"
        +        "extend-shallow": "^2.0.1",
        +        "is-number": "^3.0.0",
        +        "repeat-string": "^1.6.1",
        +        "to-regex-range": "^2.1.0"
               },
               "dependencies": {
        -        "inherits": {
        -          "version": "1.0.2",
        -          "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz",
        -          "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js="
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
        +          "requires": {
        +            "is-extendable": "^0.1.0"
        +          }
                 }
               }
             },
        -    "graceful-fs": {
        -      "version": "1.2.3",
        -      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz",
        -      "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q="
        -    },
        -    "grunt": {
        -      "version": "0.4.5",
        -      "resolved": "https://registry.npmjs.org/grunt/-/grunt-0.4.5.tgz",
        -      "integrity": "sha1-VpN81RlDJK3/bSB2MYMqnWuk5/A=",
        -      "requires": {
        -        "async": "0.1.22",
        -        "coffee-script": "1.3.3",
        -        "colors": "0.6.2",
        -        "dateformat": "1.0.2-1.2.3",
        -        "eventemitter2": "0.4.14",
        -        "exit": "0.1.2",
        -        "findup-sync": "0.1.3",
        -        "getobject": "0.1.0",
        -        "glob": "3.1.21",
        -        "grunt-legacy-log": "0.1.3",
        -        "grunt-legacy-util": "0.2.0",
        -        "hooker": "0.2.3",
        -        "iconv-lite": "0.2.11",
        -        "js-yaml": "2.0.5",
        -        "lodash": "0.9.2",
        -        "minimatch": "0.2.14",
        -        "nopt": "1.0.10",
        -        "rimraf": "2.2.8",
        -        "underscore.string": "2.2.1",
        -        "which": "1.0.9"
        +    "find-up": {
        +      "version": "1.1.2",
        +      "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
        +      "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
        +      "requires": {
        +        "path-exists": "^2.0.0",
        +        "pinkie-promise": "^2.0.0"
               }
             },
        -    "grunt-check-modules": {
        -      "version": "1.0.0",
        -      "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.0.0.tgz",
        -      "integrity": "sha1-Y/9erkYTF5tKifaozTcfekAfd4I="
        -    },
        -    "grunt-cli": {
        -      "version": "1.1.0",
        -      "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.1.0.tgz",
        -      "integrity": "sha1-r9eWmTTd8zYg6ER+3B+pTlHlWjQ=",
        +    "findup-sync": {
        +      "version": "0.3.0",
        +      "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
        +      "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
               "requires": {
        -        "findup-sync": "0.3.0",
        -        "nopt": "3.0.6",
        -        "resolve": "1.1.7"
        +        "glob": "~5.0.0"
               },
               "dependencies": {
        -        "findup-sync": {
        -          "version": "0.3.0",
        -          "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz",
        -          "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=",
        -          "requires": {
        -            "glob": "5.0.15"
        -          }
        -        },
                 "glob": {
                   "version": "5.0.15",
                   "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
                   "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=",
                   "requires": {
        -            "inflight": "1.0.6",
        -            "inherits": "2.0.3",
        -            "minimatch": "3.0.4",
        -            "once": "1.4.0",
        -            "path-is-absolute": "1.0.1"
        -          }
        -        },
        -        "minimatch": {
        -          "version": "3.0.4",
        -          "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
        -          "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
        -          "requires": {
        -            "brace-expansion": "1.1.8"
        -          }
        -        },
        -        "nopt": {
        -          "version": "3.0.6",
        -          "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
        -          "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
        -          "requires": {
        -            "abbrev": "1.1.0"
        +            "inflight": "^1.0.4",
        +            "inherits": "2",
        +            "minimatch": "2 || 3",
        +            "once": "^1.3.0",
        +            "path-is-absolute": "^1.0.0"
                   }
                 }
               }
             },
        -    "grunt-jquery-content": {
        -      "version": "3.0.1",
        -      "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.0.1.tgz",
        -      "integrity": "sha1-aHdrx0G1SVEdaPBouVCsizd+g90=",
        +    "fined": {
        +      "version": "1.2.0",
        +      "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
        +      "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
               "requires": {
        -        "async": "0.9.0",
        -        "cheerio": "0.17.0",
        -        "grunt-check-modules": "1.0.0",
        -        "grunt-wordpress": "2.1.2",
        -        "he": "0.5.0",
        -        "highlight.js": "7.3.0",
        -        "marked": "0.3.2",
        -        "rimraf": "2.2.8",
        -        "spawnback": "1.0.0",
        -        "which": "1.0.5",
        -        "wordpress": "1.1.2"
        -      },
        -      "dependencies": {
        -        "async": {
        -          "version": "0.9.0",
        -          "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
        -          "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc="
        -        },
        -        "which": {
        -          "version": "1.0.5",
        -          "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz",
        -          "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk="
        -        }
        +        "expand-tilde": "^2.0.2",
        +        "is-plain-object": "^2.0.3",
        +        "object.defaults": "^1.1.0",
        +        "object.pick": "^1.2.0",
        +        "parse-filepath": "^1.0.1"
               }
             },
        -    "grunt-legacy-log": {
        -      "version": "0.1.3",
        -      "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz",
        -      "integrity": "sha1-7ClCboAwIa9ZAp+H0vnNczWgVTE=",
        -      "requires": {
        -        "colors": "0.6.2",
        -        "grunt-legacy-log-utils": "0.1.1",
        -        "hooker": "0.2.3",
        -        "lodash": "2.4.2",
        -        "underscore.string": "2.3.3"
        -      },
        -      "dependencies": {
        -        "lodash": {
        -          "version": "2.4.2",
        -          "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz",
        -          "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4="
        -        },
        -        "underscore.string": {
        -          "version": "2.3.3",
        -          "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz",
        -          "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0="
        -        }
        -      }
        +    "flagged-respawn": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
        +      "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q=="
             },
        -    "grunt-legacy-log-utils": {
        -      "version": "0.1.1",
        -      "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz",
        -      "integrity": "sha1-wHBrndkGThFvNvI/5OawSGcsD34=",
        +    "for-in": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
        +      "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA="
        +    },
        +    "for-own": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
        +      "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=",
               "requires": {
        -        "colors": "0.6.2",
        -        "lodash": "2.4.2",
        -        "underscore.string": "2.3.3"
        -      },
        -      "dependencies": {
        -        "lodash": {
        -          "version": "2.4.2",
        -          "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz",
        -          "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4="
        -        },
        -        "underscore.string": {
        -          "version": "2.3.3",
        -          "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz",
        -          "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0="
        -        }
        +        "for-in": "^1.0.1"
               }
             },
        -    "grunt-legacy-util": {
        -      "version": "0.2.0",
        -      "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz",
        -      "integrity": "sha1-kzJIhNv343qf98Am3/RR2UqeVUs=",
        +    "fragment-cache": {
        +      "version": "0.2.1",
        +      "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
        +      "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
               "requires": {
        -        "async": "0.1.22",
        -        "exit": "0.1.2",
        -        "getobject": "0.1.0",
        -        "hooker": "0.2.3",
        -        "lodash": "0.9.2",
        -        "underscore.string": "2.2.1",
        -        "which": "1.0.9"
        +        "map-cache": "^0.2.2"
        +      }
        +    },
        +    "fs.realpath": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
        +      "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
        +    },
        +    "get-stdin": {
        +      "version": "4.0.1",
        +      "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
        +      "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4="
        +    },
        +    "get-value": {
        +      "version": "2.0.6",
        +      "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
        +      "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg="
        +    },
        +    "getobject": {
        +      "version": "0.1.0",
        +      "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz",
        +      "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw="
        +    },
        +    "gilded-wordpress": {
        +      "version": "1.0.5",
        +      "resolved": "https://registry.npmjs.org/gilded-wordpress/-/gilded-wordpress-1.0.5.tgz",
        +      "integrity": "sha1-EnBg4iv/x6uo+++Xq/Pr+7fsScE=",
        +      "requires": {
        +        "async": "^0.9.0",
        +        "glob": "^4.0.6",
        +        "wordpress": "^1.1.2"
        +      },
        +      "dependencies": {
        +        "async": {
        +          "version": "0.9.2",
        +          "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
        +          "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
        +        },
        +        "glob": {
        +          "version": "4.5.3",
        +          "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz",
        +          "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=",
        +          "requires": {
        +            "inflight": "^1.0.4",
        +            "inherits": "2",
        +            "minimatch": "^2.0.1",
        +            "once": "^1.3.0"
        +          }
        +        },
        +        "minimatch": {
        +          "version": "2.0.10",
        +          "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
        +          "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=",
        +          "requires": {
        +            "brace-expansion": "^1.0.0"
        +          }
        +        }
        +      }
        +    },
        +    "glob": {
        +      "version": "7.0.6",
        +      "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz",
        +      "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=",
        +      "requires": {
        +        "fs.realpath": "^1.0.0",
        +        "inflight": "^1.0.4",
        +        "inherits": "2",
        +        "minimatch": "^3.0.2",
        +        "once": "^1.3.0",
        +        "path-is-absolute": "^1.0.0"
        +      }
        +    },
        +    "global-modules": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
        +      "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
        +      "requires": {
        +        "global-prefix": "^1.0.1",
        +        "is-windows": "^1.0.1",
        +        "resolve-dir": "^1.0.0"
        +      }
        +    },
        +    "global-prefix": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
        +      "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
        +      "requires": {
        +        "expand-tilde": "^2.0.2",
        +        "homedir-polyfill": "^1.0.1",
        +        "ini": "^1.3.4",
        +        "is-windows": "^1.0.1",
        +        "which": "^1.2.14"
        +      }
        +    },
        +    "graceful-fs": {
        +      "version": "4.2.2",
        +      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
        +      "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q=="
        +    },
        +    "grunt": {
        +      "version": "1.0.4",
        +      "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.4.tgz",
        +      "integrity": "sha512-PYsMOrOC+MsdGEkFVwMaMyc6Ob7pKmq+deg1Sjr+vvMWp35sztfwKE7qoN51V+UEtHsyNuMcGdgMLFkBHvMxHQ==",
        +      "requires": {
        +        "coffeescript": "~1.10.0",
        +        "dateformat": "~1.0.12",
        +        "eventemitter2": "~0.4.13",
        +        "exit": "~0.1.1",
        +        "findup-sync": "~0.3.0",
        +        "glob": "~7.0.0",
        +        "grunt-cli": "~1.2.0",
        +        "grunt-known-options": "~1.1.0",
        +        "grunt-legacy-log": "~2.0.0",
        +        "grunt-legacy-util": "~1.1.1",
        +        "iconv-lite": "~0.4.13",
        +        "js-yaml": "~3.13.0",
        +        "minimatch": "~3.0.2",
        +        "mkdirp": "~0.5.1",
        +        "nopt": "~3.0.6",
        +        "path-is-absolute": "~1.0.0",
        +        "rimraf": "~2.6.2"
        +      },
        +      "dependencies": {
        +        "grunt-cli": {
        +          "version": "1.2.0",
        +          "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz",
        +          "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=",
        +          "requires": {
        +            "findup-sync": "~0.3.0",
        +            "grunt-known-options": "~1.1.0",
        +            "nopt": "~3.0.6",
        +            "resolve": "~1.1.0"
        +          }
        +        },
        +        "resolve": {
        +          "version": "1.1.7",
        +          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
        +          "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs="
        +        }
        +      }
        +    },
        +    "grunt-check-modules": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/grunt-check-modules/-/grunt-check-modules-1.1.0.tgz",
        +      "integrity": "sha1-fBZB28ZlSGdqbVl5Ga35C3s11kQ="
        +    },
        +    "grunt-cli": {
        +      "version": "1.3.2",
        +      "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz",
        +      "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==",
        +      "requires": {
        +        "grunt-known-options": "~1.1.0",
        +        "interpret": "~1.1.0",
        +        "liftoff": "~2.5.0",
        +        "nopt": "~4.0.1",
        +        "v8flags": "~3.1.1"
        +      },
        +      "dependencies": {
        +        "nopt": {
        +          "version": "4.0.1",
        +          "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
        +          "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
        +          "requires": {
        +            "abbrev": "1",
        +            "osenv": "^0.1.4"
        +          }
        +        }
        +      }
        +    },
        +    "grunt-jquery-content": {
        +      "version": "3.0.3",
        +      "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.0.3.tgz",
        +      "integrity": "sha1-sqFpjFTz6QZyO3cPuuRJ/ZIRXqM=",
        +      "requires": {
        +        "async": "0.9.0",
        +        "cheerio": "0.17.0",
        +        "grunt-check-modules": "1.1.0",
        +        "grunt-wordpress": "2.1.3",
        +        "he": "0.5.0",
        +        "highlight.js": "7.3.0",
        +        "marked": "0.3.2",
        +        "rimraf": "2.2.8",
        +        "spawnback": "1.0.0",
        +        "which": "1.0.5",
        +        "wordpress": "1.3.0"
        +      },
        +      "dependencies": {
        +        "async": {
        +          "version": "0.9.0",
        +          "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
        +          "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc="
        +        },
        +        "rimraf": {
        +          "version": "2.2.8",
        +          "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
        +          "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI="
        +        },
        +        "which": {
        +          "version": "1.0.5",
        +          "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz",
        +          "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk="
        +        }
        +      }
        +    },
        +    "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": "2.0.0",
        +      "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz",
        +      "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==",
        +      "requires": {
        +        "colors": "~1.1.2",
        +        "grunt-legacy-log-utils": "~2.0.0",
        +        "hooker": "~0.2.3",
        +        "lodash": "~4.17.5"
        +      }
        +    },
        +    "grunt-legacy-log-utils": {
        +      "version": "2.0.1",
        +      "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz",
        +      "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==",
        +      "requires": {
        +        "chalk": "~2.4.1",
        +        "lodash": "~4.17.10"
        +      }
        +    },
        +    "grunt-legacy-util": {
        +      "version": "1.1.1",
        +      "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz",
        +      "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==",
        +      "requires": {
        +        "async": "~1.5.2",
        +        "exit": "~0.1.1",
        +        "getobject": "~0.1.0",
        +        "hooker": "~0.2.3",
        +        "lodash": "~4.17.10",
        +        "underscore.string": "~3.3.4",
        +        "which": "~1.3.0"
               }
             },
             "grunt-wordpress": {
        -      "version": "2.1.2",
        -      "resolved": "https://registry.npmjs.org/grunt-wordpress/-/grunt-wordpress-2.1.2.tgz",
        -      "integrity": "sha1-ue3Lv5jp6HM9F6gsMmWf2zbO2LE=",
        +      "version": "2.1.3",
        +      "resolved": "https://registry.npmjs.org/grunt-wordpress/-/grunt-wordpress-2.1.3.tgz",
        +      "integrity": "sha1-fNI9lBN9DDe+PybfZ4Y2FPUABXA=",
        +      "requires": {
        +        "gilded-wordpress": "1.0.5"
        +      }
        +    },
        +    "has-flag": {
        +      "version": "3.0.0",
        +      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
        +      "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
        +    },
        +    "has-value": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
        +      "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
               "requires": {
        -        "gilded-wordpress": "1.0.3"
        +        "get-value": "^2.0.6",
        +        "has-values": "^1.0.0",
        +        "isobject": "^3.0.0"
        +      }
        +    },
        +    "has-values": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
        +      "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
        +      "requires": {
        +        "is-number": "^3.0.0",
        +        "kind-of": "^4.0.0"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "4.0.0",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
        +          "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
               }
             },
             "he": {
        @@ -453,21 +971,34 @@
               "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.3.0.tgz",
               "integrity": "sha1-bF8PZOcHj2ZAK82/yJEQw/0bqZ8="
             },
        +    "homedir-polyfill": {
        +      "version": "1.0.3",
        +      "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
        +      "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
        +      "requires": {
        +        "parse-passwd": "^1.0.0"
        +      }
        +    },
             "hooker": {
               "version": "0.2.3",
               "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
               "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk="
             },
        +    "hosted-git-info": {
        +      "version": "2.8.4",
        +      "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz",
        +      "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ=="
        +    },
             "htmlparser2": {
               "version": "3.7.3",
               "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz",
               "integrity": "sha1-amTHdjfAjG8w7CqBV6UzM758sF4=",
               "requires": {
        -        "domelementtype": "1.3.0",
        -        "domhandler": "2.2.1",
        -        "domutils": "1.5.1",
        -        "entities": "1.0.0",
        -        "readable-stream": "1.1.14"
        +        "domelementtype": "1",
        +        "domhandler": "2.2",
        +        "domutils": "1.5",
        +        "entities": "1.0",
        +        "readable-stream": "1.1"
               },
               "dependencies": {
                 "domutils": {
        @@ -475,8 +1006,8 @@
                   "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
                   "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
                   "requires": {
        -            "dom-serializer": "0.0.1",
        -            "domelementtype": "1.3.0"
        +            "dom-serializer": "0",
        +            "domelementtype": "1"
                   }
                 },
                 "entities": {
        @@ -487,179 +1018,1190 @@
               }
             },
             "iconv-lite": {
        -      "version": "0.2.11",
        -      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz",
        -      "integrity": "sha1-HOYKOleGSiktEyH/RgnKS7llrcg="
        +      "version": "0.4.24",
        +      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
        +      "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
        +      "requires": {
        +        "safer-buffer": ">= 2.1.2 < 3"
        +      }
        +    },
        +    "indent-string": {
        +      "version": "2.1.0",
        +      "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
        +      "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
        +      "requires": {
        +        "repeating": "^2.0.0"
        +      }
             },
             "inflight": {
               "version": "1.0.6",
               "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
               "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
               "requires": {
        -        "once": "1.4.0",
        -        "wrappy": "1.0.2"
        +        "once": "^1.3.0",
        +        "wrappy": "1"
               }
             },
             "inherits": {
        -      "version": "2.0.3",
        -      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
        -      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
        +      "version": "2.0.4",
        +      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
        +      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
             },
        -    "isarray": {
        -      "version": "0.0.1",
        -      "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
        -      "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
        +    "ini": {
        +      "version": "1.3.5",
        +      "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
        +      "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
             },
        -    "js-yaml": {
        -      "version": "2.0.5",
        -      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz",
        -      "integrity": "sha1-olrmUJmZ6X3yeMZxnaEb0Gh3Q6g=",
        +    "interpret": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
        +      "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ="
        +    },
        +    "is-absolute": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
        +      "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
               "requires": {
        -        "argparse": "0.1.16",
        -        "esprima": "1.0.4"
        +        "is-relative": "^1.0.0",
        +        "is-windows": "^1.0.1"
               }
             },
        -    "lodash": {
        -      "version": "0.9.2",
        -      "resolved": "https://registry.npmjs.org/lodash/-/lodash-0.9.2.tgz",
        -      "integrity": "sha1-jzSZxSRdNG1oLlsNO0B2fgnxqSw="
        +    "is-accessor-descriptor": {
        +      "version": "0.1.6",
        +      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
        +      "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
        +      "requires": {
        +        "kind-of": "^3.0.2"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
        +      }
             },
        -    "lru-cache": {
        -      "version": "2.7.3",
        -      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
        -      "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI="
        +    "is-arrayish": {
        +      "version": "0.2.1",
        +      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
        +      "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
             },
        -    "marked": {
        -      "version": "0.3.2",
        -      "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz",
        -      "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk="
        +    "is-buffer": {
        +      "version": "1.1.6",
        +      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
        +      "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
             },
        -    "minimatch": {
        -      "version": "0.2.14",
        -      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
        -      "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=",
        +    "is-data-descriptor": {
        +      "version": "0.1.4",
        +      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
        +      "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
               "requires": {
        -        "lru-cache": "2.7.3",
        -        "sigmund": "1.0.1"
        +        "kind-of": "^3.0.2"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
               }
             },
        -    "natives": {
        -      "version": "1.1.0",
        -      "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz",
        -      "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE="
        +    "is-descriptor": {
        +      "version": "0.1.6",
        +      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
        +      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
        +      "requires": {
        +        "is-accessor-descriptor": "^0.1.6",
        +        "is-data-descriptor": "^0.1.4",
        +        "kind-of": "^5.0.0"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "5.1.0",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
        +          "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw=="
        +        }
        +      }
             },
        -    "nopt": {
        -      "version": "1.0.10",
        -      "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
        -      "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=",
        +    "is-extendable": {
        +      "version": "0.1.1",
        +      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
        +      "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik="
        +    },
        +    "is-extglob": {
        +      "version": "2.1.1",
        +      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
        +      "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
        +    },
        +    "is-finite": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
        +      "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
               "requires": {
        -        "abbrev": "1.1.0"
        +        "number-is-nan": "^1.0.0"
               }
             },
        -    "once": {
        -      "version": "1.4.0",
        -      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
        -      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
        +    "is-glob": {
        +      "version": "3.1.0",
        +      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
        +      "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
               "requires": {
        -        "wrappy": "1.0.2"
        +        "is-extglob": "^2.1.0"
               }
             },
        -    "path-is-absolute": {
        -      "version": "1.0.1",
        -      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
        -      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
        +    "is-number": {
        +      "version": "3.0.0",
        +      "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
        +      "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
        +      "requires": {
        +        "kind-of": "^3.0.2"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
        +      }
             },
        -    "readable-stream": {
        -      "version": "1.1.14",
        -      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
        -      "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
        +    "is-plain-object": {
        +      "version": "2.0.4",
        +      "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
        +      "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
               "requires": {
        -        "core-util-is": "1.0.2",
        -        "inherits": "2.0.3",
        -        "isarray": "0.0.1",
        -        "string_decoder": "0.10.31"
        +        "isobject": "^3.0.1"
               }
             },
        -    "resolve": {
        -      "version": "1.1.7",
        -      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
        -      "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs="
        +    "is-relative": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
        +      "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
        +      "requires": {
        +        "is-unc-path": "^1.0.0"
        +      }
             },
        -    "rimraf": {
        -      "version": "2.2.8",
        -      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
        -      "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI="
        +    "is-unc-path": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
        +      "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
        +      "requires": {
        +        "unc-path-regex": "^0.1.2"
        +      }
             },
        -    "sax": {
        -      "version": "0.6.1",
        -      "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz",
        -      "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk="
        +    "is-utf8": {
        +      "version": "0.2.1",
        +      "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
        +      "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
             },
        -    "sigmund": {
        -      "version": "1.0.1",
        -      "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
        -      "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA="
        +    "is-windows": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
        +      "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA=="
             },
        -    "spawnback": {
        +    "isarray": {
               "version": "1.0.0",
        -      "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz",
        -      "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8="
        -    },
        -    "string_decoder": {
        -      "version": "0.10.31",
        -      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
        -      "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
        -    },
        -    "underscore": {
        -      "version": "1.7.0",
        -      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz",
        -      "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk="
        +      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
        +      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
             },
        -    "underscore.string": {
        -      "version": "2.2.1",
        -      "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz",
        -      "integrity": "sha1-18D6KvXVoaZ/QlPa7pgTLnM/Dxk="
        +    "isexe": {
        +      "version": "2.0.0",
        +      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
        +      "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
             },
        -    "which": {
        -      "version": "1.0.9",
        -      "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz",
        -      "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8="
        +    "isobject": {
        +      "version": "3.0.1",
        +      "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
        +      "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8="
             },
        -    "wordpress": {
        -      "version": "1.1.2",
        -      "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.1.2.tgz",
        -      "integrity": "sha1-uDZhhSBVSXESG8VsQ7A5yzgg94M=",
        +    "js-yaml": {
        +      "version": "3.13.1",
        +      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
        +      "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
               "requires": {
        -        "xmlrpc": "1.3.1"
        +        "argparse": "^1.0.7",
        +        "esprima": "^4.0.0"
               }
             },
        -    "wrappy": {
        -      "version": "1.0.2",
        -      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
        -      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
        +    "kind-of": {
        +      "version": "6.0.2",
        +      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
        +      "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA=="
             },
        -    "xmlbuilder": {
        -      "version": "2.6.5",
        -      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-2.6.5.tgz",
        -      "integrity": "sha1-b/etYPty0idk8AehZLd/K/FABSY=",
        +    "liftoff": {
        +      "version": "2.5.0",
        +      "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz",
        +      "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=",
               "requires": {
        -        "lodash": "3.10.1"
        +        "extend": "^3.0.0",
        +        "findup-sync": "^2.0.0",
        +        "fined": "^1.0.1",
        +        "flagged-respawn": "^1.0.0",
        +        "is-plain-object": "^2.0.4",
        +        "object.map": "^1.0.0",
        +        "rechoir": "^0.6.2",
        +        "resolve": "^1.1.7"
               },
               "dependencies": {
        -        "lodash": {
        -          "version": "3.10.1",
        -          "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
        -          "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y="
        +        "findup-sync": {
        +          "version": "2.0.0",
        +          "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz",
        +          "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=",
        +          "requires": {
        +            "detect-file": "^1.0.0",
        +            "is-glob": "^3.1.0",
        +            "micromatch": "^3.0.4",
        +            "resolve-dir": "^1.0.1"
        +          }
                 }
               }
             },
        -    "xmlrpc": {
        -      "version": "1.3.1",
        -      "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.1.tgz",
        -      "integrity": "sha1-OqWCCG/vUwz+Hc2qDEyd3F0ORFE=",
        +    "load-json-file": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
        +      "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
        +      "requires": {
        +        "graceful-fs": "^4.1.2",
        +        "parse-json": "^2.2.0",
        +        "pify": "^2.0.0",
        +        "pinkie-promise": "^2.0.0",
        +        "strip-bom": "^2.0.0"
        +      }
        +    },
        +    "lodash": {
        +      "version": "4.17.15",
        +      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
        +      "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
        +    },
        +    "loud-rejection": {
        +      "version": "1.6.0",
        +      "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
        +      "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
        +      "requires": {
        +        "currently-unhandled": "^0.4.1",
        +        "signal-exit": "^3.0.0"
        +      }
        +    },
        +    "make-iterator": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
        +      "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
        +      "requires": {
        +        "kind-of": "^6.0.2"
        +      }
        +    },
        +    "map-cache": {
        +      "version": "0.2.2",
        +      "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
        +      "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8="
        +    },
        +    "map-obj": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
        +      "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0="
        +    },
        +    "map-visit": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
        +      "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
        +      "requires": {
        +        "object-visit": "^1.0.0"
        +      }
        +    },
        +    "marked": {
        +      "version": "0.3.2",
        +      "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz",
        +      "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk="
        +    },
        +    "meow": {
        +      "version": "3.7.0",
        +      "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
        +      "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
        +      "requires": {
        +        "camelcase-keys": "^2.0.0",
        +        "decamelize": "^1.1.2",
        +        "loud-rejection": "^1.0.0",
        +        "map-obj": "^1.0.1",
        +        "minimist": "^1.1.3",
        +        "normalize-package-data": "^2.3.4",
        +        "object-assign": "^4.0.1",
        +        "read-pkg-up": "^1.0.1",
        +        "redent": "^1.0.0",
        +        "trim-newlines": "^1.0.0"
        +      }
        +    },
        +    "micromatch": {
        +      "version": "3.1.10",
        +      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
        +      "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
        +      "requires": {
        +        "arr-diff": "^4.0.0",
        +        "array-unique": "^0.3.2",
        +        "braces": "^2.3.1",
        +        "define-property": "^2.0.2",
        +        "extend-shallow": "^3.0.2",
        +        "extglob": "^2.0.4",
        +        "fragment-cache": "^0.2.1",
        +        "kind-of": "^6.0.2",
        +        "nanomatch": "^1.2.9",
        +        "object.pick": "^1.3.0",
        +        "regex-not": "^1.0.0",
        +        "snapdragon": "^0.8.1",
        +        "to-regex": "^3.0.2"
        +      }
        +    },
        +    "minimatch": {
        +      "version": "3.0.4",
        +      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
        +      "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
        +      "requires": {
        +        "brace-expansion": "^1.1.7"
        +      }
        +    },
        +    "minimist": {
        +      "version": "1.2.0",
        +      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
        +      "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
        +    },
        +    "mixin-deep": {
        +      "version": "1.3.2",
        +      "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
        +      "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
        +      "requires": {
        +        "for-in": "^1.0.2",
        +        "is-extendable": "^1.0.1"
        +      },
        +      "dependencies": {
        +        "is-extendable": {
        +          "version": "1.0.1",
        +          "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
        +          "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
        +          "requires": {
        +            "is-plain-object": "^2.0.4"
        +          }
        +        }
        +      }
        +    },
        +    "mkdirp": {
        +      "version": "0.5.1",
        +      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
        +      "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
        +      "requires": {
        +        "minimist": "0.0.8"
        +      },
        +      "dependencies": {
        +        "minimist": {
        +          "version": "0.0.8",
        +          "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
        +          "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
        +        }
        +      }
        +    },
        +    "ms": {
        +      "version": "2.0.0",
        +      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
        +      "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
        +    },
        +    "nanomatch": {
        +      "version": "1.2.13",
        +      "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
        +      "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
        +      "requires": {
        +        "arr-diff": "^4.0.0",
        +        "array-unique": "^0.3.2",
        +        "define-property": "^2.0.2",
        +        "extend-shallow": "^3.0.2",
        +        "fragment-cache": "^0.2.1",
        +        "is-windows": "^1.0.2",
        +        "kind-of": "^6.0.2",
        +        "object.pick": "^1.3.0",
        +        "regex-not": "^1.0.0",
        +        "snapdragon": "^0.8.1",
        +        "to-regex": "^3.0.1"
        +      }
        +    },
        +    "nopt": {
        +      "version": "3.0.6",
        +      "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
        +      "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
        +      "requires": {
        +        "abbrev": "1"
        +      }
        +    },
        +    "normalize-package-data": {
        +      "version": "2.5.0",
        +      "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
        +      "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
        +      "requires": {
        +        "hosted-git-info": "^2.1.4",
        +        "resolve": "^1.10.0",
        +        "semver": "2 || 3 || 4 || 5",
        +        "validate-npm-package-license": "^3.0.1"
        +      }
        +    },
        +    "number-is-nan": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
        +      "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
        +    },
        +    "object-assign": {
        +      "version": "4.1.1",
        +      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
        +      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
        +    },
        +    "object-copy": {
        +      "version": "0.1.0",
        +      "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
        +      "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
        +      "requires": {
        +        "copy-descriptor": "^0.1.0",
        +        "define-property": "^0.2.5",
        +        "kind-of": "^3.0.3"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "0.2.5",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
        +          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
        +          "requires": {
        +            "is-descriptor": "^0.1.0"
        +          }
        +        },
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
        +      }
        +    },
        +    "object-visit": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
        +      "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
        +      "requires": {
        +        "isobject": "^3.0.0"
        +      }
        +    },
        +    "object.defaults": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
        +      "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=",
        +      "requires": {
        +        "array-each": "^1.0.1",
        +        "array-slice": "^1.0.0",
        +        "for-own": "^1.0.0",
        +        "isobject": "^3.0.0"
        +      }
        +    },
        +    "object.map": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
        +      "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=",
        +      "requires": {
        +        "for-own": "^1.0.0",
        +        "make-iterator": "^1.0.0"
        +      }
        +    },
        +    "object.pick": {
        +      "version": "1.3.0",
        +      "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
        +      "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
        +      "requires": {
        +        "isobject": "^3.0.1"
        +      }
        +    },
        +    "once": {
        +      "version": "1.4.0",
        +      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
        +      "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
        +      "requires": {
        +        "wrappy": "1"
        +      }
        +    },
        +    "os-homedir": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
        +      "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
        +    },
        +    "os-tmpdir": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
        +      "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
        +    },
        +    "osenv": {
        +      "version": "0.1.5",
        +      "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
        +      "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
        +      "requires": {
        +        "os-homedir": "^1.0.0",
        +        "os-tmpdir": "^1.0.0"
        +      }
        +    },
        +    "parse-filepath": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
        +      "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=",
        +      "requires": {
        +        "is-absolute": "^1.0.0",
        +        "map-cache": "^0.2.0",
        +        "path-root": "^0.1.1"
        +      }
        +    },
        +    "parse-json": {
        +      "version": "2.2.0",
        +      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
        +      "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
        +      "requires": {
        +        "error-ex": "^1.2.0"
        +      }
        +    },
        +    "parse-passwd": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
        +      "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY="
        +    },
        +    "pascalcase": {
        +      "version": "0.1.1",
        +      "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
        +      "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ="
        +    },
        +    "path-exists": {
        +      "version": "2.1.0",
        +      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
        +      "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
        +      "requires": {
        +        "pinkie-promise": "^2.0.0"
        +      }
        +    },
        +    "path-is-absolute": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
        +      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
        +    },
        +    "path-parse": {
        +      "version": "1.0.6",
        +      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
        +      "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
        +    },
        +    "path-root": {
        +      "version": "0.1.1",
        +      "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
        +      "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=",
        +      "requires": {
        +        "path-root-regex": "^0.1.0"
        +      }
        +    },
        +    "path-root-regex": {
        +      "version": "0.1.2",
        +      "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
        +      "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0="
        +    },
        +    "path-type": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
        +      "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
        +      "requires": {
        +        "graceful-fs": "^4.1.2",
        +        "pify": "^2.0.0",
        +        "pinkie-promise": "^2.0.0"
        +      }
        +    },
        +    "pify": {
        +      "version": "2.3.0",
        +      "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
        +      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
        +    },
        +    "pinkie": {
        +      "version": "2.0.4",
        +      "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
        +      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
        +    },
        +    "pinkie-promise": {
        +      "version": "2.0.1",
        +      "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
        +      "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
        +      "requires": {
        +        "pinkie": "^2.0.0"
        +      }
        +    },
        +    "posix-character-classes": {
        +      "version": "0.1.1",
        +      "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
        +      "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs="
        +    },
        +    "read-pkg": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
        +      "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
        +      "requires": {
        +        "load-json-file": "^1.0.0",
        +        "normalize-package-data": "^2.3.2",
        +        "path-type": "^1.0.0"
        +      }
        +    },
        +    "read-pkg-up": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
        +      "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
        +      "requires": {
        +        "find-up": "^1.0.0",
        +        "read-pkg": "^1.0.0"
        +      }
        +    },
        +    "readable-stream": {
        +      "version": "1.1.14",
        +      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
        +      "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
        +      "requires": {
        +        "core-util-is": "~1.0.0",
        +        "inherits": "~2.0.1",
        +        "isarray": "0.0.1",
        +        "string_decoder": "~0.10.x"
        +      },
        +      "dependencies": {
        +        "isarray": {
        +          "version": "0.0.1",
        +          "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
        +          "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
        +        }
        +      }
        +    },
        +    "rechoir": {
        +      "version": "0.6.2",
        +      "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
        +      "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
        +      "requires": {
        +        "resolve": "^1.1.6"
        +      }
        +    },
        +    "redent": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
        +      "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
        +      "requires": {
        +        "indent-string": "^2.1.0",
        +        "strip-indent": "^1.0.1"
        +      }
        +    },
        +    "regex-not": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
        +      "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
        +      "requires": {
        +        "extend-shallow": "^3.0.2",
        +        "safe-regex": "^1.1.0"
        +      }
        +    },
        +    "repeat-element": {
        +      "version": "1.1.3",
        +      "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
        +      "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g=="
        +    },
        +    "repeat-string": {
        +      "version": "1.6.1",
        +      "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
        +      "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
        +    },
        +    "repeating": {
        +      "version": "2.0.1",
        +      "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
        +      "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
        +      "requires": {
        +        "is-finite": "^1.0.0"
        +      }
        +    },
        +    "resolve": {
        +      "version": "1.12.0",
        +      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
        +      "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
        +      "requires": {
        +        "path-parse": "^1.0.6"
        +      }
        +    },
        +    "resolve-dir": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
        +      "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=",
        +      "requires": {
        +        "expand-tilde": "^2.0.0",
        +        "global-modules": "^1.0.0"
        +      }
        +    },
        +    "resolve-url": {
        +      "version": "0.2.1",
        +      "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
        +      "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo="
        +    },
        +    "ret": {
        +      "version": "0.1.15",
        +      "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
        +      "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
        +    },
        +    "rimraf": {
        +      "version": "2.6.3",
        +      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
        +      "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
        +      "requires": {
        +        "glob": "^7.1.3"
        +      },
        +      "dependencies": {
        +        "glob": {
        +          "version": "7.1.4",
        +          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
        +          "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
        +          "requires": {
        +            "fs.realpath": "^1.0.0",
        +            "inflight": "^1.0.4",
        +            "inherits": "2",
        +            "minimatch": "^3.0.4",
        +            "once": "^1.3.0",
        +            "path-is-absolute": "^1.0.0"
        +          }
        +        }
        +      }
        +    },
        +    "safe-regex": {
        +      "version": "1.1.0",
        +      "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
        +      "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
        +      "requires": {
        +        "ret": "~0.1.10"
        +      }
        +    },
        +    "safer-buffer": {
        +      "version": "2.1.2",
        +      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
        +      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
        +    },
        +    "sax": {
        +      "version": "1.2.4",
        +      "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
        +      "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
        +    },
        +    "semver": {
        +      "version": "5.7.1",
        +      "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
        +      "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
        +    },
        +    "set-value": {
        +      "version": "2.0.1",
        +      "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
        +      "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
        +      "requires": {
        +        "extend-shallow": "^2.0.1",
        +        "is-extendable": "^0.1.1",
        +        "is-plain-object": "^2.0.3",
        +        "split-string": "^3.0.1"
        +      },
        +      "dependencies": {
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
        +          "requires": {
        +            "is-extendable": "^0.1.0"
        +          }
        +        }
        +      }
        +    },
        +    "signal-exit": {
        +      "version": "3.0.2",
        +      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
        +      "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
        +    },
        +    "snapdragon": {
        +      "version": "0.8.2",
        +      "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
        +      "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
        +      "requires": {
        +        "base": "^0.11.1",
        +        "debug": "^2.2.0",
        +        "define-property": "^0.2.5",
        +        "extend-shallow": "^2.0.1",
        +        "map-cache": "^0.2.2",
        +        "source-map": "^0.5.6",
        +        "source-map-resolve": "^0.5.0",
        +        "use": "^3.1.0"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "0.2.5",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
        +          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
        +          "requires": {
        +            "is-descriptor": "^0.1.0"
        +          }
        +        },
        +        "extend-shallow": {
        +          "version": "2.0.1",
        +          "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
        +          "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
        +          "requires": {
        +            "is-extendable": "^0.1.0"
        +          }
        +        }
        +      }
        +    },
        +    "snapdragon-node": {
        +      "version": "2.1.1",
        +      "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
        +      "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
        +      "requires": {
        +        "define-property": "^1.0.0",
        +        "isobject": "^3.0.0",
        +        "snapdragon-util": "^3.0.1"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
        +          "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
        +          "requires": {
        +            "is-descriptor": "^1.0.0"
        +          }
        +        },
        +        "is-accessor-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-data-descriptor": {
        +          "version": "1.0.0",
        +          "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
        +          "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
        +          "requires": {
        +            "kind-of": "^6.0.0"
        +          }
        +        },
        +        "is-descriptor": {
        +          "version": "1.0.2",
        +          "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
        +          "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
        +          "requires": {
        +            "is-accessor-descriptor": "^1.0.0",
        +            "is-data-descriptor": "^1.0.0",
        +            "kind-of": "^6.0.2"
        +          }
        +        }
        +      }
        +    },
        +    "snapdragon-util": {
        +      "version": "3.0.1",
        +      "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
        +      "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
        +      "requires": {
        +        "kind-of": "^3.2.0"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
        +      }
        +    },
        +    "source-map": {
        +      "version": "0.5.7",
        +      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
        +      "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
        +    },
        +    "source-map-resolve": {
        +      "version": "0.5.2",
        +      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz",
        +      "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==",
        +      "requires": {
        +        "atob": "^2.1.1",
        +        "decode-uri-component": "^0.2.0",
        +        "resolve-url": "^0.2.1",
        +        "source-map-url": "^0.4.0",
        +        "urix": "^0.1.0"
        +      }
        +    },
        +    "source-map-url": {
        +      "version": "0.4.0",
        +      "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
        +      "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
        +    },
        +    "spawnback": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz",
        +      "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8="
        +    },
        +    "spdx-correct": {
        +      "version": "3.1.0",
        +      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
        +      "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
        +      "requires": {
        +        "spdx-expression-parse": "^3.0.0",
        +        "spdx-license-ids": "^3.0.0"
        +      }
        +    },
        +    "spdx-exceptions": {
        +      "version": "2.2.0",
        +      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
        +      "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA=="
        +    },
        +    "spdx-expression-parse": {
        +      "version": "3.0.0",
        +      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
        +      "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
        +      "requires": {
        +        "spdx-exceptions": "^2.1.0",
        +        "spdx-license-ids": "^3.0.0"
        +      }
        +    },
        +    "spdx-license-ids": {
        +      "version": "3.0.5",
        +      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz",
        +      "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q=="
        +    },
        +    "split-string": {
        +      "version": "3.1.0",
        +      "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
        +      "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
        +      "requires": {
        +        "extend-shallow": "^3.0.0"
        +      }
        +    },
        +    "sprintf-js": {
        +      "version": "1.1.2",
        +      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
        +      "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
        +    },
        +    "static-extend": {
        +      "version": "0.1.2",
        +      "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
        +      "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
        +      "requires": {
        +        "define-property": "^0.2.5",
        +        "object-copy": "^0.1.0"
        +      },
        +      "dependencies": {
        +        "define-property": {
        +          "version": "0.2.5",
        +          "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
        +          "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
        +          "requires": {
        +            "is-descriptor": "^0.1.0"
        +          }
        +        }
        +      }
        +    },
        +    "string_decoder": {
        +      "version": "0.10.31",
        +      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
        +      "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
        +    },
        +    "strip-bom": {
        +      "version": "2.0.0",
        +      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
        +      "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
        +      "requires": {
        +        "is-utf8": "^0.2.0"
        +      }
        +    },
        +    "strip-indent": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
        +      "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
        +      "requires": {
        +        "get-stdin": "^4.0.1"
        +      }
        +    },
        +    "supports-color": {
        +      "version": "5.5.0",
        +      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
        +      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
        +      "requires": {
        +        "has-flag": "^3.0.0"
        +      }
        +    },
        +    "to-object-path": {
        +      "version": "0.3.0",
        +      "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
        +      "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
        +      "requires": {
        +        "kind-of": "^3.0.2"
        +      },
        +      "dependencies": {
        +        "kind-of": {
        +          "version": "3.2.2",
        +          "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
        +          "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
        +          "requires": {
        +            "is-buffer": "^1.1.5"
        +          }
        +        }
        +      }
        +    },
        +    "to-regex": {
        +      "version": "3.0.2",
        +      "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
        +      "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
        +      "requires": {
        +        "define-property": "^2.0.2",
        +        "extend-shallow": "^3.0.2",
        +        "regex-not": "^1.0.2",
        +        "safe-regex": "^1.1.0"
        +      }
        +    },
        +    "to-regex-range": {
        +      "version": "2.1.1",
        +      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
        +      "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
        +      "requires": {
        +        "is-number": "^3.0.0",
        +        "repeat-string": "^1.6.1"
        +      }
        +    },
        +    "trim-newlines": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
        +      "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM="
        +    },
        +    "unc-path-regex": {
        +      "version": "0.1.2",
        +      "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
        +      "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==",
        +      "requires": {
        +        "sprintf-js": "^1.0.3",
        +        "util-deprecate": "^1.0.2"
        +      }
        +    },
        +    "union-value": {
        +      "version": "1.0.1",
        +      "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
        +      "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
        +      "requires": {
        +        "arr-union": "^3.1.0",
        +        "get-value": "^2.0.6",
        +        "is-extendable": "^0.1.1",
        +        "set-value": "^2.0.1"
        +      }
        +    },
        +    "unset-value": {
        +      "version": "1.0.0",
        +      "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
        +      "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
        +      "requires": {
        +        "has-value": "^0.3.1",
        +        "isobject": "^3.0.0"
        +      },
        +      "dependencies": {
        +        "has-value": {
        +          "version": "0.3.1",
        +          "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
        +          "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
        +          "requires": {
        +            "get-value": "^2.0.3",
        +            "has-values": "^0.1.4",
        +            "isobject": "^2.0.0"
        +          },
        +          "dependencies": {
        +            "isobject": {
        +              "version": "2.1.0",
        +              "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
        +              "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
        +              "requires": {
        +                "isarray": "1.0.0"
        +              }
        +            }
        +          }
        +        },
        +        "has-values": {
        +          "version": "0.1.4",
        +          "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
        +          "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E="
        +        }
        +      }
        +    },
        +    "urix": {
        +      "version": "0.1.0",
        +      "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
        +      "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI="
        +    },
        +    "use": {
        +      "version": "3.1.1",
        +      "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
        +      "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ=="
        +    },
        +    "util-deprecate": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
        +      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
        +    },
        +    "v8flags": {
        +      "version": "3.1.3",
        +      "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz",
        +      "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==",
        +      "requires": {
        +        "homedir-polyfill": "^1.0.1"
        +      }
        +    },
        +    "validate-npm-package-license": {
        +      "version": "3.0.4",
        +      "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
        +      "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
        +      "requires": {
        +        "spdx-correct": "^3.0.0",
        +        "spdx-expression-parse": "^3.0.0"
        +      }
        +    },
        +    "which": {
        +      "version": "1.3.1",
        +      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
        +      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
        +      "requires": {
        +        "isexe": "^2.0.0"
        +      }
        +    },
        +    "wordpress": {
        +      "version": "1.3.0",
        +      "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.3.0.tgz",
        +      "integrity": "sha1-0LxIUVOktTh3B+O8yRZqDBPpcS8=",
        +      "requires": {
        +        "xmlrpc": "1.3.2"
        +      }
        +    },
        +    "wrappy": {
        +      "version": "1.0.2",
        +      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
        +      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
        +    },
        +    "xmlbuilder": {
        +      "version": "8.2.2",
        +      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz",
        +      "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M="
        +    },
        +    "xmlrpc": {
        +      "version": "1.3.2",
        +      "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.2.tgz",
        +      "integrity": "sha1-JrLqNHhI0Ciqx+dRS1NRl23j6D0=",
               "requires": {
        -        "sax": "0.6.1",
        -        "xmlbuilder": "2.6.5"
        +        "sax": "1.2.x",
        +        "xmlbuilder": "8.2.x"
               }
             }
           }
        diff --git a/package.json b/package.json
        index 355f6217..e0cf10d1 100644
        --- a/package.json
        +++ b/package.json
        @@ -24,8 +24,8 @@
             "test": "grunt lint"
           },
           "dependencies": {
        -    "grunt": "0.4.5",
        -    "grunt-cli": "1.1.0",
        -    "grunt-jquery-content": "3.0.1"
        +    "grunt": "1.0.4",
        +    "grunt-cli": "1.3.2",
        +    "grunt-jquery-content": "3.0.3"
           }
         }
        
        From 92a40f605de36947b784c05786b59e70eda21ac0 Mon Sep 17 00:00:00 2001
        From: Brian Leishman 
        Date: Thu, 29 Aug 2019 19:51:44 -0400
        Subject: [PATCH 850/998] find: Clarify selectors are scoped to context
        
        Clarify that jQuery uses a different context scoping mechanism than native querySelectorAll.
        
        Closes gh-1135
        ---
         entries/find.xml | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/entries/find.xml b/entries/find.xml
        index c6a32e84..fc10241b 100644
        --- a/entries/find.xml
        +++ b/entries/find.xml
        @@ -18,7 +18,7 @@
           Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
           
             

        Given a jQuery object that represents a set of DOM elements, the .find() method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .find() and .children() methods are similar, except that the latter only travels a single level down the DOM tree.

        -

        The first signature for the .find()method accepts a selector expression of the same type that we can pass to the $() function. The elements will be filtered by testing whether they match this selector. The expressions allowed include selectors like > p which will find all the paragraphs that are children of the elements in the jQuery object.

        +

        The first signature for the .find()method accepts a selector expression of the same type that we can pass to the $() function. The elements will be filtered by testing whether they match this selector; all parts of the selector must lie inside of an element on which .find() is called. The expressions allowed include selectors like > p which will find all the paragraphs that are children of the elements in the jQuery object.

        Consider a page with a basic nested list on it:

        
         <ul class="level-1">
        
        From 9e4b6b8260a0f020a42ec0f16652194e2fb4b927 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
         
        Date: Fri, 30 Aug 2019 01:52:40 +0200
        Subject: [PATCH 851/998] 1.12.40
        
        ---
         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 c0781a3e..7a361581 100644
        --- a/package-lock.json
        +++ b/package-lock.json
        @@ -1,6 +1,6 @@
         {
           "name": "api.jquery.com",
        -  "version": "1.12.39",
        +  "version": "1.12.40",
           "lockfileVersion": 1,
           "requires": true,
           "dependencies": {
        diff --git a/package.json b/package.json
        index e0cf10d1..f76c24d0 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": "1.12.39",
        +  "version": "1.12.40",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From 21e1e632887c9ff57a137957b823b01331d0a8b5 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
         
        Date: Fri, 30 Aug 2019 12:33:51 +0200
        Subject: [PATCH 852/998] 1.12.41
        
        ---
         package.json | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/package.json b/package.json
        index f76c24d0..079abd1d 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": "1.12.40",
        +  "version": "1.12.41",
           "homepage": "https://github.com/jquery/api.jquery.com",
           "author": {
             "name": "jQuery Foundation and other contributors"
        
        From eb5c9002b60327e0666f103159c120863e2c6665 Mon Sep 17 00:00:00 2001
        From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
         
        Date: Mon, 2 Sep 2019 18:11:57 +0200
        Subject: [PATCH 853/998] All: Mark positional selectors as deprecated since
         jQuery 3.4.0
        
        Positional selectors: :first, :last, :eq, :even, :odd, :lt, :gt, and :nth are
        deprecated since jQuery 3.4.0. This is now reflected in the docs & deprecated
        pseudo-classes are not used in examples on other API pages.
        
        Fixes gh-1144
        Closes gh-1145
        ---
         categories.xml                        |  9 +++++++--
         entries/addClass.xml                  |  2 +-
         entries/animate.xml                   |  4 ++--
         entries/children.xml                  |  4 ++--
         entries/contextmenu.xml               |  2 +-
         entries/data.xml                      |  4 ++--
         entries/dblclick.xml                  |  2 +-
         entries/end.xml                       |  2 +-
         entries/eq-selector.xml               |  4 +++-
         entries/even-selector.xml             |  3 ++-
         entries/fadeIn.xml                    |  2 +-
         entries/fadeTo.xml                    |  6 +++---
         entries/fadeToggle.xml                |  8 ++++----
         entries/first-child-selector.xml      |  2 +-
         entries/first-selector.xml            |  4 +++-
         entries/get.xml                       |  2 +-
         entries/gt-selector.xml               |  4 +++-
         entries/hasClass.xml                  |  4 ++--
         entries/hidden-selector.xml           |  4 ++--
         entries/hover.xml                     |  2 +-
         entries/index.xml                     |  4 ++--
         entries/innerHeight.xml               |  4 ++--
         entries/innerWidth.xml                |  4 ++--
         entries/is.xml                        |  2 --
         entries/jQuery.data.xml               |  4 ++--
         entries/jQuery.removeData.xml         |  8 ++++----
         entries/jQuery.unique.xml             |  4 ++--
         entries/jQuery.uniqueSort.xml         |  4 ++--
         entries/last-child-selector.xml       |  2 +-
         entries/last-selector.xml             |  6 ++++--
         entries/lt-selector.xml               |  4 +++-
         entries/mouseenter.xml                | 12 ++++++------
         entries/mouseleave.xml                | 12 ++++++------
         entries/mousemove.xml                 |  4 ++--
         entries/mouseout.xml                  | 12 ++++++------
         entries/nextAll.xml                   |  2 +-
         entries/nth-child-selector.xml        |  4 ++--
         entries/nth-last-child-selector.xml   |  2 +-
         entries/nth-last-of-type-selector.xml |  2 +-
         entries/nth-of-type-selector.xml      |  2 +-
         entries/odd-selector.xml              |  3 ++-
         entries/offset.xml                    |  4 ++--
         entries/outerHeight.xml               |  4 ++--
         entries/outerWidth.xml                |  4 ++--
         entries/position.xml                  |  4 ++--
         entries/prevAll.xml                   |  2 +-
         entries/removeClass.xml               |  4 ++--
         entries/removeData.xml                |  8 ++++----
         entries/scrollLeft.xml                |  4 ++--
         entries/scrollTop.xml                 |  4 ++--
         entries/slideDown.xml                 |  2 +-
         entries/slideUp.xml                   |  2 +-
         entries/submit.xml                    |  4 ++--
         entries/text.xml                      |  4 ++--
         entries/trigger.xml                   | 14 +++++++-------
         55 files changed, 127 insertions(+), 112 deletions(-)
        
        diff --git a/categories.xml b/categories.xml
        index c02b93b3..78f012b1 100644
        --- a/categories.xml
        +++ b/categories.xml
        @@ -71,14 +71,19 @@
                 

        For more information, see the Release Notes/Changelog at https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/

        ]]> - + + + + - + diff --git a/entries/addClass.xml b/entries/addClass.xml index 5dd99ec5..3b28a708 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -64,7 +64,7 @@ $( "p" ).last().addClass( "selected" ); Add the classes "selected" and "highlight" to the matched elements. Store then retrieve a value from the div element.
        @@ -128,8 +128,8 @@ var getPos = function( n ) { $( "p" ).each(function( n ) { var r = Math.floor( Math.random() * 3 ); var tmp = $( this ).text(); - $( this ).text( $( "p:eq(" + r + ")" ).text() ); - $( "p:eq(" + r + ")" ).text( tmp ); + $( this ).text( $( "p" ).eq( r ).text() ); + $( "p" ).eq( r ).text( tmp ); $( this ).css( "left", getPos( n ) ); }); $( "div" ) diff --git a/entries/fadeToggle.xml b/entries/fadeToggle.xml index f3906b45..b4d4fb0b 100644 --- a/entries/fadeToggle.xml +++ b/entries/fadeToggle.xml @@ -26,11 +26,11 @@ Fades first paragraph in or out, completing the animation within 600 milliseconds and using a linear easing. Fades last paragraph in or out for 200 milliseconds, inserting a "finished" message upon completion.
        300 diff --git a/entries/mouseout.xml b/entries/mouseout.xml index 57304cb1..d95273c5 100644 --- a/entries/mouseout.xml +++ b/entries/mouseout.xml @@ -85,21 +85,21 @@ $( "#other" ).click(function() { var i = 0; $( "div.overout" ) .mouseout(function() { - $( "p:first", this ).text( "mouse out" ); - $( "p:last", this ).text( ++i ); + $( "p", this ).first().text( "mouse out" ); + $( "p", this ).last().text( ++i ); }) .mouseover(function() { - $( "p:first", this ).text( "mouse over" ); + $( "p", this ).first().text( "mouse over" ); }); var n = 0; $( "div.enterleave" ) .on( "mouseenter", function() { - $( "p:first", this ).text( "mouse enter" ); + $( "p", this ).first().text( "mouse enter" ); }) .on( "mouseleave", function() { - $( "p:first", this ).text( "mouse leave" ); - $( "p:last", this ).text( ++n ); + $( "p", this ).first().text( "mouse leave" ); + $( "p", this ).last().text( ++n ); }); ]]> @@ -101,7 +101,7 @@ $( "*", document.body ).click(function( event ) { Set the offset of the second paragraph: diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index cfb07bc8..c8e6f87e 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -23,8 +23,8 @@ Get the outerWidth of a paragraph. diff --git a/entries/position.xml b/entries/position.xml index 3eed46b4..60b3e6a2 100644 --- a/entries/position.xml +++ b/entries/position.xml @@ -16,9 +16,9 @@ Access the position of the second paragraph: diff --git a/entries/text.xml b/entries/text.xml index 3752dd10..ff9c537e 100644 --- a/entries/text.xml +++ b/entries/text.xml @@ -28,8 +28,8 @@ Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone). Clicks to button #2 also trigger a click for button #1. To submit the first form without using the submit() function, try: Date: Tue, 3 Sep 2019 20:14:25 +0200 Subject: [PATCH 855/998] All: Upgrade jQuery used in examples from 1.10.2 to 3.4.1 The upgrade is necessary to be able to write examples for newer APIs. Examples for removed APIs have been removed as they'd no longer work. Fixes gh-982 Closes gh-1148 --- entries/andSelf.xml | 68 ++------------------------------- entries/context.xml | 7 ++-- entries/deferred.isRejected.xml | 4 +- entries/deferred.isResolved.xml | 4 +- entries/die.xml | 3 ++ entries/error.xml | 5 ++- entries/jQuery.boxModel.xml | 8 +++- entries/jQuery.browser.xml | 6 +++ entries/jQuery.sub.xml | 6 +-- entries/live.xml | 4 +- entries/load-event.xml | 3 ++ entries/selector.xml | 4 +- entries/size.xml | 26 ++----------- entries/unload.xml | 3 ++ entries2html.xsl | 2 +- 15 files changed, 50 insertions(+), 103 deletions(-) diff --git a/entries/andSelf.xml b/entries/andSelf.xml index 5adfd1ae..967c72ef 100644 --- a/entries/andSelf.xml +++ b/entries/andSelf.xml @@ -6,72 +6,10 @@ Add the previous set of elements on the stack to the current set. -

        Note: This function has been deprecated and is now an alias for .addBack(), which should be used with jQuery 1.8 and later.

        -

        As described in the discussion for .end(), jQuery objects maintain an internal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf() can help.

        -

        Consider a page with a simple list on it:

        -
        
        -<ul>
        -  <li>list item 1</li>
        -  <li>list item 2</li>
        -  <li class="third-item">list item 3</li>
        -  <li>list item 4</li>
        -  <li>list item 5</li>
        -</ul>
        -    
        -

        The result of the following code is a red background behind items 3, 4 and 5:

        -
        
        -$( "li.third-item" ).nextAll().andSelf()
        -  .css( "background-color", "red" );
        -    
        -

        First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll() then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf() invocation merges these two sets together, creating a jQuery object that points to all three items in document order: [ <li.third-item>, <li>, <li> ].

        +
        +

        Note: This API has been removed in jQuery 3.0; use .addBack() instead, which should work identically.

        +
        - - The .andSelf() method causes the previous set of DOM elements in the traversal stack to be added to the current set. In the first example, the top stack contains the set resulting from .find("p"). In the second example, .andSelf() adds the previous set of elements on the stack — in this case $( "div.after-andself" ) — to the current set, selecting both the div and its enclosed paragraphs. - - - - diff --git a/entries/context.xml b/entries/context.xml index 5fc5362a..496c833a 100644 --- a/entries/context.xml +++ b/entries/context.xml @@ -6,7 +6,9 @@ The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. -

        The .context property was deprecated in jQuery 1.10 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version.

        +
        +

        Note: This API has been removed in jQuery 3.0.

        +

        The .live() method for binding event handlers uses this property to determine the root element to use for its event delegation needs.

        The value of this property is typically equal to document, as this is the default context for jQuery objects if none is supplied. The context may differ if, for example, the object was created by searching within an <iframe> or XML document.

        Note that the context property may only apply to the elements originally selected by jQuery(), as it is possible for the user to add elements to the collection via methods such as .add() and these may have a different context.

        @@ -18,9 +20,6 @@ $( "ul" ) .append( "
      • " + $( "ul" ).context + "
      • " ) .append( "
      • " + $( "ul", document.body ).context.nodeName + "
      • " ); ]]>
        -
        diff --git a/entries/deferred.isRejected.xml b/entries/deferred.isRejected.xml index 5fdd1e95..60ddb77b 100644 --- a/entries/deferred.isRejected.xml +++ b/entries/deferred.isRejected.xml @@ -6,7 +6,9 @@ Determine whether a Deferred object has been rejected. -

        As of jQuery 1.7 this API has been deprecated; please use deferred.state() instead.

        +
        +

        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).

        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.

        diff --git a/entries/deferred.isResolved.xml b/entries/deferred.isResolved.xml index b5941322..9c046e5a 100644 --- a/entries/deferred.isResolved.xml +++ b/entries/deferred.isResolved.xml @@ -6,7 +6,9 @@ Determine whether a Deferred object has been resolved. -

        This API is deprecated as of jQuery 1.7 and removed as of jQuery 1.8; please use deferred.state() instead.

        +
        +

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

        +

        Returns true if the Deferred object is in the resolved state, meaning that either deferred.resolve() or deferred.resolveWith() has been called for the object and the doneCallbacks 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.isRejected() to determine whether the Deferred object is in the rejected 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.

        diff --git a/entries/die.xml b/entries/die.xml index a3d038ec..efe2e614 100644 --- a/entries/die.xml +++ b/entries/die.xml @@ -21,6 +21,9 @@ +
        +

        Note: This API has been removed in jQuery 1.9; please use on() instead.

        +

        Any handler that has been attached with .live() can be removed with .die(). This method is analogous to calling .off() with no arguments, which is used to remove all handlers attached with .on(). See the discussions of .live() and .off() for further details.

        If used without an argument, .die() removes all event handlers previously attached using .live() from the elements.

        diff --git a/entries/error.xml b/entries/error.xml index 6f646aa2..47d9e0e9 100644 --- a/entries/error.xml +++ b/entries/error.xml @@ -20,8 +20,9 @@ -

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

        -

        As of jQuery 1.8, the .error() method is deprecated. Use .on( "error", handler ) to attach event handlers to the error event instead.

        +
        +

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

        +

        The error event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly.

        For example, consider a page with a simple image element:

        
        diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml
        index ac464850..b80abe29 100644
        --- a/entries/jQuery.boxModel.xml
        +++ b/entries/jQuery.boxModel.xml
        @@ -4,8 +4,12 @@
           
             1.0
           
        -  States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model. This property was removed in jQuery 1.8. Please try to use feature detection instead.
        -  
        +  States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.
        +  
        +    
        +

        Note: This API has been removed in jQuery 3.0; check if .document.compatMode is equal to "CSS1Compat" instead. Or, even better - always specify a DOCTYPE and avoid using quirks mode which jQuery doesn't support.

        +
        +
        diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index 667ed5f1..11686eae 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -7,6 +7,9 @@ Contains flags for the useragent, read from navigator.userAgent. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. Please try to use feature detection instead. +
        +

        Note: This API has been removed in jQuery 1.9; please rely on feature detection instead.

        +

        The $.browser property provides information about the web browser that is accessing the page, as reported by the browser itself. It contains flags for each of the four most prevalent browser classes (Internet Explorer, Mozilla, Webkit, and Opera) as well as version information.

        Available flags are:

          @@ -56,6 +59,9 @@ $.browser.msie; The version number of the rendering engine for the user's browser. This property was removed in jQuery 1.9 and is available only through the jQuery.migrate plugin. +
          +

          Note: This API has been removed in jQuery 1.9; please rely on feature detection instead.

          +

          Here are some typical results:

          • Internet Explorer: 6.0, 7.0, 8.0
          • diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index a52c9ab6..bc0330e4 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -6,9 +6,9 @@ Creates a new copy of jQuery whose properties and methods can be modified without affecting the original jQuery object. -

            - This method is deprecated as of jQuery 1.7 and will be moved to a plugin in jQuery 1.8. -

            +
            +

            Note: This API has been removed in jQuery 1.9.

            +

            There are two specific use cases for which jQuery.sub() was created. The first was for providing a painless way of overriding jQuery methods without completely destroying the original methods and another was for helping to do encapsulation and basic namespacing for jQuery plugins.

            Note that jQuery.sub() doesn't attempt to do any sort of isolation - that's not its intention. All the methods on the sub'd version of jQuery will still point to the original jQuery (events bound and triggered will still be through the main jQuery, data will be bound to elements through the main jQuery, Ajax queries and events will run through the main jQuery, etc.).

            Note that if you're looking to use this for plugin development you should first strongly consider using something like the jQuery UI widget factory which manages both state and plugin sub-methods. Some examples of using the jQuery UI widget factory to build a plugin.

            diff --git a/entries/live.xml b/entries/live.xml index 049322e2..e88a67ce 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -32,7 +32,9 @@ -

            As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

            +
            +

            Note: This API has been removed in jQuery 1.9; please use on() instead.

            +

            This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

            Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:

            
            diff --git a/entries/load-event.xml b/entries/load-event.xml
            index e3739cb7..b9669cc6 100644
            --- a/entries/load-event.xml
            +++ b/entries/load-event.xml
            @@ -20,6 +20,9 @@
                 
               
               
            +    
            +

            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 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:

            diff --git a/entries/selector.xml b/entries/selector.xml index d64fc0aa..229e674b 100644 --- a/entries/selector.xml +++ b/entries/selector.xml @@ -6,7 +6,9 @@ A selector representing selector passed to jQuery(), if any, when creating the original set. -

            The .selector property was deprecated in jQuery 1.7 and is only maintained to the extent needed for supporting .live() in the jQuery Migrate plugin. It may be removed without notice in a future version. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as $.fn.foo = function( selector, options ) { /* plugin code goes here */ };, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} ); with the "div.bar" selector repeated as the first argument of .foo().

            +
            +

            Note: This API has been removed in jQuery 3.0. The property was never a reliable indicator of the selector that could be used to obtain the set of elements currently contained in the jQuery set where it was a property, since subsequent traversal methods may have changed the set. Plugins that need to use a selector string within their plugin can require it as a parameter of the method. For example, a "foo" plugin could be written as $.fn.foo = function( selector, options ) { /* plugin code goes here */ };, and the person using the plugin would write $( "div.bar" ).foo( "div.bar", {dog: "bark"} ); with the "div.bar" selector repeated as the first argument of .foo().

            +
            diff --git a/entries/size.xml b/entries/size.xml index e7dd1223..18052147 100644 --- a/entries/size.xml +++ b/entries/size.xml @@ -6,7 +6,9 @@ Return the number of elements in the jQuery object. -

            The .size() method is deprecated as of jQuery 1.8. Use the .length property instead.

            +
            +

            Note: This method has been removed in jQuery 3.0. Use the .length property instead.

            +

            The .size() method is functionally equivalent to the .length property; however, the .length property is preferred because it does not have the overhead of a function call.

            Given a simple unordered list on the page:

            @@ -30,7 +32,7 @@ alert( "Size: " + $( "li" ).length );

            - Count the divs. Click to add more. + Count the divs. - - diff --git a/entries/unload.xml b/entries/unload.xml index 1306ddd6..b57d14f4 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -20,6 +20,9 @@ Bind an event handler to the "unload" JavaScript event. +
            +

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

            +

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

            The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things. The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. The forward and back buttons will trigger the event. Closing the browser window will cause the event to be triggered. Even a page reload will first create an unload event.

            diff --git a/entries2html.xsl b/entries2html.xsl index fe2dc09b..8237a92f 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-1.10.2.js"></script> + <script src="https://code.jquery.com/jquery-3.4.1.js"></script> <script> </script> From 28d2e7daf668bf53b54d8ed45b4864cd44f6a17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Tue, 3 Sep 2019 20:15:21 +0200 Subject: [PATCH 856/998] 1.12.43 --- 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 eabb5ac2..b5140bce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.42", + "version": "1.12.43", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1065425a..69a0906c 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": "1.12.42", + "version": "1.12.43", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 7010c4cf78b4333724084720ba536b2b0750e205 Mon Sep 17 00:00:00 2001 From: Andrea Rendine Date: Fri, 4 Oct 2019 19:23:44 +0200 Subject: [PATCH 857/998] jQuery.post: Reference $.post instead of $.get Fixed a copypaste misprint from get to post. Closes #1151 --- entries/jQuery.post.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 6152350a..06e353f8 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -50,7 +50,7 @@ $.post( "ajax/test.html", function( data ) {

            This example fetches the requested HTML snippet and inserts it on the page.

            Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

            The jqXHR Object

            -

            As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

            +

            As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.post() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error; added in jQuery 1.6) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

            The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

            
             // Assign handlers immediately after making the request,
            
            From d786cbf630fcbd23894cd9bf0b6ccd659ee84b6f Mon Sep 17 00:00:00 2001
            From: Andrea Rendine 
            Date: Fri, 4 Oct 2019 19:27:33 +0200
            Subject: [PATCH 858/998] jQuery.getJSON: Change the removed jqXHR.complete to
             jqXHR.always
            
            `jqXHR.complete` has been removed in jQuery 3.0.
            
            Closes #1150
            ---
             entries/jQuery.getJSON.xml | 2 +-
             1 file changed, 1 insertion(+), 1 deletion(-)
            
            diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml
            index 07a926cc..1449293d 100644
            --- a/entries/jQuery.getJSON.xml
            +++ b/entries/jQuery.getJSON.xml
            @@ -82,7 +82,7 @@ var jqxhr = $.getJSON( "example.json", function() {
             // Perform other work here ...
             
             // Set another completion function for the request above
            -jqxhr.complete(function() {
            +jqxhr.always(function() {
               console.log( "second complete" );
             });
                 
            From 9580ed588314195835a72b846a584cb6ea885d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Fri, 4 Oct 2019 19:28:01 +0200 Subject: [PATCH 859/998] 1.12.44 --- 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 b5140bce..a6997d27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.43", + "version": "1.12.44", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 69a0906c..1e74de29 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": "1.12.43", + "version": "1.12.44", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From be6de733d57d67634ef07dcfc38163d18945c0e4 Mon Sep 17 00:00:00 2001 From: Veniamin Krol <153412+vkrol@users.noreply.github.com> Date: Sat, 5 Oct 2019 15:48:30 +0300 Subject: [PATCH 860/998] jQuery.ajax: Clarify errorThrown and statusText may be empty in HTTP/2 Fixes #1063 Closes #1146 --- entries/jQuery.ajax.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index f75de949..c22347fb 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -109,7 +109,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." 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 script 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. @@ -290,7 +290,7 @@ jqxhr.always(function() { status
          • - statusText + statusText (may be an empty string in HTTP/2)
          • abort( [ statusText ] ) From 660e0a1a87b75dad5da7c878021178b5130852f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Sat, 5 Oct 2019 14:49:13 +0200 Subject: [PATCH 861/998] 1.12.45 --- 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 a6997d27..2cde7b4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.44", + "version": "1.12.45", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1e74de29..f53f2e26 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": "1.12.44", + "version": "1.12.45", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From b1951ddfd19ceae1746bb91e1f8e5de6486ddfda Mon Sep 17 00:00:00 2001 From: Ed S Date: Wed, 13 Nov 2019 17:50:24 +0000 Subject: [PATCH 862/998] jQuery.queue: document it returns an array Fixes #1153 Closes #1155 --- entries/jQuery.queue.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.queue.xml b/entries/jQuery.queue.xml index 3921e020..b15912ab 100644 --- a/entries/jQuery.queue.xml +++ b/entries/jQuery.queue.xml @@ -70,7 +70,7 @@ runIt(); - + 1.3 From 81f438d5dfc02fcdbfed08f3caa177c23404244a Mon Sep 17 00:00:00 2001 From: Ed S Date: Wed, 13 Nov 2019 17:50:58 +0000 Subject: [PATCH 863/998] jQuery.removeData: document it returns undefined Not to be confused with the `removeData` method, which does return a jQuery collection. Fixes #1153 Closes #1154 --- entries/jQuery.removeData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.removeData.xml b/entries/jQuery.removeData.xml index f85d622b..6a92a25f 100644 --- a/entries/jQuery.removeData.xml +++ b/entries/jQuery.removeData.xml @@ -1,5 +1,5 @@ - + jQuery.removeData() 1.2.3 From 86ddf41e86ee2d2ac4dd16730a9945f467de8a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 13 Nov 2019 18:53:39 +0100 Subject: [PATCH 864/998] 1.12.46 --- 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 2cde7b4e..00769c62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.45", + "version": "1.12.46", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f53f2e26..71a1d282 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": "1.12.45", + "version": "1.12.46", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From f79b51cfb1f15f756ca842afcb2d76ed3290a63d Mon Sep 17 00:00:00 2001 From: Theodore Keloglou Date: Fri, 28 Feb 2020 12:19:45 +0000 Subject: [PATCH 865/998] insertAfter: Change hyphen with em dash Closes gh-1158 --- entries/insertAfter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/insertAfter.xml b/entries/insertAfter.xml index 9065d305..8c406cfa 100644 --- a/entries/insertAfter.xml +++ b/entries/insertAfter.xml @@ -14,7 +14,7 @@ Insert every element in the set of matched elements after the target. -

            The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

            +

            The .after() and .insertAfter() methods perform the same task. The major difference is in the syntax—specifically, in the placement of the content and target. With .after(), the selector expression preceding the method is the container after which the content is inserted. With .insertAfter(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted after the target container.

            Consider the following HTML:

            
             <div class="container">
            
            From 324e63d55ba02378b881608c69f26ba8d407023a Mon Sep 17 00:00:00 2001
            From: Kostiantyn Plakhotia 
            Date: Mon, 13 Apr 2020 18:23:59 +0300
            Subject: [PATCH 866/998] Types: Update link to QUnit.assert docs
            
            Closes #1159
            ---
             pages/Types.html | 2 +-
             1 file changed, 1 insertion(+), 1 deletion(-)
            
            diff --git a/pages/Types.html b/pages/Types.html
            index fd4df2ca..6221434f 100644
            --- a/pages/Types.html
            +++ b/pages/Types.html
            @@ -666,4 +666,4 @@ 

            Callbacks Object

            XML Document

            A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

            Assert

            -

            A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

            +

            A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

            From 0b081f2a3daa2697255045283c54c58fd12beaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Fri, 17 Apr 2020 11:53:05 +0200 Subject: [PATCH 867/998] 1.12.47 --- 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 00769c62..d1c4096e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "1.12.46", + "version": "1.12.47", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 71a1d282..63c7e90a 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": "1.12.46", + "version": "1.12.47", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 67942f9092c56edaf01327b21db4405748b24fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 29 Apr 2020 17:42:50 +0200 Subject: [PATCH 868/998] Travis: Test on Node 10 instead of 8 which is EOL --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8b645e42..c4177e89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "8" + - "10" addons: apt: packages: From 13b661bd061b7c341cc74a44e6653937ebb9f556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 29 Apr 2020 17:46:39 +0200 Subject: [PATCH 869/998] All: Updates for jQuery 1.12/2.2-3.5 Fixes #947 Fixes #949 Fixes #950 Fixes #1142 Ref #970 Ref #972 Closes #1160 --- categories.xml | 43 +++++++++++++++++++- entries/addClass.xml | 33 +++++++++++++++- entries/contents.xml | 2 + entries/css.xml | 4 ++ entries/eq-selector.xml | 4 +- entries/even-selector.xml | 5 ++- entries/even.xml | 47 ++++++++++++++++++++++ entries/filter.xml | 4 +- entries/first-selector.xml | 4 +- entries/first.xml | 19 ++++----- entries/gt-selector.xml | 4 +- entries/hover.xml | 4 +- entries/jQuery.ajax.xml | 3 +- entries/jQuery.extend.xml | 2 + entries/jQuery.get.xml | 3 +- entries/jQuery.getScript.xml | 2 + entries/jQuery.holdReady.xml | 13 +++++- entries/jQuery.htmlPrefilter.xml | 68 ++------------------------------ entries/jQuery.isArray.xml | 6 ++- entries/jQuery.isFunction.xml | 4 +- entries/jQuery.isNumeric.xml | 6 ++- entries/jQuery.isWindow.xml | 6 +++ entries/jQuery.now.xml | 10 +++-- entries/jQuery.post.xml | 3 +- entries/jQuery.proxy.xml | 6 ++- entries/jQuery.trim.xml | 6 ++- entries/jQuery.type.xml | 14 ++++--- entries/jQuery.uniqueSort.xml | 4 +- entries/last-selector.xml | 4 +- entries/last.xml | 11 ++++-- entries/lt-selector.xml | 4 +- entries/not.xml | 4 +- entries/nth-child-selector.xml | 13 ++++-- entries/odd-selector.xml | 5 ++- entries/odd.xml | 47 ++++++++++++++++++++++ entries/removeClass.xml | 44 +++++++++++++++++++-- entries/toggleClass.xml | 31 +++++++++++---- entries2html.xsl | 2 +- 38 files changed, 367 insertions(+), 127 deletions(-) create mode 100644 entries/even.xml create mode 100644 entries/odd.xml diff --git a/categories.xml b/categories.xml index 78f012b1..22dbd59b 100644 --- a/categories.xml +++ b/categories.xml @@ -71,6 +71,11 @@

            For more information, see the Release Notes/Changelog at https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/

            ]]> + + + + + + @@ -429,7 +439,7 @@ var files = event.originalEvent.dataTransfer.files;
            ]]>
            - + + + + + + + + + + + + + diff --git a/entries/addClass.xml b/entries/addClass.xml index 3b28a708..9af9723a 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -7,10 +7,16 @@ One or more space-separated classes to be added to the class attribute of each matched element. + + 3.3 + + An array of classes to be added to the class attribute of each matched element. + + 1.4 - A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + A function returning one or more space-separated classes or an array of classes to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. @@ -82,6 +88,29 @@ $( "p" ).last().addClass( "selected highlight" );

            Hello

            and

            Goodbye

            +]]> + + + Add the classes "selected" and "highlight" to the matched elements (3.3+ syntax). + + + @@ -122,4 +151,6 @@ $( "div" ).addClass(function( index, currentClass ) { + + diff --git a/entries/contents.xml b/entries/contents.xml index f4118e0c..950411ba 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -8,6 +8,7 @@

            Given a jQuery object that represents a set of DOM elements, the .contents() method allows us to search through the immediate children of these elements in the DOM tree and construct a new jQuery object from the matching elements. The .contents() and .children() methods are similar, except that the former includes text nodes and comment nodes as well as HTML elements in the resulting jQuery object. Please note that most jQuery operations don't support text nodes and comment nodes. The few that do will have an explicit note on their API documentation page.

            The .contents() method can also be used to get the content document of an iframe, if the iframe is on the same domain as the main page.

            +

            As of jQuery 3.2, .contents() returns contents of <template> elements as well.

            Consider a simple <div> with a number of text nodes, each of which is separated by two line break elements (<br>):

            
             <div class="container">
            @@ -60,4 +61,5 @@ $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" );
               
               
               
            +  
             
            diff --git a/entries/css.xml b/entries/css.xml
            index 34fc7237..0fd97457 100644
            --- a/entries/css.xml
            +++ b/entries/css.xml
            @@ -23,6 +23,7 @@
                   

            Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

            An element should be connected to the DOM when calling .css() on it. If it isn't, jQuery may throw an error.

            As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

            +

            As of jQuery 3.2, CSS Custom Properties (also called CSS Variables) are supported: $( "p" ).css( "--custom-property" ). Note that you need to provide the property name as-is, camelCasing it won't work as it does for regular CSS properties.

            Get the background color of a clicked div. @@ -106,6 +107,7 @@ $( "div" ).click(function() { + @@ -157,6 +159,7 @@ $( "div.example" ).css( "width", function( index ) {

            This example sets the widths of the matched elements to incrementally larger values.

            Note: If nothing is returned in the setter function (ie. function( index, style ){} ), or if undefined is returned, the current value is not changed. This is useful for selectively setting values only when certain criteria are met.

            +

            As of jQuery 3.2, CSS Custom Properties (also called CSS Variables) are supported: $( "p" ).css( "--custom-property", "value" ). Note that you need to provide the property name as-is, camelCasing it won't work as it does for regular CSS properties.

            Change the color of any paragraph to red on mouseover event. @@ -282,5 +285,6 @@ $( "div" ).on( "click", function() { + diff --git a/entries/eq-selector.xml b/entries/eq-selector.xml index 0c985fca..a191d31b 100644 --- a/entries/eq-selector.xml +++ b/entries/eq-selector.xml @@ -17,7 +17,9 @@
            Select the element at index n within the matched set. -

            As of jQuery 3.4, the :eq pseudo-class is deprecated. Remove it from your selectors and filter the results later using .eq().

            +
            +

            As of jQuery 3.4, the :eq pseudo-class is deprecated. Remove it from your selectors and filter the results later using .eq().

            +

            The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

            Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:eq(1)" ) selects the second element in the document with the class myclass, rather than the first. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

            Prior to jQuery 1.8, the :eq(index) selector did not accept a negative value for index (though the .eq(index) method did).

            diff --git a/entries/even-selector.xml b/entries/even-selector.xml index ba2dc5d5..bfc8038a 100644 --- a/entries/even-selector.xml +++ b/entries/even-selector.xml @@ -5,8 +5,11 @@ 1.0 - Selects even elements, zero-indexed. See also odd. + Selects even elements, zero-indexed. See also :odd. +
            +

            As of jQuery 3.4, the :even pseudo-class is deprecated. Remove it from your selectors and filter the results later using .even() (available in jQuery 3.5.0 or newer).

            +

            In particular, note that the 0-based indexing means that, counter-intuitively, :even selects the first element, third element, and so on within the matched set.

            diff --git a/entries/even.xml b/entries/even.xml new file mode 100644 index 00000000..cecff9e4 --- /dev/null +++ b/entries/even.xml @@ -0,0 +1,47 @@ + + + .even() + + 3.5 + + Reduce the set of matched elements to the even ones in the set, numbered from zero. + +

            Given a jQuery object that represents a set of DOM elements, the .even() method constructs a new jQuery object from the even elements in that set. Counting starts from zero!

            +

            Consider a page with a simple list on it:

            +
            
            +<ul>
            +  <li>list item 1</li>
            +  <li>list item 2</li>
            +  <li>list item 3</li>
            +  <li>list item 4</li>
            +  <li>list item 5</li>
            +</ul>
            +    
            +

            We can apply this method to the set of list items:

            +
            
            +$( "li" ).even().css( "background-color", "red" );
            +    
            +

            The result of this call is a red background for the first, third & 5th items.

            +
            + + Highlight the even items in a list. + + + + + + +
            diff --git a/entries/filter.xml b/entries/filter.xml index 01489193..ed92d385 100644 --- a/entries/filter.xml +++ b/entries/filter.xml @@ -42,9 +42,9 @@

            We can apply this method to the set of list items:

            
            -$( "li" ).filter( ":even" ).css( "background-color", "red" );
            +$( "li" ).filter( ":nth-child(2n)" ).css( "background-color", "red" );
                 
            -

            The result of this call is a red background for items 1, 3, and 5, as they match the selector (recall that :even and :odd use 0-based indexing).

            +

            The result of this call is a red background for items 2, 4, and 6, as they match the selector.

            Using a Filter Function

            The second form of this method allows us to filter elements against a function rather than a selector. For each element, if the function returns true (or a "truthy" value), the element will be included in the filtered set; otherwise, it will be excluded. Suppose we have a somewhat more involved HTML snippet:

            
            diff --git a/entries/first-selector.xml b/entries/first-selector.xml
            index ded45ccb..1308ff5e 100644
            --- a/entries/first-selector.xml
            +++ b/entries/first-selector.xml
            @@ -7,7 +7,9 @@
               
               Selects the first matched DOM element.
               
            -    

            As of jQuery 3.4, the :first pseudo-class is deprecated. Remove it from your selectors and filter the results later using .first().

            +
            +

            As of jQuery 3.4, the :first pseudo-class is deprecated. Remove it from your selectors and filter the results later using .first().

            +

            The :first pseudo-class is equivalent to :eq( 0 ). It could also be written as :lt( 1 ). While this matches only a single element, :first-child can match more than one: One for each parent.

            diff --git a/entries/first.xml b/entries/first.xml index f73f8f10..90ac489c 100644 --- a/entries/first.xml +++ b/entries/first.xml @@ -24,21 +24,22 @@ $( "li" ).first().css( "background-color", "red" );

            The result of this call is a red background for the first item.

            - Highlight the first span in a paragraph. + Highlight the first item in a list. diff --git a/entries/gt-selector.xml b/entries/gt-selector.xml index 8ad903fc..1aad2e3d 100644 --- a/entries/gt-selector.xml +++ b/entries/gt-selector.xml @@ -17,7 +17,9 @@ Select all elements at an index greater than index within the matched set. -

            As of jQuery 3.4, the :gt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :gt(3) can be replaced with a call to .slice( 4 ) (the provided index needs to be increased by one).

            +
            +

            As of jQuery 3.4, the :gt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :gt(3) can be replaced with a call to .slice( 4 ) (the provided index needs to be increased by one).

            +

            index-related selectors

            diff --git a/entries/hover.xml b/entries/hover.xml index f6656b0c..2ddab1fa 100644 --- a/entries/hover.xml +++ b/entries/hover.xml @@ -102,10 +102,10 @@ $( selector ).on( "mouseenter mouseleave", handlerInOut ); Slide the next sibling LI up or down on hover, and toggle a class. , to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
          • +
          • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests. Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script Content-Type were still executed.
          • "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests that have a callback placeholder, e.g. ?callback=?, are performed using JSONP unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
          • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
          • "text": A plain text string.
          • @@ -457,4 +457,5 @@ $.ajax({ + diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index b28ec2e0..56fbab89 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -35,6 +35,7 @@

            Keep in mind that the target object (first argument) will be modified, and will also be returned from $.extend(). If, however, you want to preserve both of the original objects, you can do so by passing an empty object as the target:

            var object = $.extend({}, object1, object2);

            The merge performed by $.extend() is not recursive by default; if a property of the first object is itself an object or array, it will be completely overwritten by a property with the same key in the second or subsequent object. The values are not merged. This can be seen in the example below by examining the value of banana. However, by passing true for the first function argument, objects will be recursively merged.

            +

            Warning: Versions prior to 3.4 had a security issue where calling jQuery.extend(true, {}, object) on an unsanitized object containing a __proto__ property would extend Object.prototype.

            Warning: Passing false for the first argument is not supported.

            Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. Properties that are an object constructed via new MyCustomObject(args), or built-in JavaScript types such as Date or RegExp, are not re-constructed and will appear as plain Objects in the resulting object or array.

            On a deep extend, Object and Array are extended, but object wrappers on primitive types such as String, Boolean, and Number are not. Deep-extending a cyclical data structure will result in an error.

            @@ -106,4 +107,5 @@ $( "#log" ).append( "
            settings -- " + JSON.stringify( settings ) + "< + diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index be1e25a2..55009de2 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -22,7 +22,7 @@ - 1.12/2.2 + 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. @@ -128,4 +128,5 @@ $.get( "test.php", function( data ) { + diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index be884042..357b9e1a 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -56,6 +56,7 @@ $( "div.log" ).ajaxError(function( e, jqxhr, settings, exception ) { } });
            +

            Prior to jQuery 3.5.0, unsuccessful HTTP responses with a script Content-Type were still executed.

            Caching Responses

            By default, $.getScript() sets the cache setting to false. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using $.ajaxSetup():

            
            @@ -125,4 +126,5 @@ $.getScript( url, function() {
               
               
               
            +  
             
            diff --git a/entries/jQuery.holdReady.xml b/entries/jQuery.holdReady.xml
            index 016e951a..0ba8ceb0 100644
            --- a/entries/jQuery.holdReady.xml
            +++ b/entries/jQuery.holdReady.xml
            @@ -1,5 +1,5 @@
             
            -
            +
               jQuery.holdReady()
               Holds or releases the execution of jQuery's ready event.
               
            @@ -9,6 +9,16 @@
                 
               
               
            +    
            +

            Note: This API has been deprecated in jQuery 3.2. Instead of relying on this global switch, it's better to put explicitly wait for required code. If you need to wait both for the ready state & for a custom promise, use the following pattern:

            + +

            The $.holdReady() method allows the caller to delay jQuery's ready event. This advanced feature would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <head> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect.

            To delay the ready event, first call $.holdReady( true ). When the ready event should be released to execute, call $.holdReady( false ). Note that multiple holds can be put on the ready event, one for each $.holdReady( true ) call. The ready event will not actually fire until all holds have been released with a corresponding number of $.holdReady( false ) calls and the normal document ready conditions are met. (See ready for more information.)

            @@ -25,4 +35,5 @@ $.getScript( "myplugin.js", function() { +
            diff --git a/entries/jQuery.htmlPrefilter.xml b/entries/jQuery.htmlPrefilter.xml index 3682ed5b..75381903 100644 --- a/entries/jQuery.htmlPrefilter.xml +++ b/entries/jQuery.htmlPrefilter.xml @@ -3,75 +3,15 @@ jQuery.htmlPrefilter() Modify and filter HTML strings passed through jQuery manipulation methods. - 1.12/2.2 + 1.12-and-2.2 The HTML string on which to operate. -

            This method rarely needs to be called directly. Instead, use it as an entry point to modify existing jQuery manipulation methods. For instance, to remove all <del> tags from incoming HTML strings, do this:

            -
            
            -var htmlPrefilter = $.htmlPrefilter,
            -  rdel = /<(del)(?=[\s>])[\w\W]*?<\/\1\s*>/gi;
            -
            -$.htmlPrefilter = function( html ) {
            -  return htmlPrefilter.call( this, html ).replace( rdel, "" );
            -};
            -    
            -

            This function can also be overwritten in order to bypass certain edge case issues. The default htmlPrefilter function in jQuery will greedily ensure that all tags are XHTML-compliant. This includes anything that looks like an HTML tag, but is actually within a string (e.g.

            <a title="<div />"><>
            ). The jQuery.htmlPrefilter() function can be used to bypass this:

            -
            
            -$.htmlPrefilter = function( html ) {
            -  // Return HTML strings unchanged
            -  return html;
            -};
            -    
            -

            However, while the above fix is short and simple, it puts the burden on you to ensure XHTML-compliant tags in any HTML strings. A more thorough fix for this issue would be this:

            -
            
            -var panything = "[\\w\\W]*?",
            -
            -  // Whitespace
            -  // https://html.spec.whatwg.org/multipage/infrastructure.html#space-character
            -  pspace = "[\\x20\\t\\r\\n\\f]",
            -
            -  // End of tag name (whitespace or greater-than)
            -  pnameEnd = pspace.replace( "]", ">]" ),
            -
            -  // Tag name (a leading letter, then almost anything)
            -  // https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
            -  // https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
            -  pname = "[a-z]" + pnameEnd.replace( "[", "[^/\\0" ) + "*",
            -
            -  // Void element (end tag prohibited)
            -  // https://html.spec.whatwg.org/multipage/syntax.html#void-elements
            -  pvoidName = "(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|" +
            -    "source|track|wbr)(?=" + pnameEnd + ")",
            -
            -  // Attributes (double-quoted value, single-quoted value, unquoted value, or no value)
            -  // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
            -  pattrs = "(?:" + pspace + "+[^\\0-\\x20\\x7f-\\x9f=\"'/>]+(?:" + pspace + "*=" + pspace +
            -    "*(?:\"" + panything + "\"|'" + panything + "'|" +
            -    pnameEnd.replace( "[", "[^" ) + "*(?!/)" +
            -    ")|))*" + pspace + "*",
            -
            -  // Trailing content of a close tag
            -  pcloseTail = "(?:" + pspace + panything + "|)",
            -
            -  rspecialHtml = new RegExp(
            -    // Non-void element that self-closes: $1–$5
            -    "(<)(?!" + pvoidName + ")(" + pname + ")(" + pattrs + ")(\\/)(>)|" +
            -      // No-innerHTML container (element, comment, or CDATA): $6
            -      "(<(script|style|textarea)" + pattrs + ">" + panything + "<\\/\\7" + pcloseTail + ">|" +
            -      "<!--" + panything + "--)",
            -    "gi"
            -  ),
            -
            -  // "<"; element name; attributes; ">"; "<"; "/"; element name; ">"; no-innerHTML container
            -  pspecialReplacement = "$1$2$3$5$1$4$2$5$6";
            -
            -$.htmlPrefilter = function( html ) {
            -  return ( html + "" ).replace( rspecialHtml, pspecialReplacement );
            -};
            -    
            +

            This method rarely needs to be called directly. Instead, use it as an entry point to modify existing jQuery manipulation methods. jQuery calls this method on input HTML before processing it further: it accepts an HTML string & should return a HTML string as well.

            +

            This function can also be overwritten in order to bypass certain edge case issues. The default htmlPrefilter function in jQuery leaves input unmodified since 3.5.0. Older versions would greedily ensure that all tags were XHTML-compliant. This included anything that looked like an HTML tag, but was actually within a string (e.g. <a title="<div />"><>), leading to potential security issues. For more information, see the jQuery Core 3.5 Upgrade guide.

            +
            diff --git a/entries/jQuery.isArray.xml b/entries/jQuery.isArray.xml index 6f040c4e..6ce958df 100644 --- a/entries/jQuery.isArray.xml +++ b/entries/jQuery.isArray.xml @@ -1,5 +1,5 @@ - + jQuery.isArray() 1.3 @@ -9,6 +9,9 @@ Determine whether the argument is an array. +
            +

            Note: This API has been deprecated in jQuery 3.2; please use the native Array.isArray method instead.

            +

            $.isArray() returns a Boolean indicating whether the object is a JavaScript array (not an array-like object, such as a jQuery object).

            @@ -22,4 +25,5 @@ Is [] an Array? +
            diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml index 7aed5574..3524ace2 100644 --- a/entries/jQuery.isFunction.xml +++ b/entries/jQuery.isFunction.xml @@ -9,7 +9,9 @@ Determines if its argument is callable as a function. -

            As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".

            +
            +

            As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".

            +

            Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

            diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index b51eb84d..7e64d4b7 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -1,5 +1,5 @@ - + jQuery.isNumeric() Determines whether its argument represents a JavaScript number. @@ -9,6 +9,9 @@ +
            +

            Note: This API has been deprecated in jQuery 3.3.

            +

            The $.isNumeric() method checks whether its argument represents a numeric value. If so, it returns true. Otherwise it returns false. The argument can be of any type.

            As of jQuery 3.0 $.isNumeric() returns true only if the argument is of type number, or if it's of type string and it can be coerced into finite numbers. In all other cases, it returns false.

            @@ -39,4 +42,5 @@ $.isNumeric( undefined )
            +
            diff --git a/entries/jQuery.isWindow.xml b/entries/jQuery.isWindow.xml index ee8ed3b1..e79a95a7 100644 --- a/entries/jQuery.isWindow.xml +++ b/entries/jQuery.isWindow.xml @@ -9,6 +9,12 @@ Determine whether the argument is a window. +
            +

            Note: This API has been deprecated in jQuery 3.3; if you need this function, reimplement it by yourself:

            + +

            This is used in a number of places in jQuery to determine if we're operating against a browser window (such as the current window or an iframe).

            diff --git a/entries/jQuery.now.xml b/entries/jQuery.now.xml index 6c41af36..b482637c 100644 --- a/entries/jQuery.now.xml +++ b/entries/jQuery.now.xml @@ -1,13 +1,17 @@ - + jQuery.now() 1.4.3 Return a number representing the current time. -

            The $.now() method is a shorthand for the number returned by the expression (new Date).getTime().

            +
            +

            Note: This API has been deprecated in jQuery 3.3; please use the native Date.now() method instead.

            +
            +

            The $.now() method is an alias for Date.now().

            -
            \ No newline at end of file + +
            diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 06e353f8..9be8d43b 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -22,7 +22,7 @@ - 1.12/2.2 + 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. @@ -167,4 +167,5 @@ $( "#searchForm" ).submit(function( event ) { + diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index e7c5f0ff..d00748b9 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -1,5 +1,5 @@ - + jQuery.proxy() 1.4 @@ -46,6 +46,9 @@ Takes a function and returns a new one that will always have a particular context. +
            +

            Note: This API has been deprecated in jQuery 3.3; please use the native Function.prototype.bind method instead.

            +

            This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

            Be aware, however, that jQuery's event binding subsystem assigns a unique id to each event handling function in order to track it when it is used to specify the function to be unbound. The function represented by jQuery.proxy() is seen as a single function by the event subsystem, even when it is used to bind different contexts. To avoid unbinding the wrong handler, use a unique event namespace for binding and unbinding (e.g., "click.myproxy1") rather than specifying the proxied function during unbinding.

            As of jQuery 1.6, any number of additional arguments may be supplied to $.proxy(), and they will be passed to the function whose context will be changed.

            @@ -170,4 +173,5 @@ $( "#test" ) +
            diff --git a/entries/jQuery.trim.xml b/entries/jQuery.trim.xml index d0dcfa68..cac7e358 100644 --- a/entries/jQuery.trim.xml +++ b/entries/jQuery.trim.xml @@ -1,5 +1,5 @@ - + jQuery.trim() 1.0 @@ -9,6 +9,9 @@ Remove the whitespace from the beginning and end of a string. +
            +

            Note: This API has been deprecated in jQuery 3.5; please use the native String.prototype.trim method instead.

            +

            The $.trim() function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.

            @@ -34,4 +37,5 @@ $.trim(" hello, how are you? "); +
            diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml index 26dbe913..b9ce8a8e 100644 --- a/entries/jQuery.type.xml +++ b/entries/jQuery.type.xml @@ -1,5 +1,5 @@ - + jQuery.type() 1.4.3 @@ -9,6 +9,9 @@ Determine the internal JavaScript [[Class]] of an object. +
            +

            Note: This API has been deprecated in jQuery 3.3.

            +

            A number of techniques are used to determine the exact return value for an object. The [[Class]] is determined as follows:

            • If the object is undefined or null, then "undefined" or "null" is returned accordingly. @@ -24,16 +27,16 @@
            • jQuery.type( true ) === "boolean"
            • jQuery.type( new Boolean() ) === "boolean"
            • jQuery.type( 3 ) === "number"
            • -
            • jQuery.type( new Number(3) ) === "number"
            • +
            • jQuery.type( new Number( 3 ) ) === "number"
            • jQuery.type( "test" ) === "string"
            • -
            • jQuery.type( new String("test") ) === "string"
            • -
            • jQuery.type( function(){} ) === "function"
            • +
            • jQuery.type( new String( "test" ) ) === "string"
            • +
            • jQuery.type( function() {} ) === "function"
            • jQuery.type( [] ) === "array"
            • jQuery.type( new Array() ) === "array"
            • jQuery.type( new Date() ) === "date"
            • jQuery.type( new Error() ) === "error" // as of jQuery 1.9
            • jQuery.type( Symbol() ) === "symbol" // as of jQuery 1.9
            • -
            • jQuery.type( Object(Symbol()) ) === "symbol" // as of jQuery 1.12
            • +
            • jQuery.type( Object( Symbol() ) ) === "symbol" // as of jQuery 1.12
            • jQuery.type( /test/ ) === "regexp"
            @@ -51,4 +54,5 @@ Is it a RegExp?
            + diff --git a/entries/jQuery.uniqueSort.xml b/entries/jQuery.uniqueSort.xml index 006b4ad9..9d149af3 100644 --- a/entries/jQuery.uniqueSort.xml +++ b/entries/jQuery.uniqueSort.xml @@ -2,7 +2,7 @@ jQuery.uniqueSort() - 1.12-2.2 + 1.12-and-2.2 The Array of DOM elements. @@ -42,5 +42,5 @@ $( "div" ).eq( 2 ).text( "Post-unique there are " + divs.length + " elements." ) ]]> - + diff --git a/entries/last-selector.xml b/entries/last-selector.xml index 42cd8490..128eec49 100644 --- a/entries/last-selector.xml +++ b/entries/last-selector.xml @@ -7,7 +7,9 @@ Selects the last matched element. -

            As of jQuery 3.4, the :last pseudo-class is deprecated. Remove it from your selectors and filter the results later using .last().

            +
            +

            As of jQuery 3.4, the :last pseudo-class is deprecated. Remove it from your selectors and filter the results later using .last().

            +

            Note that :last selects a single element by filtering the current jQuery collection and matching the last element within it.

            diff --git a/entries/last.xml b/entries/last.xml index 4f9b59df..73ddafa5 100644 --- a/entries/last.xml +++ b/entries/last.xml @@ -24,17 +24,22 @@ $( "li" ).last().css( "background-color", "red" );

            The result of this call is a red background for the final item.

            - Highlight the last span in a paragraph. + Highlight the last item in a list. diff --git a/entries/lt-selector.xml b/entries/lt-selector.xml index d8c893ea..703c427f 100644 --- a/entries/lt-selector.xml +++ b/entries/lt-selector.xml @@ -17,7 +17,9 @@ Select all elements at an index less than index within the matched set. -

            As of jQuery 3.4, the :lt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :lt(3) can be replaced with a call to .slice( 0, 3 ).

            +
            +

            As of jQuery 3.4, the :lt pseudo-class is deprecated. Remove it from your selectors and filter the results later using .slice(). For example, :lt(3) can be replaced with a call to .slice( 0, 3 ).

            +

            index-related selectors

            diff --git a/entries/not.xml b/entries/not.xml index a9a0880d..8a41ddf1 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -40,9 +40,9 @@

            We can apply this method to the set of list items:

            
            -$( "li" ).not( ":even" ).css( "background-color", "red" );
            +$( "li" ).not( ":nth-child(2n)" ).css( "background-color", "red" );
                 
            -

            The result of this call is a red background for items 2 and 4, as they do not match the selector (recall that :even and :odd use 0-based indexing).

            +

            The result of this call is a red background for items 1, 3 and 5, as they do not match the selector.

            Removing Specific Elements

            The second version of the .not() method allows us to remove elements from the matched set, assuming we have found those elements previously by some other means. For example, suppose our list had an id applied to one of its items:

            
            diff --git a/entries/nth-child-selector.xml b/entries/nth-child-selector.xml
            index 7ea6c417..741052a1 100644
            --- a/entries/nth-child-selector.xml
            +++ b/entries/nth-child-selector.xml
            @@ -51,12 +51,17 @@ $( "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...
            +    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...
                 
            @@ -94,8 +99,8 @@ $( "button" ).click(function() {
             
            - - + +
            diff --git a/entries/odd-selector.xml b/entries/odd-selector.xml index 029f2e72..8b907e15 100644 --- a/entries/odd-selector.xml +++ b/entries/odd-selector.xml @@ -5,8 +5,11 @@ 1.0 - Selects odd elements, zero-indexed. See also even. + Selects odd elements, zero-indexed. See also :even. +
            +

            As of jQuery 3.4, the :odd pseudo-class is deprecated. Remove it from your selectors and filter the results later using .odd() (available in jQuery 3.5.0 or newer).

            +

            In particular, note that the 0-based indexing means that, counter-intuitively, :odd selects the second element, fourth element, and so on within the matched set.

            diff --git a/entries/odd.xml b/entries/odd.xml new file mode 100644 index 00000000..52fe3baf --- /dev/null +++ b/entries/odd.xml @@ -0,0 +1,47 @@ + + + .odd() + + 3.5 + + Reduce the set of matched elements to the odd ones in the set, numbered from zero. + +

            Given a jQuery object that represents a set of DOM elements, the .odd() method constructs a new jQuery object from the odd elements in that set. Counting starts from zero!

            +

            Consider a page with a simple list on it:

            +
            
            +<ul>
            +  <li>list item 1</li>
            +  <li>list item 2</li>
            +  <li>list item 3</li>
            +  <li>list item 4</li>
            +  <li>list item 5</li>
            +</ul>
            +    
            +

            We can apply this method to the set of list items:

            +
            
            +$( "li" ).odd().css( "background-color", "red" );
            +    
            +

            The result of this call is a red background for the second & 4th items.

            +
            + + Highlight the odd items in a list. + + + + + + +
            diff --git a/entries/removeClass.xml b/entries/removeClass.xml index c6171f2e..03b02f0c 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -7,18 +7,24 @@ One or more space-separated classes to be removed from the class attribute of each matched element. + + 3.3 + + An array of classes to be removed from the class attribute of each matched element. + + 1.4 - A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + A function returning one or more space-separated classes or an array of classes to be removed. Receives the index position of the element in the set and the old class value as arguments. Remove a single class, multiple classes, or all classes from each element in the set of matched elements. -

            If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.

            +

            If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no classes are specified in the parameter, all classes will be removed.

            Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

            As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

            More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

            @@ -42,7 +48,7 @@ $( "li" ).last().removeClass(function() { Remove the class 'blue' from the matched elements.
            + + + + + Remove the class 'blue' and 'under' from the matched elements (3.3+ syntax). + Date: Fri, 17 Jul 2020 04:53:42 -0400 Subject: [PATCH 871/998] jQuery.post: Indicate POST is mainly for sending data, not receiving it --- entries/jQuery.post.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.post.xml b/entries/jQuery.post.xml index 9be8d43b..7d8f86b7 100644 --- a/entries/jQuery.post.xml +++ b/entries/jQuery.post.xml @@ -27,7 +27,7 @@ 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. - Load data from the server using a HTTP POST request. + Send data to the server using a HTTP POST request.

            This is a shorthand Ajax function, which is equivalent to:

            
            
            From cd40fa30b230f0872e47a5d3c7286cacce7a767f Mon Sep 17 00:00:00 2001
            From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
             
            Date: Fri, 17 Jul 2020 10:54:00 +0200
            Subject: [PATCH 872/998] 3.0.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 29336a52..3c2567dd 100644
            --- a/package-lock.json
            +++ b/package-lock.json
            @@ -1,6 +1,6 @@
             {
               "name": "api.jquery.com",
            -  "version": "3.0.0",
            +  "version": "3.0.1",
               "lockfileVersion": 1,
               "requires": true,
               "dependencies": {
            diff --git a/package.json b/package.json
            index 1b2ee2b3..7c9ce0a0 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.0.0",
            +  "version": "3.0.1",
               "homepage": "https://github.com/jquery/api.jquery.com",
               "author": {
                 "name": "jQuery Foundation and other contributors"
            
            From 1cdfd83eab82e8927aa6fe4f194539fa61b26906 Mon Sep 17 00:00:00 2001
            From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
             
            Date: Mon, 20 Jul 2020 18:41:13 +0200
            Subject: [PATCH 873/998] jQuery.globalEval: Document the document parameter
            
            Since jQuery 3.5.0, jQuery.globalEval accepts an optional third parameter
            accepting a document in which context the code will be evaluated.
            
            This commit also adds the Document type and links it to one of the jQuery
            signatures; so far it was using `type="document"` which linked to a non-existent
            types section.
            
            Closes gh-1168
            Ref jquery/jquery#4601
            ---
             entries/jQuery.globalEval.xml | 14 ++++++++++++++
             entries/jQuery.xml            |  2 +-
             pages/Types.html              |  2 ++
             3 files changed, 17 insertions(+), 1 deletion(-)
            
            diff --git a/entries/jQuery.globalEval.xml b/entries/jQuery.globalEval.xml
            index 1900cd78..19b9f9c9 100644
            --- a/entries/jQuery.globalEval.xml
            +++ b/entries/jQuery.globalEval.xml
            @@ -18,6 +18,20 @@
                   
                 
               
            +  
            +    3.5.0
            +    
            +      The JavaScript code to execute.
            +    
            +    
            +      
            +        The nonce attribute passed to the executed script.
            +      
            +    
            +    
            +      A document in which context the code will be evaluated.
            +    
            +  
               Execute some JavaScript code globally.
               
                 

            This method behaves differently from using a normal JavaScript eval() in that it's executed within the global context (which is important for loading external scripts dynamically).

            diff --git a/entries/jQuery.xml b/entries/jQuery.xml index b31102b5..5e549a7d 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -155,7 +155,7 @@ $( myForm.elements ).hide(); A string of HTML to create on the fly. Note that this parses HTML, not XML. - + A document in which the new elements will be created. diff --git a/pages/Types.html b/pages/Types.html index 6221434f..ad8285ae 100644 --- a/pages/Types.html +++ b/pages/Types.html @@ -663,6 +663,8 @@

            Promise Object

            Callbacks Object

            A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the $.Callbacks function and subsequently returned by most of that function's methods.

            +

            Document

            +

            A document object created by the browser's DOM parser, usually from a string representing HTML or XML.

            XML Document

            A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

            Assert

            From 44e75edd8c509bdae2b851e11137dd199c97b6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 20 Jul 2020 18:41:33 +0200 Subject: [PATCH 874/998] 3.0.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 3c2567dd..5820926b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7c9ce0a0..b1f03952 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.0.1", + "version": "3.0.2", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 1e3b1639dfd141ed985ae0297441294bf3db3308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 27 Jul 2020 19:06:59 +0200 Subject: [PATCH 875/998] jQuery: Document the jQuery(selector, selector) signature Fixes gh-1060 Closes gh-1169 --- entries/jQuery.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 5e549a7d..a2be2248 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -11,7 +11,8 @@ - A DOM Element, Document, or jQuery to use as context + + A DOM Element, Document, jQuery or selector to use as context From f40063eb0d058562c076fd1b1fd4425fe77e83db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 27 Jul 2020 19:07:35 +0200 Subject: [PATCH 876/998] jQuery.extend: Separate the one-argument signature from the multiple-arguments one This is done to reduce the confusion as the single-argument signature behaves completely differently than the other one. Ref jquery/jquery#4748 Fixes gh-1164 Closes gh-1170 --- entries/jQuery.extend.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 56fbab89..47262615 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -4,9 +4,9 @@ 1.0 - An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + An object that will receive the new properties. - + An object containing additional properties to merge in. @@ -28,6 +28,12 @@ Additional objects containing properties to merge in. + + 1.0 + + An object to merge onto the jQuery namespace. + + Merge the contents of two or more objects together into the first object.

            When two or more object arguments are supplied to $.extend(), properties from all of the objects are added to the target object. Arguments that are null or undefined are ignored.

            From 93102d393d6753df9ad7e8366853ba066e895c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 27 Jul 2020 22:52:28 +0200 Subject: [PATCH 877/998] 3.0.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 5820926b..25a7f281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b1f03952..49b85638 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.0.2", + "version": "3.0.3", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2c22351912ac3c9d1f771de8509c94c3b6ad793f Mon Sep 17 00:00:00 2001 From: Rani Kheir <56330674+rani-k@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:58:20 -0700 Subject: [PATCH 878/998] jQuery.get: Add an example using a root-relative path Added a `jQuery.get()` example to show how to request a different page from the root of the same domain. Closes gh-1152 --- entries/jQuery.get.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index 55009de2..16b764d4 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -116,13 +116,24 @@ $.get( "test.cgi", { name: "John", time: "2pm" } ) ]]>
            - Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + + + Get another page on the same domain. Outputs to console both the data returned and the type of data returned. + From 77c9c6db7fd7a99a11ae7b3f4323a0c7f67ecb09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Tue, 11 Aug 2020 20:58:42 +0200 Subject: [PATCH 879/998] 3.0.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 25a7f281..6c4eb2fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 49b85638..58c86cbf 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.0.3", + "version": "3.0.4", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 5120543c7030f0b8e2db45b0c561cb3e494cbaac Mon Sep 17 00:00:00 2001 From: Sedat Kapanoglu Date: Mon, 24 Aug 2020 12:50:59 -0700 Subject: [PATCH 880/998] jQuery.trim: Describe differences between String#trim & jQuery.trim `jQuery.trim` supports non-string arguments while `String#trim` does not. Note these differences. Fixes gh-1174 Closes gh-1175 --- entries/jQuery.trim.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.trim.xml b/entries/jQuery.trim.xml index cac7e358..6732a155 100644 --- a/entries/jQuery.trim.xml +++ b/entries/jQuery.trim.xml @@ -10,7 +10,7 @@ Remove the whitespace from the beginning and end of a string.
            -

            Note: This API has been deprecated in jQuery 3.5; please use the native String.prototype.trim method instead.

            +

            Note: This API has been deprecated in jQuery 3.5; please use the native String.prototype.trim method instead. Unlike jQuery.trim, String.prototype.trim does not work with types other than strings (null, undefined, Number). Make sure that your code is compatible when migrating.

            The $.trim() function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.

            From df1f7b00faf6bd5ea229ac2dd92e032d1ce2c65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 24 Aug 2020 21:51:49 +0200 Subject: [PATCH 881/998] jQuery.ajax: Document special handling of a double question mark Fixes gh-999 Closes gh-1171 Ref gh-1005 Co-authored-by: Dave Methvin --- entries/jQuery.ajax.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index dfe7f3cc..991e23ee 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -84,7 +84,12 @@ $.ajax({ - Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + +

            Data to be sent to the server. If the HTTP method is one that cannot have an entity body, such as GET, the data is appended to the URL.

            +

            When data is an object, jQuery generates the data string from the object's key/value pairs unless the processData option is set to false. For example, { a: "bc", d: "e,f" } is converted to the string "a=bc&d=e%2Cf". If the value is an array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). For example, { a: [1,2] } becomes the string "a%5B%5D=1&a%5B%5D=2" with the default traditional: false setting.

            +

            When data is passed as a string it should already be encoded using the correct encoding for contentType, which by default is application/x-www-form-urlencoded.

            +

            In requests with dataType: "json" or dataType: "jsonp", if the string contains a double question mark (??) anywhere in the URL or a single question mark (?) in the query string, it is replaced with a value generated by jQuery that is unique for each copy of the library on the page (e.g. jQuery21406515378922229067_1479880736745).

            +
            From 17ab5dbe56c677f67fb7c2d08853f1883abbc41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Mon, 24 Aug 2020 21:53:32 +0200 Subject: [PATCH 882/998] 3.0.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 6c4eb2fe..24da4a28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.4", + "version": "3.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 58c86cbf..d9de68ab 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.0.4", + "version": "3.0.5", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 9d500d69e3b573d19ea885da14333e2fe6de51c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Dec 2020 20:40:50 +0100 Subject: [PATCH 883/998] Build: Bump ini from 1.3.5 to 1.3.7 Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Closes gh-1179 Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24da4a28..a381061f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1048,9 +1048,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" }, "interpret": { "version": "1.1.0", From 92dc5273b529f6d9b0629904080933fe5b100452 Mon Sep 17 00:00:00 2001 From: Jian Zhang Date: Tue, 19 Jan 2021 05:42:10 +0800 Subject: [PATCH 884/998] Fixed a contradiction about .attr("checked") Close #288. --- entries/attr.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/entries/attr.xml b/entries/attr.xml index 2dc8a25e..825fce9b 100644 --- a/entries/attr.xml +++ b/entries/attr.xml @@ -49,17 +49,10 @@ $( elem ).attr( "checked" ) - (1.6) + (1.6+) "checked" (String) Initial state of the checkbox; does not change - - - $( elem ).attr( "checked" ) - (1.6.1+) - - "checked" (String) Will change with checkbox state - $( elem ).attr( "checked" ) From e5f5d6ca8f216a037bb9896fa01d8eb766ebf6ec Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 16 Mar 2021 02:10:30 +0000 Subject: [PATCH 885/998] 3.0.6 --- 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 a381061f..12cda7a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.5", + "version": "3.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d9de68ab..5caf5041 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.0.5", + "version": "3.0.6", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From a46c18011a9b9ca82d9a7657f6f02c0e58e01b64 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:04:27 +0800 Subject: [PATCH 886/998] addClass:removeClass:toggleClass: Update function signatures From jQuery 3.3.0[1], if using a function as a argument for `.addClass`, `.removeClass` and `.toggleClass`, the function is allowed to return an `Array`. However, this was not reflected in the return types. This change documents that new signature. Closes gh-1183 [1] https://blog.jquery.com/2018/01/19/jquery-3-3-0-a-fragrant-bouquet-of-deprecations-and-is-that-a-new-feature/ --- entries/addClass.xml | 12 +++++++++++- entries/removeClass.xml | 12 +++++++++++- entries/toggleClass.xml | 16 +++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/entries/addClass.xml b/entries/addClass.xml index 9af9723a..39d6a0bf 100644 --- a/entries/addClass.xml +++ b/entries/addClass.xml @@ -16,12 +16,22 @@ 1.4 - A function returning one or more space-separated classes or an array of classes to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + + 3.3 + + A function returning one or more space-separated class names or an array of class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + + + + + + Adds the specified class(es) to each element in the set of matched elements.

            It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

            diff --git a/entries/removeClass.xml b/entries/removeClass.xml index 03b02f0c..c2daa31c 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -19,7 +19,17 @@ - A function returning one or more space-separated classes or an array of classes to be removed. Receives the index position of the element in the set and the old class value as arguments. + A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + + + + 3.3 + + + + + + A function returning one or more space-separated class names or an array of class names to be removed. Receives the index position of the element in the set and the old class value as arguments. Remove a single class, multiple classes, or all classes from each element in the set of matched elements. diff --git a/entries/toggleClass.xml b/entries/toggleClass.xml index a1b50ca1..3ce8196c 100644 --- a/entries/toggleClass.xml +++ b/entries/toggleClass.xml @@ -39,7 +39,21 @@ - A function that returns one or more space-separated classes or an array of classes to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + A function returning one or more space-separated class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. + + + A boolean value to determine whether the class should be added or removed. + + + + 3.3 + + + + + + + A function returning one or more space-separated class names or an array of class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. A boolean value to determine whether the class should be added or removed. From 07862e9a040f1ec3f3c6a0d2e708aa8542d1bf31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 8 Apr 2021 15:05:17 +0200 Subject: [PATCH 887/998] 3.0.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 12cda7a5..fe1001fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.6", + "version": "3.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5caf5041..31e00bc5 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.0.6", + "version": "3.0.7", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From c887da7acdf4d4bb2631b6d96f5e38d046527243 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 May 2021 11:15:24 +0200 Subject: [PATCH 888/998] Build: Bump grunt from 1.0.4 to 1.3.0 Bumps [grunt](https://github.com/gruntjs/grunt) from 1.0.4 to 1.3.0. - [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.0.4...v1.3.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Closes gh-1186 --- package-lock.json | 537 ++++++++-------------------------------------- package.json | 2 +- 2 files changed, 91 insertions(+), 448 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe1001fd..59f15e7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,11 +24,11 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "argparse": { @@ -66,11 +66,6 @@ "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", @@ -87,9 +82,9 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" }, "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, "atob": { "version": "2.1.2", @@ -203,28 +198,13 @@ "unset-value": "^1.0.0" } }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, "cheerio": { @@ -267,11 +247,6 @@ } } }, - "coffeescript": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", - "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4=" - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -282,17 +257,17 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "colors": { "version": "1.1.2", @@ -319,22 +294,10 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } - }, "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "requires": { - "get-stdin": "^4.0.1", - "meow": "^3.3.0" - } + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" }, "debug": { "version": "2.6.9", @@ -344,11 +307,6 @@ "ms": "2.0.0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", @@ -438,19 +396,6 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -610,15 +555,6 @@ } } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "findup-sync": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", @@ -684,20 +620,15 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, "getobject": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", - "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.0.tgz", + "integrity": "sha512-tbUz6AKKKr2YiMB+fLWIgq5ZeBOobop9YMMAU9dC54/ot2ksMXt3DOFyBuhZw6ptcVszEykgByK20j7W9jHFag==" }, "gilded-wordpress": { "version": "1.0.5", @@ -736,14 +667,14 @@ } }, "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.2", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -770,51 +701,26 @@ "which": "^1.2.14" } }, - "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" - }, "grunt": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.4.tgz", - "integrity": "sha512-PYsMOrOC+MsdGEkFVwMaMyc6Ob7pKmq+deg1Sjr+vvMWp35sztfwKE7qoN51V+UEtHsyNuMcGdgMLFkBHvMxHQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz", + "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==", "requires": { - "coffeescript": "~1.10.0", - "dateformat": "~1.0.12", + "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", - "exit": "~0.1.1", + "exit": "~0.1.2", "findup-sync": "~0.3.0", - "glob": "~7.0.0", - "grunt-cli": "~1.2.0", + "glob": "~7.1.6", + "grunt-cli": "~1.3.2", "grunt-known-options": "~1.1.0", - "grunt-legacy-log": "~2.0.0", - "grunt-legacy-util": "~1.1.1", + "grunt-legacy-log": "~3.0.0", + "grunt-legacy-util": "~2.0.0", "iconv-lite": "~0.4.13", - "js-yaml": "~3.13.0", - "minimatch": "~3.0.2", - "mkdirp": "~0.5.1", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "mkdirp": "~1.0.4", "nopt": "~3.0.6", - "path-is-absolute": "~1.0.0", - "rimraf": "~2.6.2" - }, - "dependencies": { - "grunt-cli": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", - "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", - "requires": { - "findup-sync": "~0.3.0", - "grunt-known-options": "~1.1.0", - "nopt": "~3.0.6", - "resolve": "~1.1.0" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" - } + "rimraf": "~3.0.2" } }, "grunt-check-modules": { @@ -886,37 +792,47 @@ "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==" }, "grunt-legacy-log": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", - "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", + "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==", "requires": { "colors": "~1.1.2", - "grunt-legacy-log-utils": "~2.0.0", + "grunt-legacy-log-utils": "~2.1.0", "hooker": "~0.2.3", - "lodash": "~4.17.5" + "lodash": "~4.17.19" } }, "grunt-legacy-log-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", - "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz", + "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==", "requires": { - "chalk": "~2.4.1", - "lodash": "~4.17.10" + "chalk": "~4.1.0", + "lodash": "~4.17.19" } }, "grunt-legacy-util": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", - "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz", + "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==", "requires": { - "async": "~1.5.2", - "exit": "~0.1.1", - "getobject": "~0.1.0", + "async": "~3.2.0", + "exit": "~0.1.2", + "getobject": "~1.0.0", "hooker": "~0.2.3", - "lodash": "~4.17.10", - "underscore.string": "~3.3.4", - "which": "~1.3.0" + "lodash": "~4.17.21", + "underscore.string": "~3.3.5", + "which": "~2.0.2" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } } }, "grunt-wordpress": { @@ -928,9 +844,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-value": { "version": "1.0.0", @@ -984,11 +900,6 @@ "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" }, - "hosted-git-info": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.4.tgz", - "integrity": "sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ==" - }, "htmlparser2": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz", @@ -1025,14 +936,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1084,11 +987,6 @@ } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -1139,14 +1037,6 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-glob": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", @@ -1197,11 +1087,6 @@ "unc-path-regex": "^0.1.2" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -1223,9 +1108,9 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -1264,31 +1149,10 @@ } } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "make-iterator": { "version": "1.0.1", @@ -1303,11 +1167,6 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -1321,23 +1180,6 @@ "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -1366,11 +1208,6 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -1391,19 +1228,9 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - } - } + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "ms": { "version": "2.0.0", @@ -1436,27 +1263,6 @@ "abbrev": "1" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -1558,14 +1364,6 @@ "path-root": "^0.1.1" } }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -1576,14 +1374,6 @@ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1607,58 +1397,11 @@ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -1685,15 +1428,6 @@ "resolve": "^1.1.6" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -1713,14 +1447,6 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, "resolve": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", @@ -1749,26 +1475,11 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" }, "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } } }, "safe-regex": { @@ -1789,11 +1500,6 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -1815,11 +1521,6 @@ } } }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -1944,34 +1645,6 @@ "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -2009,28 +1682,12 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "to-object-path": { @@ -2071,11 +1728,6 @@ "repeat-string": "^1.6.1" } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, "unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", @@ -2160,15 +1812,6 @@ "homedir-polyfill": "^1.0.1" } }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index 31e00bc5..d7d80011 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "grunt lint" }, "dependencies": { - "grunt": "1.0.4", + "grunt": "1.3.0", "grunt-cli": "1.3.2", "grunt-jquery-content": "3.0.3" } From a3af063201a7d2cf9666621e5312ee45849a9f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 13 May 2021 15:36:44 +0200 Subject: [PATCH 889/998] Build: Update grunt & grunt-cli --- package-lock.json | 1024 +++++---------------------------------------- package.json | 4 +- 2 files changed, 102 insertions(+), 926 deletions(-) diff --git a/package-lock.json b/package-lock.json index 59f15e7c..f614f714 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,21 +46,6 @@ } } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, "array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -71,80 +56,15 @@ "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==" }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "brace-expansion": { "version": "1.1.11", @@ -156,46 +76,11 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "fill-range": "^7.0.1" } }, "chalk": { @@ -226,36 +111,6 @@ } } }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -274,21 +129,11 @@ "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -299,56 +144,6 @@ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -411,38 +206,6 @@ "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -456,103 +219,12 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } + "to-regex-range": "^5.0.1" } }, "findup-sync": { @@ -607,23 +279,15 @@ "for-in": "^1.0.1" } }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "requires": { - "map-cache": "^0.2.2" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "getobject": { "version": "1.0.0", @@ -702,19 +366,19 @@ } }, "grunt": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.3.0.tgz", - "integrity": "sha512-6ILlMXv11/4cxuhSMfSU+SfvbxrPuqZrAtLN64+tZpQ3DAKfSQPQHRbTjSbdtxfyQhGZPtN0bDZJ/LdCM5WXXA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.4.0.tgz", + "integrity": "sha512-yRFc0GVCDu9yxqOFzpuXQ2pEdgtLDnFv5Qz54jfIcNnpJ8Z7B7P7kPkT4VMuRvm+N+QOsI8C4v/Q0DSaoj3LgQ==", "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.3.2", - "grunt-known-options": "~1.1.0", + "grunt-cli": "~1.4.2", + "grunt-known-options": "~1.1.1", "grunt-legacy-log": "~3.0.0", - "grunt-legacy-util": "~2.0.0", + "grunt-legacy-util": "~2.0.1", "iconv-lite": "~0.4.13", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", @@ -729,21 +393,21 @@ "integrity": "sha1-fBZB28ZlSGdqbVl5Ga35C3s11kQ=" }, "grunt-cli": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", - "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", + "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.0", + "grunt-known-options": "~1.1.1", "interpret": "~1.1.0", - "liftoff": "~2.5.0", + "liftup": "~3.0.1", "nopt": "~4.0.1", - "v8flags": "~3.1.1" + "v8flags": "~3.2.0" }, "dependencies": { "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "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" @@ -843,40 +507,19 @@ "gilded-wordpress": "1.0.5" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "he": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", @@ -951,9 +594,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "interpret": { "version": "1.1.0", @@ -969,99 +612,31 @@ "is-windows": "^1.0.1" } }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } + "has": "^1.0.3" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "requires": { - "is-extglob": "^2.1.0" + "is-extglob": "^2.1.1" } }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-plain-object": { "version": "2.0.4", @@ -1093,9 +668,9 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, "isexe": { "version": "2.0.0", @@ -1117,33 +692,33 @@ } }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, - "liftoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", - "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "liftup": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", + "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==", "requires": { - "extend": "^3.0.0", - "findup-sync": "^2.0.0", - "fined": "^1.0.1", - "flagged-respawn": "^1.0.0", + "extend": "^3.0.2", + "findup-sync": "^4.0.0", + "fined": "^1.2.0", + "flagged-respawn": "^1.0.1", "is-plain-object": "^2.0.4", - "object.map": "^1.0.0", - "rechoir": "^0.6.2", - "resolve": "^1.1.7" + "object.map": "^1.0.1", + "rechoir": "^0.7.0", + "resolve": "^1.19.0" }, "dependencies": { "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", "requires": { "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", "resolve-dir": "^1.0.1" } } @@ -1167,37 +742,18 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "^1.0.0" - } - }, "marked": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.1", + "picomatch": "^2.2.3" } }, "minimatch": { @@ -1208,53 +764,11 @@ "brace-expansion": "^1.1.7" } }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -1263,42 +777,6 @@ "abbrev": "1" } }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "^3.0.0" - } - }, "object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", @@ -1369,11 +847,6 @@ "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1397,10 +870,10 @@ "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + "picomatch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" }, "readable-stream": { "version": "1.1.14", @@ -1411,47 +884,22 @@ "inherits": "~2.0.1", "isarray": "0.0.1", "string_decoder": "~0.10.x" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - } } }, "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", "requires": { - "resolve": "^1.1.6" + "resolve": "^1.9.0" } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "requires": { + "is-core-module": "^2.2.0", "path-parse": "^1.0.6" } }, @@ -1464,16 +912,6 @@ "global-modules": "^1.0.0" } }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1482,14 +920,6 @@ "glob": "^7.1.3" } }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "~0.1.10" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1500,183 +930,16 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, "spawnback": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "^3.0.0" - } - }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -1690,42 +953,12 @@ "has-flag": "^4.0.0" } }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "unc-path-regex": { @@ -1742,72 +975,15 @@ "util-deprecate": "^1.0.2" } }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "v8flags": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.3.tgz", - "integrity": "sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "requires": { "homedir-polyfill": "^1.0.1" } diff --git a/package.json b/package.json index d7d80011..36813e14 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "test": "grunt lint" }, "dependencies": { - "grunt": "1.3.0", - "grunt-cli": "1.3.2", + "grunt": "1.4.0", + "grunt-cli": "1.4.2", "grunt-jquery-content": "3.0.3" } } From 912b852f0ee81455b0bbe7fc3dc6355200990c90 Mon Sep 17 00:00:00 2001 From: Timmy Willison <4timmywil@gmail.com> Date: Thu, 13 May 2021 15:46:15 -0400 Subject: [PATCH 890/998] removeProp: clarify recommendations regarding native properties Ref https://github.com/jquery/jquery/issues/4887 Close gh-1189 --- entries/removeProp.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/removeProp.xml b/entries/removeProp.xml index 987ab339..cc918d29 100644 --- a/entries/removeProp.xml +++ b/entries/removeProp.xml @@ -10,8 +10,8 @@ Remove a property for the set of matched elements.

            The .removeProp() method removes properties set by the .prop() method.

            -

            With some built-in properties of a DOM element or window object, browsers may generate an error if an attempt is made to remove the property. jQuery first assigns the value undefined to the property and ignores any error the browser generates. In general, it is only necessary to remove custom properties that have been set on an object, and not built-in (native) properties.

            -

            Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.

            +

            Note:This method should not be used to remove built-in (native) properties such as "checked", "disabled", "selected", or others. This can lead to unexpected behavior.

            +

            It's almost always better to use .prop() to set native properties to false instead of removing them.

            From 17cdeda09f351226be6a8f75893ac59ff2354e01 Mon Sep 17 00:00:00 2001 From: Timmy Willison <4timmywil@gmail.com> Date: Fri, 14 May 2021 11:23:35 -0400 Subject: [PATCH 891/998] prop: change wording about removeProp Ref gh-1189 --- entries/prop.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/prop.xml b/entries/prop.xml index 49ccceda..775b8062 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -144,7 +144,7 @@ $( "input" ).prop( "disabled", false ); $( "input" ).prop( "checked", true ); $( "input" ).val( "someValue" );
            -

            Important: the .removeProp() method should not be used to set these properties to false. Once a native property is removed, it cannot be added again. See .removeProp() for more information.

            +

            Important: the .removeProp() method should not be used to remove native properties. This will lead to unexpected behavior. See .removeProp() for more information.

            Computed property values

            By using a function to set properties, you can compute the value based on other properties of the element. For example, to toggle all checkboxes based off their individual values:

            
            
            From 2eec5a9cbfcdc0950f589aa54f8ea63001c640ca Mon Sep 17 00:00:00 2001
            From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?=
             
            Date: Mon, 17 May 2021 18:33:01 +0200
            Subject: [PATCH 892/998] CSS: Make it clear !important is not guaranteed to
             not work with `.css()`
            
            Closes gh-1188
            ---
             entries/css.xml | 6 +++---
             1 file changed, 3 insertions(+), 3 deletions(-)
            
            diff --git a/entries/css.xml b/entries/css.xml
            index 0fd97457..896cd4ca 100644
            --- a/entries/css.xml
            +++ b/entries/css.xml
            @@ -19,7 +19,7 @@
                 
                   

            The .css() method is a convenient way to get a computed style property from the first matched element, especially in light of the different ways browsers access most of those properties (the getComputedStyle() method in standards-based browsers versus the currentStyle and runtimeStyle properties in Internet Explorer prior to version 9) and the different terms browsers use for certain properties. For example, Internet Explorer's DOM implementation refers to the float property as styleFloat, while W3C standards-compliant browsers refer to it as cssFloat. For consistency, you can simply use "float", and jQuery will translate it to the correct value for each browser.

            Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css( "background-color" ) and .css( "backgroundColor" ). This means mixed case has a special meaning, .css( "WiDtH" ) won't do the same as .css( "width" ), for example.

            -

            Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

            +

            Note that the computed style of an element may not be the same as the value specified for that element in a style sheet. For example, computed styles of dimensions are almost always pixels, but they can be specified as em, ex, px or % in a style sheet. Different browsers may return CSS color values that are logically but not textually equal, e.g., #FFF, #ffffff, and rgb(255,255,255).

            Retrieval of shorthand CSS properties (e.g., margin, background, border), although functional with some browsers, is not guaranteed. For example, if you want to retrieve the rendered border-width, use: $( elem ).css( "borderTopWidth" ), $( elem ).css( "borderBottomWidth" ), and so on.

            An element should be connected to the DOM when calling .css() on it. If it isn't, jQuery may throw an error.

            As of jQuery 1.9, passing an array of style properties to .css() will result in an object of property-value pairs. For example, to retrieve all four rendered border-width values, you could use $( elem ).css([ "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth" ]).

            @@ -130,7 +130,7 @@ $( "div" ).click(function() { A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. - + @@ -148,7 +148,7 @@ $( "div" ).click(function() {

            Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.

            When a number is passed as the value, jQuery will convert it to a string and add px to the end of that string. If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.

            When using .css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element.

            -

            Note: .css() ignores !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red. It's strongly advised to use classes instead; otherwise use a jQuery plugin.

            +

            Note: .css() doesn't support !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red as of jQuery 3.6.0. Do not depend on that not working, though, as a future version of jQuery may add support for such declarations. It's strongly advised to use classes instead; otherwise use a jQuery plugin.

            As of jQuery 1.8, the .css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.

            As of jQuery 1.6, .css() accepts relative values similar to .animate(). Relative values are a string starting with += or -= to increment or decrement the current value. For example, if an element's padding-left was 10px, .css( "padding-left", "+=15" ) would result in a total padding-left of 25px.

            As of jQuery 1.4, .css() allows us to pass a function as the property value:

            From ab8a2d3c0de868a30e1828247520e4f6e0361dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Thu, 20 May 2021 18:06:11 +0200 Subject: [PATCH 893/998] removeClass: Separate the signature with no parameters signatures until one read the description. Closes gh-1187 --- entries/removeClass.xml | 369 +++++++++++++++++++++------------------- 1 file changed, 194 insertions(+), 175 deletions(-) diff --git a/entries/removeClass.xml b/entries/removeClass.xml index c2daa31c..2edb382d 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -1,177 +1,196 @@ - - .removeClass() - - 1.0 - - One or more space-separated classes to be removed from the class attribute of each matched element. - - - - 3.3 - - An array of classes to be removed from the class attribute of each matched element. - - - - 1.4 - - - - - A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. - - - - 3.3 - - - - - - A function returning one or more space-separated class names or an array of class names to be removed. Receives the index position of the element in the set and the old class value as arguments. - - + Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - -

            If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no classes are specified in the parameter, all classes will be removed.

            -

            Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

            -

            As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

            -

            More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

            -
            
            -$( "p" ).removeClass( "myClass yourClass" )
            -    
            -

            This method is often used with .addClass() to switch elements' classes from one to another, like so:

            -
            
            -$( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );
            -    
            -

            Here, the myClass and noClass classes are removed from all paragraphs, while yourClass is added.

            -

            To replace all existing classes with another class, we can use .attr( "class", "newClass" ) instead.

            -

            As of jQuery 1.4, the .removeClass() method allows us to indicate the class to be removed by passing in a function.

            -
            
            -$( "li" ).last().removeClass(function() {
            -  return $( this ).prev().attr( "class" );
            -});
            -    
            -

            This example removes the class name of the penultimate <li> from the last <li>.

            -
            - - Remove the class 'blue' from the matched elements. - - - - - - Remove the class 'blue' and 'under' from the matched elements. - - - - - - Remove the class 'blue' and 'under' from the matched elements (3.3+ syntax). - - - - - - Remove all the classes from the matched elements. - - - - - - - - - - - -
            + + .removeClass( classes ) + + 1.0 + + One or more space-separated classes to be removed from the class attribute of each matched element. + + + + 3.3 + + An array of classes to be removed from the class attribute of each matched element. + + + + 1.4 + + + + + A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + + + + 3.3 + + + + + + A function returning one or more space-separated class names or an array of class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + + + Remove a single class or multiple classes from each element in the set of matched elements. + +

            Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

            +

            As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

            +

            More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:

            +
            
            +  $( "p" ).removeClass( "myClass yourClass" )
            +      
            +

            This method is often used with .addClass() to switch elements' classes from one to another, like so:

            +
            
            +  $( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );
            +      
            +

            Here, the myClass and noClass classes are removed from all paragraphs, while yourClass is added.

            +

            To replace all existing classes with another class, we can use .attr( "class", "newClass" ) instead.

            +

            As of jQuery 1.4, the .removeClass() method allows us to indicate the class to be removed by passing in a function.

            +
            
            +  $( "li" ).last().removeClass(function() {
            +    return $( this ).prev().attr( "class" );
            +  });
            +      
            +

            This example removes the class name of the penultimate <li> from the last <li>.

            +
            + + Remove the class 'blue' from the matched elements. + + + + + + Remove the class 'blue' and 'under' from the matched elements. + + + + + + Remove the class 'blue' and 'under' from the matched elements (3.3+ syntax). + + + + + + + + + + + +
            + + + .removeClass() + + 1.0 + + Remove all classes from each matched element. + +

            Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute. Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).

            +

            As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class attribute is used instead. So, .removeClass() can be used on XML or SVG documents.

            +
            + + Remove all the classes from the matched elements. + + + + + + + + + +
            + From fe9ac2ac73d63e89b107dc0c6819308187fc535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 20 May 2021 18:16:09 +0200 Subject: [PATCH 894/998] 3.0.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 f614f714..5f77e2f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.7", + "version": "3.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 36813e14..f6ef8074 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.0.7", + "version": "3.0.8", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 4ee9b17c32188be3c045b4c596efedeea2b54ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 20 May 2021 18:21:19 +0200 Subject: [PATCH 895/998] removeClass: Tweak the page title --- entries/removeClass.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entries/removeClass.xml b/entries/removeClass.xml index 2edb382d..d66b9891 100644 --- a/entries/removeClass.xml +++ b/entries/removeClass.xml @@ -2,7 +2,7 @@ Remove a single class, multiple classes, or all classes from each element in the set of matched elements. - .removeClass( classes ) + .removeClass() 1.0 @@ -150,7 +150,6 @@ - .removeClass() 1.0 From e7ae1b435f896d2ed422d7e12f4f9bae9dd914ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 20 May 2021 18:22:14 +0200 Subject: [PATCH 896/998] 3.0.9 --- 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 5f77e2f5..3b35a43c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.8", + "version": "3.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f6ef8074..0ee5e5db 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.0.8", + "version": "3.0.9", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From e7bd4f80cc2f33d833d24250465697504aa36d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Sat, 22 May 2021 03:13:35 +0200 Subject: [PATCH 897/998] 3.0.10 --- 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 3b35a43c..2e823ed5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.9", + "version": "3.0.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0ee5e5db..61477766 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.0.9", + "version": "3.0.10", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 2afc51e3c8373c2776a5e0200599124af2320742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Sat, 22 May 2021 12:53:30 +0200 Subject: [PATCH 898/998] Build: Update grunt-jquery-content Fixes gh-1184 Closes gh-1190 --- package-lock.json | 314 ++++++++++++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 182 insertions(+), 134 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e823ed5..b638410f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,20 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "CSSselect": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/CSSselect/-/CSSselect-0.4.1.tgz", - "integrity": "sha1-+Kt+H4QYzmPNput713ioXX7EkrI=", - "requires": { - "CSSwhat": "0.4", - "domutils": "1.4" - } - }, - "CSSwhat": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/CSSwhat/-/CSSwhat-0.4.7.tgz", - "integrity": "sha1-hn2g/zn3eGEyQsRM/qg/CqTr35s=" - }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -66,6 +52,11 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -93,22 +84,26 @@ } }, "cheerio": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.17.0.tgz", - "integrity": "sha1-+lrkLMYBIRM9KW0LRtmDIV9yaOo=", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", "requires": { - "CSSselect": "~0.4.0", - "dom-serializer": "~0.0.0", + "css-select": "~1.2.0", + "dom-serializer": "~0.1.0", "entities": "~1.1.1", - "htmlparser2": "~3.7.2", - "lodash": "~2.4.1" - }, - "dependencies": { - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=" - } + "htmlparser2": "^3.9.1", + "lodash.assignin": "^4.0.9", + "lodash.bind": "^4.1.4", + "lodash.defaults": "^4.0.1", + "lodash.filter": "^4.4.0", + "lodash.flatten": "^4.2.0", + "lodash.foreach": "^4.3.0", + "lodash.map": "^4.4.0", + "lodash.merge": "^4.4.0", + "lodash.pick": "^4.2.1", + "lodash.reduce": "^4.4.0", + "lodash.reject": "^4.4.0", + "lodash.some": "^4.4.0" } }, "color-convert": { @@ -134,10 +129,21 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" }, "dateformat": { "version": "3.0.3", @@ -150,19 +156,12 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" }, "dom-serializer": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.0.1.tgz", - "integrity": "sha1-lYmCfx4y0iw3yCmtq9WbMkevjq8=", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" - } + "domelementtype": "^1.3.0", + "entities": "^1.1.1" } }, "domelementtype": { @@ -171,18 +170,19 @@ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" }, "domhandler": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.1.tgz", - "integrity": "sha1-Wd+dzSJ+gIs2Wuc+H2aErD2Ub8I=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "requires": { "domelementtype": "1" } }, "domutils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", - "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "requires": { + "dom-serializer": "0", "domelementtype": "1" } }, @@ -416,37 +416,30 @@ } }, "grunt-jquery-content": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.0.3.tgz", - "integrity": "sha1-sqFpjFTz6QZyO3cPuuRJ/ZIRXqM=", - "requires": { - "async": "0.9.0", - "cheerio": "0.17.0", - "grunt-check-modules": "1.1.0", - "grunt-wordpress": "2.1.3", - "he": "0.5.0", - "highlight.js": "7.3.0", - "marked": "0.3.2", - "rimraf": "2.2.8", - "spawnback": "1.0.0", - "which": "1.0.5", - "wordpress": "1.3.0" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/grunt-jquery-content/-/grunt-jquery-content-3.1.0.tgz", + "integrity": "sha512-9FIYqv0ML0fokZqOts7ecYR3I7pyKmvFP0WrEKcZUvgN13lBiI0JtvLfWwM3FrpiQUCIa9kZWJPJj55OPi+KMQ==", + "requires": { + "async": "^3.2.0", + "cheerio": "^0.22.0", + "grunt-check-modules": "^1.1.0", + "grunt-wordpress": "^2.1.3", + "he": "^1.2.0", + "highlight.js": "^10.7.2", + "marked": "^2.0.3", + "rimraf": "^3.0.2", + "spawnback": "^1.0.1", + "which": "^2.0.2", + "wordpress": "^1.4.1" }, "dependencies": { - "async": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", - "integrity": "sha1-rDYTsdqb7RtHUQu0ZRuJMeRxRsc=" - }, - "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" - }, "which": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", - "integrity": "sha1-VjDWgZ3aaS8UZEYueVbLQsCEJzk=" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -521,14 +514,14 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "he": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/he/-/he-0.5.0.tgz", - "integrity": "sha1-LAX/rvkLaOhg8/0rVO9YCYknfuI=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "highlight.js": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-7.3.0.tgz", - "integrity": "sha1-bF8PZOcHj2ZAK82/yJEQw/0bqZ8=" + "version": "10.7.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", + "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==" }, "homedir-polyfill": { "version": "1.0.3", @@ -544,31 +537,16 @@ "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=" }, "htmlparser2": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.7.3.tgz", - "integrity": "sha1-amTHdjfAjG8w7CqBV6UzM758sF4=", - "requires": { - "domelementtype": "1", - "domhandler": "2.2", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" - }, - "dependencies": { - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" - } + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" } }, "iconv-lite": { @@ -667,11 +645,6 @@ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -729,6 +702,66 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.assignin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", + "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=" + }, + "lodash.bind": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", + "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.filter": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", + "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=" + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" + }, + "lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" + }, + "lodash.reduce": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", + "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" + }, + "lodash.reject": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", + "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=" + }, + "lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" + }, "make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -743,9 +776,9 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, "marked": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", - "integrity": "sha1-AV2xWIZEOPJKZL3WGgQotBhwbQk=" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.5.tgz", + "integrity": "sha512-yfCEUXmKhBPLOzEC7c+tc4XZdIeTdGoRCZakFMkCxodr7wDXqoapIME4wjcpBPJLNyUnKJ3e8rb8wlAgnLnaDw==" }, "micromatch": { "version": "4.0.4", @@ -777,6 +810,14 @@ "abbrev": "1" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "requires": { + "boolbase": "~1.0.0" + } + }, "object.defaults": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", @@ -876,14 +917,13 @@ "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==" }, "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "rechoir": { @@ -920,6 +960,11 @@ "glob": "^7.1.3" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -931,9 +976,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "spawnback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.0.tgz", - "integrity": "sha1-9zZi9+VNlTZ+ynTWQmxnfdfqaG8=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.1.tgz", + "integrity": "sha512-340ZqtqJzWAZtHwaCC2gx4mdQOnkUWAWNDp7y0bCEatdjmgQ4j7b0qQ7qO5WIJWx/luNrKcrYzpKbH3NTR030A==" }, "sprintf-js": { "version": "1.1.2", @@ -941,9 +986,12 @@ "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } }, "supports-color": { "version": "7.2.0", @@ -997,9 +1045,9 @@ } }, "wordpress": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.3.0.tgz", - "integrity": "sha1-0LxIUVOktTh3B+O8yRZqDBPpcS8=", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/wordpress/-/wordpress-1.4.1.tgz", + "integrity": "sha512-U2zADxCSyyYcpgc5i7ipiDzNx6/e0zq2ldWyqTqr8n88Nj+iHd5JT/WavZkIQ+x0b9QlBv9lHoXyrqxdbckIrw==", "requires": { "xmlrpc": "1.3.2" } diff --git a/package.json b/package.json index 61477766..25d27679 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "dependencies": { "grunt": "1.4.0", "grunt-cli": "1.4.2", - "grunt-jquery-content": "3.0.3" + "grunt-jquery-content": "3.1.0" } } From 9ff4827283f7af4eeea2585ae5f4a74bb4eb9d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Sat, 22 May 2021 12:54:41 +0200 Subject: [PATCH 899/998] 3.1.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 b638410f..1129ee61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "api.jquery.com", - "version": "3.0.10", + "version": "3.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 25d27679..8001061f 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.0.10", + "version": "3.1.0", "homepage": "https://github.com/jquery/api.jquery.com", "author": { "name": "jQuery Foundation and other contributors" From 0a70489c15c90f5e721e4a5f19520f20eac21dfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 18:39:02 +0200 Subject: [PATCH 900/998] Build: Bump path-parse from 1.0.6 to 1.0.7 Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) Closes gh-1193 --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1129ee61..521a330d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -894,9 +894,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-root": { "version": "0.1.1", From 5e4ea0d9dc22ef49b0712dc07b5376114abe8b07 Mon Sep 17 00:00:00 2001 From: jayschmidgall <89083942+jayschmidgall@users.noreply.github.com> Date: Tue, 17 Aug 2021 11:11:40 -0500 Subject: [PATCH 901/998] Update attr example in prop.xml Closes #1194 --- entries/prop.xml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/entries/prop.xml b/entries/prop.xml index 775b8062..09ee042c 100644 --- a/entries/prop.xml +++ b/entries/prop.xml @@ -42,17 +42,10 @@ $( elem ).attr( "checked" ) - (1.6) + (1.6+) "checked" (String) Initial state of the checkbox; does not change - - - $( elem ).attr( "checked" ) - (1.6.1+) - - "checked" (String) Will change with checkbox state - $( elem ).attr( "checked" ) 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 902/998] 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 904/998] 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 905/998] 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 906/998] 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 907/998] 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 908/998] 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 909/998] 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 910/998] 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 911/998] 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 912/998] 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 913/998] 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 914/998] 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 915/998] 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 916/998] 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 918/998] 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 919/998] 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 920/998] 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 921/998] 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 922/998] 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 923/998] 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 925/998] 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 926/998] 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 927/998] 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 928/998] 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 930/998] 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 931/998] 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 932/998] 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 933/998] 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 934/998] 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 935/998] 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 936/998] 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 937/998] 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 938/998] 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 939/998] 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 940/998] 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 941/998] 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 942/998] 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 943/998] 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 944/998] 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 945/998] 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 946/998] 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 947/998] 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 948/998] 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 949/998] 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 = $('
        • options are the request options
        • @@ -40,7 +40,7 @@ $.ajaxTransport( function( options, originalOptions, jqXHR ) {

          completeCallback has the following signature:

          
           function( status, statusText, responses, headers ) {}
          -
          +

          where:

          • status is the HTTP status code of the response, like 200 for a typical success, or 404 for when the resource is not found.
          • @@ -51,23 +51,17 @@ function( status, statusText, responses, headers ) {}

            Just like prefilters, a transport's factory function can be attached to a specific dataType:

            
             $.ajaxTransport( "script", function( options, originalOptions, jqXHR ) {
            -    /* Will only be called for script requests */
            +    // Will only be called for script requests
             });
            -
            +

            The following example shows how a minimal image transport could be implemented:

            
             $.ajaxTransport( "image", function( s ) {
            -
               if ( s.type === "GET" && s.async ) {
            -
                 var image;
            -
                 return {
            -
                   send: function( _ , callback ) {
            -
                     image = new Image();
            -
                     function done( status ) {
                       if ( image ) {
                         var statusText = ( status == 200 ) ? "success" : "error",
            @@ -76,17 +70,14 @@ $.ajaxTransport( "image", function( s ) {
                         callback( status, statusText, { image: tmp } );
                       }
                     }
            -
                     image.onreadystatechange = image.onload = function() {
                       done( 200 );
                     };
                     image.onerror = function() {
                       done( 404 );
                     };
            -
                     image.src = s.url;
                   },
            -
                   abort: function() {
                     if ( image ) {
                       image = image.onreadystatechange = image.onerror = image.onload = null;
            @@ -95,10 +86,10 @@ $.ajaxTransport( "image", function( s ) {
                 };
               }
             });
            -
            +

            Handling Custom Data Types

            The jQuery Ajax implementation comes with a set of standard dataTypes, such as text, json, xml, and html.

            -

            Use the converters option in $.ajaxSetup() to augment or modify the data type conversion strategies used by $.ajax().

            +

            Use the converters option in $.ajaxSetup() to augment or modify the data type conversion strategies used by $.ajax().

            The unminified jQuery source itself includes a list of default converters, which effectively illustrates how they can be used:

            
             // List of data converters
            @@ -106,23 +97,20 @@ $.ajaxTransport( "image", function( s ) {
             //    (a single space in-between)
             // 2) the catchall symbol "*" can be used for source_type
             converters: {
            -
               // Convert anything to text
               "* text": window.String,
            -
               // Text to html (true = no transformation)
               "text html": true,
            -
               // Evaluate text as a json expression
               "text json": jQuery.parseJSON,
            -
               // Parse text as xml
               "text xml": jQuery.parseXML
             }
            -
            +

            When you specify a converters option globally in $.ajaxSetup() or per call in $.ajax(), the object will map onto the default converters, overwriting those you specify and leaving the others intact.

            For example, the jQuery source uses $.ajaxSetup() to add a converter for "text script":

            -
            jQuery.ajaxSetup({
            +    
            
            +jQuery.ajaxSetup({
               accepts: {
                 script: "text/javascript, application/javascript"
               },
            @@ -132,7 +120,8 @@ converters: {
               converters: {
                 "text script": jQuery.globalEval
               }
            -});
            +}); +
            diff --git a/entries/jQuery.boxModel.xml b/entries/jQuery.boxModel.xml index bc065599..424fdfd7 100644 --- a/entries/jQuery.boxModel.xml +++ b/entries/jQuery.boxModel.xml @@ -9,21 +9,30 @@ Returns the box model for the iframe. - + p { + color: blue; + margin: 20px; + } + span { + color: red; + } +]]> + Returns false if the page is in Quirks Mode in Internet Explorer - - + + diff --git a/entries/jQuery.browser.xml b/entries/jQuery.browser.xml index bbc6910f..7a2a7e92 100644 --- a/entries/jQuery.browser.xml +++ b/entries/jQuery.browser.xml @@ -18,26 +18,27 @@

          This property is available immediately. It is therefore safe to use it to determine whether or not to call $(document).ready(). The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.

          -

          Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. The $.support property is available for detection of support for particular features rather than relying on $.browser.

          +

          Because $.browser uses navigator.userAgent to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. The $.support property is available for detection of support for particular features rather than relying on $.browser.

          Show the browser info. +}); +]]> Return true if the current useragent is some version of Microsoft's Internet Explorer. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. Alert "this is WebKit!" only for WebKit browsers. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. @@ -66,8 +67,8 @@ jQuery.each(jQuery.browser, function(i, val) { Return the version number of the rendering engine used by the user's current browser. For example, FireFox 4 returns 2.0 (the version of the Gecko rendering engine it utilizes). Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included. diff --git a/entries/jQuery.contains.xml b/entries/jQuery.contains.xml index d1730e9c..9bf3285f 100644 --- a/entries/jQuery.contains.xml +++ b/entries/jQuery.contains.xml @@ -19,8 +19,10 @@ Check if an element is a descendant of another. - + diff --git a/entries/jQuery.cssHooks.xml b/entries/jQuery.cssHooks.xml index 5098607f..57d91b41 100644 --- a/entries/jQuery.cssHooks.xml +++ b/entries/jQuery.cssHooks.xml @@ -10,11 +10,11 @@

          For example, some versions of Webkit-based browsers require -webkit-border-radius to set the border-radius on an element, while earlier Firefox versions require -moz-border-radius. A css hook can normalize these vendor-prefixed properties to let .css() accept a single, standard property name (border-radius, or with DOM property syntax, borderRadius).

          In addition to providing fine-grained control over how specific style properties are handled, $.cssHooks also extends the set of properties available to the .animate() method.

          Defining a new css hook is straight-forward. The skeleton template below can serve as a guide to creating your own.

          -
          -      (function($) {
          -  // first, check to see if cssHooks are supported
          +    
          
          +(function( $ ) {
          +  // First, check to see if cssHooks are supported
             if ( !$.cssHooks ) {
          -    // if not, output an error message
          +    // If not, output an error message
               throw("jQuery 1.4.3 or above is required for this plugin to work");
               return;
             }
          @@ -23,80 +23,71 @@
             // cssHooks at this time and will blow away your functions
             // if they exist.
             $(function () {
          -    $.cssHooks["someCSSProp"] = {
          +    $.cssHooks[ "someCSSProp" ] = {
                 get: function( elem, computed, extra ) {
          -        // handle getting the CSS property
          +        // Handle getting the CSS property
                 },
                 set: function( elem, value ) {
          -        // handle setting the CSS value
          +        // Handle setting the CSS value
                 }
               };
             });
          -})(jQuery);
          -
          -    
          +})( jQuery ); +

          Feature Testing

          Before normalizing a vendor-specific CSS property, first determine whether the browser supports the standard property or a vendor-prefixed variation. For example, to check for support of the border-radius property, see if any variation is a member of a temporary element's style object.

          -
          -      (function($) {
          +    
          
          +(function( $ ) {
             function styleSupport( prop ) {
               var vendorProp, supportedProp,
          -
          -        // capitalize first character of the prop to test vendor prefix
          -        capProp = prop.charAt(0).toUpperCase() + prop.slice(1),
          -        prefixes = [ "Moz", "Webkit", "O", "ms" ],
          -        div = document.createElement( "div" );
          +      // Capitalize first character of the prop to test vendor prefix
          +      capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
          +      prefixes = [ "Moz", "Webkit", "O", "ms" ],
          +      div = document.createElement( "div" );
           
               if ( prop in div.style ) {
          -
          -      // browser supports standard CSS property name
          +      // Browser supports standard CSS property name
                 supportedProp = prop;
               } else {
          -
          -      // otherwise test support for vendor-prefixed property names
          +      // Otherwise test support for vendor-prefixed property names
                 for ( var i = 0; i < prefixes.length; i++ ) {
          -        vendorProp = prefixes[i] + capProp;
          +        vendorProp = prefixes[ i ] + capProp;
                   if ( vendorProp in div.style ) {
                     supportedProp = vendorProp;
                     break;
                   }
                 }
               }
          -
          -    // avoid memory leak in IE
          +    // Avoid memory leak in IE
               div = null;
          -
          -    // add property to $.support so it can be accessed elsewhere
          +    // Add property to $.support so it can be accessed elsewhere
               $.support[ prop ] = supportedProp;
          -
               return supportedProp;
             }
          -
          -  // call the function, e.g. testing for "border-radius" support:
          +  // Call the function, e.g. testing for "border-radius" support:
             styleSupport( "borderRadius" );
          -})(jQuery);
          -
          -    
          +})( jQuery ); +

          Defining a complete css hook

          To define a complete css hook, combine the support test with a filled-out version of the skeleton template provided in the first example:

          -
          -      (function($) {
          +    
          
          +(function( $ ) {
             if ( !$.cssHooks ) {
          -    throw("jQuery 1.4.3+ is needed for this plugin to work");
          +    throw( "jQuery 1.4.3+ is needed for this plugin to work" );
               return;
             }
           
             function styleSupport( prop ) {
               var vendorProp, supportedProp,
          -        capProp = prop.charAt(0).toUpperCase() + prop.slice(1),
          -        prefixes = [ "Moz", "Webkit", "O", "ms" ],
          -        div = document.createElement( "div" );
          +      capProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ),
          +      prefixes = [ "Moz", "Webkit", "O", "ms" ],
          +      div = document.createElement( "div" );
           
               if ( prop in div.style ) {
                 supportedProp = prop;
               } else {
                 for ( var i = 0; i < prefixes.length; i++ ) {
          -        vendorProp = prefixes[i] + capProp;
          +        vendorProp = prefixes[ i ] + capProp;
                   if ( vendorProp in div.style ) {
                     supportedProp = vendorProp;
                     break;
          @@ -105,12 +96,10 @@
               }
           
               div = null;
          -    $.support[ prop ] = supportedProp
          +    $.support[ prop ] = supportedProp;
               return supportedProp;
             }
          -
             var borderRadius = styleSupport( "borderRadius" );
          -
             // Set cssHooks only for browsers that
             // support a vendor-prefixed border radius
             if ( borderRadius && borderRadius !== "borderRadius" ) {
          @@ -123,27 +112,20 @@
                 }
               };
             }
          -})(jQuery);
          -
          -    
          +})( jQuery ); +

          You can then set the border radius in a supported browser using either the DOM (camelCased) style or the CSS (hyphenated) style:

          -
          -      
          -$("#element").css("borderRadius", "10px");
          -$("#another").css("border-radius", "20px");
          -
          -    
          +
          
          +$( "#element" ).css( "borderRadius", "10px" );
          +$( "#another" ).css( "border-radius", "20px" );
          +    

          If the browser lacks support for any form of the CSS property, vendor-prefixed or not, the style is not applied to the element. However, if the browser supports a proprietary alternative, it can be applied to the cssHooks instead.

          -
          -      
          - (function($) {
          -  // feature test for support of a CSS property
          +    
          
          + (function( $ ) {
          +  // Feature test for support of a CSS property
             // and a proprietary alternative
             // ...
          -
          -
            if ( $.support.someCSSProp && $.support.someCSSProp !== "someCSSProp" ) {
          -
               // Set cssHooks for browsers that
               // support only a vendor-prefixed someCSSProp
               $.cssHooks.someCSSProp = {
          @@ -164,25 +146,22 @@ $("#another").css("border-radius", "20px");
                 }
               }
             }
          -
          -})(jQuery);
          -
          -    
          +})( 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

          -
          -      $.cssNumber["someCSSProp"] = true;
          -    
          +
          
          +$.cssNumber[ "someCSSProp" ] = true;
          +    

          Animating with cssHooks

          A css hook can also hook into jQuery's animation mechanism by adding a property to the jQuery.fx.step object:

          -
          -      $.fx.step["someCSSProp"] = function(fx){
          -  $.cssHooks["someCSSProp"].set( fx.elem, fx.now + fx.unit );
          +    
          
          +  $.fx.step[ "someCSSProp" ] = function( fx ) {
          +  $.cssHooks[ "someCSSProp" ].set( fx.elem, fx.now + fx.unit );
           };
          -
          -    
          +

          Note that this works best for simple numeric-value animations. More custom code may be required depending on the CSS property, the type of value it returns, and the animation's complexity.

          - \ No newline at end of file + diff --git a/entries/jQuery.data.xml b/entries/jQuery.data.xml index e3933dcf..d46bd6ca 100644 --- a/entries/jQuery.data.xml +++ b/entries/jQuery.data.xml @@ -17,30 +17,41 @@ Store arbitrary data associated with the specified element. Returns the value that was set. -

          Note: This is a low-level method; a more convenient .data() is also available.

          +

          Note: This is a low-level method; a more convenient .data() is also available.

          The jQuery.data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore free from memory leaks. jQuery ensures that the data is removed when DOM elements are removed via jQuery methods, and when the user leaves the page. We can set several distinct values for a single element and retrieve them later:

          
          -jQuery.data(document.body, 'foo', 52);
          -jQuery.data(document.body, 'bar', 'test');
          -
          +jQuery.data( document.body, "foo", 52 ); +jQuery.data( document.body, "bar", "test" ); +

          Note: this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.

          Store then retrieve a value from the div element. - + - + + +]]> @@ -66,56 +77,67 @@ jQuery.data(document.body, 'bar', 'test'); Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. -

          Note: This is a low-level method; a more convenient .data() is also available.

          -

          Regarding HTML5 data-* attributes: This low-level method does NOT retrieve the data-* attributes unless the more convenient .data() method has already retrieved them.

          +

          Note: This is a low-level method; a more convenient .data() is also available.

          +

          Regarding HTML5 data-* attributes: This low-level method does NOT retrieve the data-* attributes unless the more convenient .data() method has already retrieved them.

          The jQuery.data() method allows us to attach data of any type to DOM elements in a way that is safe from circular references and therefore from memory leaks. We can retrieve several distinct values for a single element one at a time, or as a set:

          -
          alert(jQuery.data( document.body, 'foo' ));
          -alert(jQuery.data( document.body ));
          +
          
          +alert( jQuery.data( document.body, "foo" ) );
          +alert( jQuery.data( document.body ) );
          +      

          The above lines alert the data values that were set on the body element. If nothing was set on that element, an empty string is returned.

          -

          Calling jQuery.data(element) retrieves all of the element's associated values as a JavaScript object. Note that jQuery itself uses this method to store data for internal use, such as event handlers, so do not assume that it contains only data that your own code has stored.

          +

          Calling jQuery.data( element ) retrieves all of the element's associated values as a JavaScript object. Note that jQuery itself uses this method to store data for internal use, such as event handlers, so do not assume that it contains only data that your own code has stored.

          Note: this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.

          Get the data named "blah" stored at for an element. - + +

          The "blah" value of this div is ?

          +]]>
          diff --git a/entries/jQuery.dequeue.xml b/entries/jQuery.dequeue.xml index 1982a6e7..0ce8fcd8 100644 --- a/entries/jQuery.dequeue.xml +++ b/entries/jQuery.dequeue.xml @@ -12,29 +12,42 @@ Execute the next function on the queue for the matched element. -

          Note: This is a low-level method, you should probably use .dequeue() instead.

          +

          Note: This is a low-level method, you should probably use .dequeue() instead.

          When jQuery.dequeue() is called, the next function on the queue is removed from the queue, and then executed. This function should in turn (directly or indirectly) cause jQuery.dequeue() to be called, so that the sequence can continue.

          Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going. - - - + + + - \ No newline at end of file + diff --git a/entries/jQuery.each.xml b/entries/jQuery.each.xml index 16ae2b6e..00fe102e 100644 --- a/entries/jQuery.each.xml +++ b/entries/jQuery.each.xml @@ -13,10 +13,11 @@ A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

          The $.each() function is not the same as $(selector).each(), which is used to iterate, exclusively, over a jQuery object. The $.each() function can be used to iterate over any collection, whether it is an object or an array. In the case of an array, the callback is passed an array index and a corresponding array value each time. (The value can also be accessed through the this keyword, but Javascript will always wrap the this value as an Object even if it is a simple string or number value.) The method returns its first argument, the object that was iterated.

          -
          $.each([52, 97], function(index, value) {
          -  alert(index + ': ' + value);
          +    
          
          +$.each([ 52, 97 ], function( index, value ) {
          +  alert( index + ": " + value );
           });
          -
          +

          This produces two messages:

          0: 52 @@ -24,13 +25,15 @@ 1: 97

          If an object is used as the collection, the callback is passed a key-value pair each time:

          -
          var obj = {
          +    
          
          +var obj = {
             "flammable": "inflammable",
             "duh": "no duh"
           };
           $.each( obj, function( key, value ) {
             alert( key + ": " + value );
          -});
          +}); +

          Once again, this produces two messages:

          flammable: inflammable @@ -42,40 +45,49 @@ $.each( obj, function( key, value ) { Iterates through the array displaying each number as both a word and numeral + div { + color: blue; + } + div#five { + color: red; + } +]]> +

          +
          +
          +
          +
          +]]>
          Iterates over items in an array, accessing both the current item and its index. - + Iterates over the properties in an object, accessing both the current item and its key. - + diff --git a/entries/jQuery.error.xml b/entries/jQuery.error.xml index d2b05376..3ae5110a 100644 --- a/entries/jQuery.error.xml +++ b/entries/jQuery.error.xml @@ -13,7 +13,9 @@ Override jQuery.error for display in Firebug. - + diff --git a/entries/jQuery.extend.xml b/entries/jQuery.extend.xml index 06e28224..d7304466 100644 --- a/entries/jQuery.extend.xml +++ b/entries/jQuery.extend.xml @@ -45,28 +45,28 @@ defaults -- " + printObj(defaults) + "" ); -$("#log").append( "
          options -- " + printObj(options) + "
          " ); -$("#log").append( "
          settings -- " + printObj(settings) + "
          " ); - +$( "#log" ).append( "
          defaults -- " + printObj( defaults ) + "
          " ); +$( "#log" ).append( "
          options -- " + printObj( options ) + "
          " ); +$( "#log" ).append( "
          settings -- " + printObj( settings ) + "
          " ); ]]> -label { display: block; margin: .5em; } - + label { + display: block; + margin: .5em; + } + +]]> - +
          - \ No newline at end of file + diff --git a/entries/jQuery.fx.off.xml b/entries/jQuery.fx.off.xml index a10f09c6..ac01e9c8 100644 --- a/entries/jQuery.fx.off.xml +++ b/entries/jQuery.fx.off.xml @@ -20,21 +20,27 @@ var toggleFx = function() { $.fx.off = !$.fx.off; }; toggleFx(); - -$("button").click(toggleFx) - -$("input").click(function(){ - $("div").toggle("slow"); +$( "button" ).click( toggleFx ); +$( "input" ).click(function() { + $( "div" ).toggle( "slow" ); }); - ]]> +]]> - + div { + width: 50px; + height: 30px; + margin: 5px; + float: left; + background: green; + } +]]> + - \ No newline at end of file + diff --git a/entries/jQuery.get.xml b/entries/jQuery.get.xml index d29cccfe..102dd7d9 100644 --- a/entries/jQuery.get.xml +++ b/entries/jQuery.get.xml @@ -21,39 +21,50 @@ Load data from the server using a HTTP GET request.

          This is a shorthand Ajax function, which is equivalent to:

          -
          $.ajax({
          +    
          
          +$.ajax({
             url: url,
             data: data,
             success: success,
             dataType: dataType
           });
          -
          +

          The success callback function is passed the returned data, which will be an XML root element, text string, JavaScript file, or JSON object, depending on the MIME type of the response. It is also passed the text status of the response.

          As of jQuery 1.5, the success callback function is also passed a "jqXHR" object (in jQuery 1.4, it was passed the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

          Most implementations will specify a success handler:

          -
          $.get('ajax/test.html', function(data) {
          -  $('.result').html(data);
          -  alert('Load was performed.');
          +    
          
          +$.get( "ajax/test.html", function( data ) {
          +  $( ".result" ).html( data );
          +  alert( "Load was performed." );
           });
          -
          +

          This example fetches the requested HTML snippet and inserts it on the page.

          The jqXHR Object

          As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.get() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

          The Promise interface also allows jQuery's Ajax methods, including $.get(), to chain multiple .done(), .fail(), and .always() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

          -
          // Assign handlers immediately after making the request,
          +    
          
          +// Assign handlers immediately after making the request,
           // and remember the jqxhr object for this request
          -var jqxhr = $.get("example.php", function() {
          -  alert("success");
          +var jqxhr = $.get( "example.php", function() {
          +  alert( "success" );
           })
          -.done(function() { alert("second success"); })
          -.fail(function() { alert("error"); })
          -.always(function() { alert("finished"); });
          +  .done(function() {
          +    alert( "second success" );
          +  })
          +  .fail(function() {
          +    alert( "error" );
          +  })
          +  .always(function() {
          +    alert( "finished" );
          +  });
           
          -// perform other work here ...
          +// Perform other work here ...
           
           // Set another completion function for the request above
          -jqxhr.always(function(){ alert("second finished"); });
          -
          +jqxhr.always(function(){ + alert( "second finished" ); +}); +

          Deprecation Notice

          The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

          @@ -62,36 +73,47 @@ jqxhr.always(function(){ alert("second finished"); }); Request the test.php page, but ignore the return results. - + Request the test.php page and send some additional data along (while still ignoring the return results). - + Pass arrays of data to the server (while still ignoring the return results). - + Alert the results from requesting test.php (HTML or XML, depending on what was returned). - + Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned). - + - Get the test.php page contents, which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>), and add it to the page. - + Get the test.php page contents, which has been returned in json format (<?php echo json_encode( array( "name"=>"John","time"=>"2pm" ) ); ?>), and add it to the page. + diff --git a/entries/jQuery.getJSON.xml b/entries/jQuery.getJSON.xml index 6e3316d1..047e7231 100644 --- a/entries/jQuery.getJSON.xml +++ b/entries/jQuery.getJSON.xml @@ -9,33 +9,34 @@ A plain object or string that is sent to the server with the request. - + A callback function that is executed if the request succeeds. Load JSON-encoded data from the server using a GET HTTP request.

          This is a shorthand Ajax function, which is equivalent to:

          -
          $.ajax({
          +    
          
          +$.ajax({
             dataType: "json",
             url: url,
             data: data,
             success: success
           });
          -
          +

          Data that is sent to the server is appended to the URL as a query string. If the value of the data parameter is a plain object, it is converted to a string and url-encoded before it is appended to the URL.

          Most implementations will specify a success handler:

          -
          $.getJSON('ajax/test.json', function(data) {
          +    
          
          +$.getJSON( "ajax/test.json", function( data ) {
             var items = [];
          -
          -  $.each(data, function(key, val) {
          -    items.push('<li id="' + key + '">' + val + '</li>');
          +  $.each( data, function( key, val ) {
          +    items.push( "<li id='" + key + "'>" + val + "</li>" );
             });
           
          -  $('<ul/>', {
          -    'class': 'my-new-list',
          -    html: items.join('')
          -  }).appendTo('body');
          +  $( "<ul/>", {
          +    "class": "my-new-list",
          +    html: items.join( "" )
          +  }).appendTo( "body" );
           });
           

          This example, of course, relies on the structure of the JSON file:

          @@ -44,33 +45,37 @@ "two": "Beady little eyes", "three": "Little birds pitch by my doorstep" } -
          +

          Using this structure, the example loops through the requested data, builds an unordered list, and appends it to the body.

          -

          The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

          -

          As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

          +

          The success callback is passed the returned data, which is typically a JavaScript object or array as defined by the JSON structure and parsed using the $.parseJSON() method. It is also passed the text status of the response.

          +

          As of jQuery 1.5, the success callback function receives a "jqXHR" object (in jQuery 1.4, it received the XMLHttpRequest object). However, since JSONP and cross-domain GET requests do not use XHR, in those cases the jqXHR and textStatus parameters passed to the success callback are undefined.

          Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of JSON data for this reason. JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes. For details on the JSON format, see http://json.org/.

          JSONP

          -

          If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

          +

          If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

          The jqXHR Object

          As of jQuery 1.5, all of jQuery's Ajax methods return a superset of the XMLHTTPRequest object. This jQuery XHR object, or "jqXHR," returned by $.getJSON() implements the Promise interface, giving it all the properties, methods, and behavior of a Promise (see Deferred object for more information). The jqXHR.done() (for success), jqXHR.fail() (for error), and jqXHR.always() (for completion, whether success or error) methods take a function argument that is called when the request terminates. For information about the arguments this function receives, see the jqXHR Object section of the $.ajax() documentation.

          The Promise interface in jQuery 1.5 also allows jQuery's Ajax methods, including $.getJSON(), to chain multiple .done(), .always(), and .fail() callbacks on a single request, and even to assign these callbacks after the request may have completed. If the request is already complete, the callback is fired immediately.

          -
          // Assign handlers immediately after making the request,
          +    
          
          +// Assign handlers immediately after making the request,
           // and remember the jqxhr object for this request
           var jqxhr = $.getJSON( "example.json", function() {
             console.log( "success" );
           })
          -.done(function() { console.log( "second success" ); })
          -.fail(function() { console.log( "error" ); })
          -.always(function() { console.log( "complete" ); });
          +  .done(function() { console.log( "second success" ); })
          +  .fail(function() { console.log( "error" ); })
          +  .always(function() { console.log( "complete" ); });
           
           // perform other work here ...
           
           // Set another completion function for the request above
          -jqxhr.complete(function() { console.log( "second complete" ); });
          -

          Deprecation Notice

          -

          The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

          +jqxhr.complete(function() { + console.log( "second complete" ); +}); +
          +

          Deprecation Notice

          +

          The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods introduced in jQuery 1.5 are deprecated as of jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.

          @@ -84,38 +89,47 @@ jqxhr.complete(function() { console.log( "second complete" ); }); tagmode: "any", format: "json" }) - .done(function( data ) { - $.each( data.items, function( i, item ) { - $( "" ).attr( "src", item.media.m ).appendTo( "#images" ); - if ( i === 3 ) { - return false; - } + .done(function( data ) { + $.each( data.items, function( i, item ) { + $( "" ).attr( "src", item.media.m ).appendTo( "#images" ); + if ( i === 3 ) { + return false; + } + }); }); - }); })(); ]]> - - + + Load the JSON data from test.js and access a name from the returned JSON data. - + Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data. If an error occurs, log an error message instead. - + diff --git a/entries/jQuery.getScript.xml b/entries/jQuery.getScript.xml index da850c24..6a04369d 100644 --- a/entries/jQuery.getScript.xml +++ b/entries/jQuery.getScript.xml @@ -13,59 +13,65 @@ Load a JavaScript file from the server using a GET HTTP request, then execute it.

          This is a shorthand Ajax function, which is equivalent to:

          -
          $.ajax({
          +    
          
          +$.ajax({
             url: url,
             dataType: "script",
             success: success
           });
          -
          +

          The script is executed in the global context, so it can refer to other variables and use jQuery functions. Included scripts can have some impact on the current page.

          Success Callback

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

          -
          $(".result").html("<p>Lorem ipsum dolor sit amet.</p>");
          +
          
          +$( ".result" ).html( "<p>Lorem ipsum dolor sit amet.</p>" );
          +    

          Scripts are included and run by referencing the file name:

          -
          $.getScript("ajax/test.js", function(data, textStatus, jqxhr) {
          -   console.log(data); //data returned
          -   console.log(textStatus); //success
          -   console.log(jqxhr.status); //200
          -   console.log('Load was performed.');
          -});
          +
          
          +$.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) {
          +  console.log( data ); //Data returned
          +  console.log( textStatus ); //Success
          +  console.log( jqxhr.status ); //200
          +  console.log( "Load was performed." );
          +});
          +    

          Handling Errors

          As of jQuery 1.5, you may use .fail() to account for errors:

          
          -$.getScript("ajax/test.js")
          -.done(function(script, textStatus) {
          -  console.log( textStatus );
          -})
          -.fail(function(jqxhr, settings, exception) {
          -  $( "div.log" ).text( "Triggered ajaxError handler." );
          +$.getScript( "ajax/test.js" )
          +  .done( function(script, textStatus ) {
          +    console.log( textStatus );
          +  })
          +  .fail(function( jqxhr, settings, exception ) {
          +    $( "div.log" ).text( "Triggered ajaxError handler." );
           });
          -
          +

          Prior to jQuery 1.5, the global .ajaxError() callback event had to be used in order to handle $.getScript() errors:

          
           $( "div.log" ).ajaxError(function(e, jqxhr, settings, exception) {
          -  if (settings.dataType=='script') {
          -    $(this).text( "Triggered ajaxError handler." );
          +  if (settings.dataType == "script" ) {
          +    $( this ).text( "Triggered ajaxError handler." );
             }
           });
          -
          +

          Caching Responses

          -

          By default, $.getScript() sets the cache setting to false. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using $.ajaxSetup():

          +

          By default, $.getScript() sets the cache setting to false. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using $.ajaxSetup():

          
           $.ajaxSetup({
             cache: true
           });
          -
          +

          Alternatively, you could define a new method that uses the more flexible $.ajax() method.

          Define a $.cachedScript() method that allows fetching a cached script: - jQuery.cachedScript = function(url, options) { + Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded. @@ -89,7 +95,7 @@ $.cachedScript("ajax/test.js").done(function(script, textStatus) { var url = "https://raw.github.com/jquery/jquery-color/master/jquery.color.js"; $.getScript(url, function() { $("#go").click(function(){ - $(".block") + $( ".block" ) .animate( { backgroundColor: "rgb(255, 180, 180)" }, 1000 ) .delay(500) .animate( { backgroundColor: "olive" }, 1000 ) @@ -101,16 +107,16 @@ $.cachedScript("ajax/test.js").done(function(script, textStatus) { ]]> + .block { + background-color: blue; + width: 150px; + height: 70px; + margin: 10px; + } +]]> diff --git a/entries/jQuery.globalEval.xml b/entries/jQuery.globalEval.xml index f7584d01..ce510fe3 100644 --- a/entries/jQuery.globalEval.xml +++ b/entries/jQuery.globalEval.xml @@ -13,13 +13,14 @@ Execute a script in the global context. - + - \ No newline at end of file + diff --git a/entries/jQuery.grep.xml b/entries/jQuery.grep.xml index 40c0ff68..3ede1ef3 100644 --- a/entries/jQuery.grep.xml +++ b/entries/jQuery.grep.xml @@ -22,41 +22,59 @@ Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s. 4); +arr = jQuery.grep(arr, function( n, i ) { + return ( n != 5 && i > 4 ); }); -$("p").text(arr.join(", ")); +$( "p" ).text( arr.join(", ") ); -arr = jQuery.grep(arr, function (a) { return a != 9; }); -$("span").text(arr.join(", ")); +arr = jQuery.grep(arr, function( a ) { + return a != 9; +}); +$( "span" ).text( arr.join( ", " ) ); ]]> - + div { + color: blue; + } + p { + color: green; + margin: 0; + } + span { + color: red; + } +]]> + Filter an array of numbers to include only numbers bigger then zero. - 0; - });]]> - + 0; +}); +]]> + Filter an array of numbers to include numbers that are not bigger than zero. - 0; -},true);]]> - +}, true ); +]]> + - \ No newline at end of file + diff --git a/entries/jQuery.hasData.xml b/entries/jQuery.hasData.xml index 4919998d..af081d41 100644 --- a/entries/jQuery.hasData.xml +++ b/entries/jQuery.hasData.xml @@ -9,7 +9,7 @@ Determine whether an element has any jQuery data associated with it. -

          The jQuery.hasData() method provides a way to determine if an element currently has any values that were set using jQuery.data(). If no data is associated with an element (there is no data object at all or the data object is empty), the method returns false; otherwise it returns true.

          +

          The jQuery.hasData() method provides a way to determine if an element currently has any values that were set using jQuery.data(). If no data is associated with an element (there is no data object at all or the data object is empty), the method returns false; otherwise it returns true.

          The primary advantage of jQuery.hasData(element) is that it does not create and associate a data object with the element if none currently exists. In contrast, jQuery.data(element) always returns a data object to the caller, creating one if no data object previously existed.

          Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using .on(), .bind(), .live(), .delegate(), or one of the shorthand event methods also associates a data object with that element. @@ -18,24 +18,25 @@ Set data on an element and see the results of hasData. - + - \ No newline at end of file + diff --git a/entries/jQuery.holdReady.xml b/entries/jQuery.holdReady.xml index 8572c853..cb795f2f 100644 --- a/entries/jQuery.holdReady.xml +++ b/entries/jQuery.holdReady.xml @@ -10,17 +10,17 @@

          The $.holdReady() method allows the caller to delay jQuery's ready event. This advanced feature would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <head> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect.

          -

          To delay the ready event, first call $.holdReady(true). When the ready event should be released to execute, call $.holdReady(false). Note that multiple holds can be put on the ready event, one for each $.holdReady(true) call. The ready event will not actually fire until all holds have been released with a corresponding number of $.holdReady(false) calls and the normal document ready conditions are met. (See ready for more information.)

          +

          To delay the ready event, first call $.holdReady( true ). When the ready event should be released to execute, call $.holdReady( false ). Note that multiple holds can be put on the ready event, one for each $.holdReady( true ) call. The ready event will not actually fire until all holds have been released with a corresponding number of $.holdReady( false ) calls and the normal document ready conditions are met. (See ready for more information.)

          Delay the ready event until a custom plugin has loaded. - \ No newline at end of file + diff --git a/entries/jQuery.inArray.xml b/entries/jQuery.inArray.xml index 2d9cf228..16e43b60 100644 --- a/entries/jQuery.inArray.xml +++ b/entries/jQuery.inArray.xml @@ -20,22 +20,28 @@ Report the index of some elements in the array. - +
          "Pete" is in the array, but not at or after index 2, so
          +]]>
          diff --git a/entries/jQuery.isArray.xml b/entries/jQuery.isArray.xml index 9b7c5c45..6f040c4e 100644 --- a/entries/jQuery.isArray.xml +++ b/entries/jQuery.isArray.xml @@ -13,9 +13,13 @@ Finds out if the parameter is an array. - -
          ]]> + + +]]> - \ No newline at end of file + diff --git a/entries/jQuery.isEmptyObject.xml b/entries/jQuery.isEmptyObject.xml index 44d9732b..0610cb0c 100644 --- a/entries/jQuery.isEmptyObject.xml +++ b/entries/jQuery.isEmptyObject.xml @@ -9,13 +9,14 @@ Check to see if an object is empty (contains no enumerable properties). -

          As of jQuery 1.4 this method checks both properties on the object itself and properties inherited from prototypes (in that it doesn't use hasOwnProperty). The argument should always be a plain JavaScript Object as other types of object (DOM elements, primitive strings/numbers, host objects) may not give consistent results across browsers. To determine if an object is a plain JavaScript object, use $.isPlainObject()

          +

          As of jQuery 1.4 this method checks both properties on the object itself and properties inherited from prototypes (in that it doesn't use hasOwnProperty). The argument should always be a plain JavaScript Object as other types of object (DOM elements, primitive strings/numbers, host objects) may not give consistent results across browsers. To determine if an object is a plain JavaScript object, use $.isPlainObject()

          Check an object to see if it's empty. - + diff --git a/entries/jQuery.isFunction.xml b/entries/jQuery.isFunction.xml index ba6750a4..2f66a042 100644 --- a/entries/jQuery.isFunction.xml +++ b/entries/jQuery.isFunction.xml @@ -17,37 +17,45 @@ function stub() { } var objs = [ - function () {}, - { x:15, y:20 }, - null, - stub, - "function" - ]; + function() {}, + { x:15, y:20 }, + null, + stub, + "function" +]; -jQuery.each(objs, function (i) { - var isFunc = jQuery.isFunction(objs[i]); - $("span").eq(i).text(isFunc); +jQuery.each( objs, function( i ) { + var isFunc = jQuery.isFunction( objs[ i ]); + $( "span" ).eq( i ).text( isFunc ); }); ]]> + div { + color: blue; + margin: 2px; + font-size: 14px; + } + span { + color: red; + } +]]> - -
          jQuery.isFunction(objs[1]) =
          -
          jQuery.isFunction(objs[2]) =
          -
          jQuery.isFunction(objs[3]) =
          - -
          jQuery.isFunction(objs[4]) =
          - ]]> +
          jQuery.isFunction( objs[ 0 ] ) =
          +
          jQuery.isFunction( objs[ 1 ] ) =
          +
          jQuery.isFunction( objs[ 2 ] ) =
          +
          jQuery.isFunction( objs[ 3 ] ) =
          +
          jQuery.isFunction( objs[ 4 ] ) =
          +]]> Finds out if the parameter is a function. - - + + - \ No newline at end of file + diff --git a/entries/jQuery.isNumeric.xml b/entries/jQuery.isNumeric.xml index de494038..7bc4bfd4 100644 --- a/entries/jQuery.isNumeric.xml +++ b/entries/jQuery.isNumeric.xml @@ -14,21 +14,21 @@ Sample return values of $.isNumeric with various inputs. diff --git a/entries/jQuery.isPlainObject.xml b/entries/jQuery.isPlainObject.xml index cc3c1b0e..1f8f3ce2 100644 --- a/entries/jQuery.isPlainObject.xml +++ b/entries/jQuery.isPlainObject.xml @@ -12,14 +12,16 @@

          Note: Host objects (or objects used by browser host environments to complete the execution environment of ECMAScript) have a number of inconsistencies which are difficult to robustly feature detect cross-platform. As a result of this, $.isPlainObject() may evaluate inconsistently across browsers in certain instances.

          An example of this is a test against document.location using $.isPlainObject() as follows:

          
          -  console.log($.isPlainObject(document.location));
          -
          +console.log( $.isPlainObject( document.location ) ); +

          which throws an invalid pointer exception in IE8. With this in mind, it's important to be aware of any of the gotchas involved in using $.isPlainObject() against older browsers. A couple basic examples that do function correctly cross-browser can be found below.

          Check an object to see if it's a plain object. - + diff --git a/entries/jQuery.isWindow.xml b/entries/jQuery.isWindow.xml index 2d9521f3..15453599 100644 --- a/entries/jQuery.isWindow.xml +++ b/entries/jQuery.isWindow.xml @@ -13,9 +13,13 @@ Finds out if the parameter is a window. - - + + - \ No newline at end of file + diff --git a/entries/jQuery.isXMLDoc.xml b/entries/jQuery.isXMLDoc.xml index 6cd855e7..b1654d8e 100644 --- a/entries/jQuery.isXMLDoc.xml +++ b/entries/jQuery.isXMLDoc.xml @@ -11,9 +11,11 @@ Check an object to see if it's in an XML document. - + - \ No newline at end of file + diff --git a/entries/jQuery.makeArray.xml b/entries/jQuery.makeArray.xml index d82a21c6..8cdac5d6 100644 --- a/entries/jQuery.makeArray.xml +++ b/entries/jQuery.makeArray.xml @@ -15,29 +15,34 @@ Turn a collection of HTMLElements into an Array of them. - + div { + color: red; + } +]]> + Turn a jQuery object into an array - + - \ No newline at end of file + diff --git a/entries/jQuery.map.xml b/entries/jQuery.map.xml index 7d374c38..38985df7 100644 --- a/entries/jQuery.map.xml +++ b/entries/jQuery.map.xml @@ -6,7 +6,7 @@ The Array to translate. - + The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. @@ -25,21 +25,19 @@

          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.

          -
          -      
          +    

          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 following object masquerades as an array.
          -var fakeArray = {"length": 1, 0: "Addy", 1: "Subtracty"};
          +var fakeArray = { "length": 1, 0: "Addy", 1: "Subtracty" };
           
           // Therefore, convert it to a real array
           var realArray = $.makeArray( fakeArray )
           
           // Now it can be used reliably with $.map()
          -$.map( realArray, function(val, i) {
          +$.map( realArray, function( val, i ) {
             // do something
           });
          -
          -    
          +

          The translation function that is provided to this method is called for each top-level element in the array or object and is passed two arguments: The element's value and its index or key within the array or object.

          The function can return:

            @@ -51,50 +49,69 @@ $.map( realArray, function(val, i) { Use $.map() to change the values of an array. - + div { + color: blue; + } + p { + color: green; + margin: 0; + } + span { + color: red; + } +]]> + Map the original array to a new one and add 4 to each value. - - +}); +]]> + Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not. - 0 ? n + 1 : null; -});]]> - +}); +]]> + Map the original array to a new one; each element is added with its original value and the value plus one. - - +}); +]]> + Map the original object to a new array and double each value. @@ -102,8 +119,11 @@ $.map( realArray, function(val, i) { var dimensions = { width: 10, height: 15, length: 20 }; dimensions = $.map( dimensions, function( value, index ) { return value * 2; -}); ]]> - +}); +]]> + Map an object's keys to an array. @@ -111,32 +131,45 @@ dimensions = $.map( dimensions, function( value, index ) { var dimensions = { width: 10, height: 15, length: 20 }; var keys = $.map( dimensions, function( value, key ) { return key; -}); ]]> - +}); +]]> + Map the original array to a new one; each element is squared. - +}); +]]> + Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest. 50 ? a - 45 : null); -});]]> - +}); +]]> + Augment the resulting array by returning an array inside the function. - - + + diff --git a/entries/jQuery.merge.xml b/entries/jQuery.merge.xml index 94dc936c..ef43c770 100644 --- a/entries/jQuery.merge.xml +++ b/entries/jQuery.merge.xml @@ -14,28 +14,41 @@

            The $.merge() operation forms an array that contains all elements from the two arrays. The orders of items in the arrays are preserved, with items from the second array appended. The $.merge() function is destructive. It alters the first parameter to add the items from the second.

            If you need the original first array, make a copy of it before calling $.merge(). Fortunately, $.merge() itself can be used for this duplication:

            -
            var newArray = $.merge([], oldArray);
            +
            
            +var newArray = $.merge([], oldArray);
            +    

            This shortcut creates a new, empty array and merges the contents of oldArray into it, effectively cloning the array.

            Prior to jQuery 1.4, the arguments should be true Javascript Array objects; use $.makeArray if they are not.

            Merges two arrays, altering the first argument. - - + + Merges two arrays, altering the first argument. - - + + Merges two arrays, but uses a copy, so the original isn't altered. - - + - \ No newline at end of file + diff --git a/entries/jQuery.noConflict.xml b/entries/jQuery.noConflict.xml index 611d8438..ed8464dc 100644 --- a/entries/jQuery.noConflict.xml +++ b/entries/jQuery.noConflict.xml @@ -10,66 +10,76 @@ Relinquish jQuery's control of the $ variable.

            Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If you need to use another JavaScript library alongside jQuery, return control of $ back to the other library with a call to $.noConflict(). Old references of $ are saved during jQuery initialization; noConflict() simply restores them.

            -

            If for some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict(true) from the second version will return the globally scoped jQuery variables to those of the first version.

            +

            If for some reason two versions of jQuery are loaded (which is not recommended), calling $.noConflict( true ) from the second version will return the globally scoped jQuery variables to those of the first version.

            
             <script type="text/javascript" src="other_lib.js"></script>
             <script type="text/javascript" src="jquery.js"></script>
             <script type="text/javascript">
            -  $.noConflict();
            -  // Code that uses other library's $ can follow here.
            +$.noConflict();
            +// Code that uses other library's $ can follow here.
             </script>
            -
            +

            This technique is especially effective in conjunction with the .ready() method's ability to alias the jQuery object, as within callback passed to .ready() you can use $ if you wish without fear of conflicts later:

            
             <script type="text/javascript" src="other_lib.js"></script>
             <script type="text/javascript" src="jquery.js"></script>
             <script type="text/javascript">
            -  $.noConflict();
            -  jQuery(document).ready(function($) {
            -    // Code that uses jQuery's $ can follow here.
            -  });
            -  // Code that uses other library's $ can follow here.
            +$.noConflict();
            +jQuery( document ).ready(function( $ ) {
            +  // Code that uses jQuery's $ can follow here.
            +});
            +// Code that uses other library's $ can follow here.
             </script>
            -
            +

            If necessary, you can free up the jQuery name as well by passing true as an argument to the method. This is rarely necessary, and if you must do this (for example, if you need to use multiple versions of the jQuery library on the same page), you need to consider that most plug-ins rely on the presence of the jQuery variable and may not operate correctly in this situation.

            Map the original object that was referenced by $ back to $. - +$( "content" ).style.display = "none"; +]]> Revert the $ alias and then create and execute a function to provide the $ as a jQuery alias inside the function's scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library. - +// Other code using $ as an alias to the other library +]]> Create a different alias instead of jQuery to use in the rest of the script. - +$( "content" ).style.display = "none"; +]]> Completely move jQuery to a new namespace in another object. - - + +jQuery( "div > p" ).hide(); +]]> Load two versions of jQuery (not recommended). Then, restore jQuery's globally scoped variables to the first loaded jQuery. @@ -84,11 +94,10 @@ var $log = $( "#log" ); $log.append( "2nd loaded jQuery version ($): " + $.fn.jquery + "
            " ); -/* -Restore globally scoped jQuery variables to the first version loaded -(the newer version) -*/ -jq162 = jQuery.noConflict(true); +// Restore globally scoped jQuery variables to the first version loaded +// (the newer version) + +jq162 = jQuery.noConflict( true ); $log.append( "

            After $.noConflict(true)

            " ); $log.append( "1st loaded jQuery version ($): " + $.fn.jquery + "
            " ); diff --git a/entries/jQuery.param.xml b/entries/jQuery.param.xml index a87e003a..e458487e 100644 --- a/entries/jQuery.param.xml +++ b/entries/jQuery.param.xml @@ -25,11 +25,13 @@

            This function is used internally to convert form element values into a serialized string representation (See .serialize() for more information).

            As of jQuery 1.3, the return value of a function is used instead of the function as a String.

            As of jQuery 1.4, the $.param() method serializes deep objects recursively to accommodate modern scripting languages and frameworks such as PHP and Ruby on Rails. You can disable this functionality globally by setting jQuery.ajaxSettings.traditional = true;.

            -

            As of jQuery 1.8, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

            +

            As of jQuery 1.8, the $.param() method no longer uses jQuery.ajaxSettings.traditional as its default setting and will default to false. For best compatibility across versions, call $.param() with an explicit value for the second argument and do not use defaults.

            If the object passed is in an Array, it must be an array of objects in the format returned by .serializeArray()

            -
            [{name:"first",value:"Rick"},
            -{name:"last",value:"Astley"},
            -{name:"job",value:"Rock Star"}]
            +
            
            +[{ name:"first", value:"Rick" },
            +{ name:"last", value:"Astley" },
            +{ name:"job", value:"Rock Star" }]
            +    

            Note: Because some frameworks have limited ability to parse serialized arrays, developers should exercise caution when passing an obj argument that contains objects or arrays nested within another array.

            @@ -46,12 +48,12 @@ }, b: [1,2,3] }; -var recursiveEncoded = $.param(myObject); -var recursiveDecoded = decodeURIComponent($.param(myObject)); +var recursiveEncoded = $.param( myObject ); +var recursiveDecoded = decodeURIComponent( $.param( myObject ) ); -alert(recursiveEncoded); -alert(recursiveDecoded); - +alert( recursiveEncoded ); +alert( recursiveDecoded ); +

            The values of recursiveEncoded and recursiveDecoded are alerted as follows:

            a%5Bone%5D=1&a%5Btwo%5D=2&a%5Bthree%5D=3&b%5B%5D=1&b%5B%5D=2&b%5B%5D=3 @@ -65,13 +67,13 @@ alert(recursiveDecoded); two: 2, three: 3 }, - b: [1,2,3] + b: [ 1, 2, 3 ] }; -var shallowEncoded = $.param(myObject, true); -var shallowDecoded = decodeURIComponent(shallowEncoded); +var shallowEncoded = $.param( myObject, true ); +var shallowDecoded = decodeURIComponent( shallowEncoded ); -alert(shallowEncoded); -alert(shallowDecoded); +alert( shallowEncoded ); +alert( shallowDecoded );

            The values of shallowEncoded and shallowDecoded are alerted as follows:

            @@ -83,29 +85,37 @@ alert(shallowDecoded); Serialize a key/value object. - - + + Serialize a few complex objects =1.4: -$.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4" +$.param({ a: [2, 3, 4] }); // "a[]=2&a[]=3&a[]=4" // <=1.3.2: -$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a=[object+Object]&d=3&d=4&d=[object+Object]" +$.param({ a: { b:1, c:2 }, d: [ 3, 4, { e:5 } ] }); // "a=[object+Object]&d=3&d=4&d=[object+Object]" // >=1.4: -$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5" - +$.param({ a: { b:1, c:2 }, d: [ 3, 4, { e:5 } ] }); // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5" ]]> - + diff --git a/entries/jQuery.parseHTML.xml b/entries/jQuery.parseHTML.xml index 400d7dc4..9ac877fa 100644 --- a/entries/jQuery.parseHTML.xml +++ b/entries/jQuery.parseHTML.xml @@ -16,7 +16,7 @@

            jQuery.parseHTML uses a native DOM element creation function to convert the string to a set of DOM elements, which can then be inserted into the document.

            -

            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.

            +

            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.

            Create an array of Dom nodes using an HTML string and insert it into a div. @@ -27,16 +27,16 @@ ]]> my name is jQuery.", + html = $.parseHTML( str ), + nodeNames = []; // Append the parsed HTML $log.append( html ); // Gather the parsed HTML's node names $.each( html, function( i, el ) { - nodeNames[i] = "
          • " + el.nodeName + "
          • "; + nodeNames[i] = "
          • " + el.nodeName + "
          • "; }); // Insert the node names @@ -44,7 +44,6 @@ $log.append( "

            Node Names:

            " ); $( "
              " ) .append( nodeNames.join( "" ) ) .appendTo( $log ); - ]]>
              diff --git a/entries/jQuery.parseJSON.xml b/entries/jQuery.parseJSON.xml index a0a7a86a..b6f2ac08 100644 --- a/entries/jQuery.parseJSON.xml +++ b/entries/jQuery.parseJSON.xml @@ -14,15 +14,17 @@
            1. {test: 1} (test does not have double quotes around it).
            2. {'test': 1} ('test' is using single quotes instead of double quotes).
            -

            The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON('{"testing":"1\t2\n3"}') will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

            -

            Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

            -

            Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

            +

            The JSON standard does not permit "control characters" such as a tab or newline. An example like $.parseJSON( '{ "testing":"1\t2\n3" }' ) will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like "1\\t2\\n3" yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.

            +

            Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

            +

            Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an error if it was passed an empty string, null, or undefined, even though those are not valid JSON.

            Parse a JSON string. - + - \ No newline at end of file + diff --git a/entries/jQuery.parseXML.xml b/entries/jQuery.parseXML.xml index 1617e0c1..0636b51c 100644 --- a/entries/jQuery.parseXML.xml +++ b/entries/jQuery.parseXML.xml @@ -19,9 +19,9 @@ ]]> + Request the test.php page and send some additional data along (while still ignoring the return results). - + Pass arrays of data to the server (while still ignoring the return results). - + Send form data using ajax requests - + Alert the results from requesting test.php (HTML or XML, depending on what was returned). - + Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned). - Post to the test.php page and get content which has been returned in json format (<?php echo json_encode(array("name"=>"John","time"=>"2pm")); ?>). - + Post a form using ajax and put results in a div - diff --git a/entries/jQuery.proxy.xml b/entries/jQuery.proxy.xml index 19324d99..dd8a2ce9 100644 --- a/entries/jQuery.proxy.xml +++ b/entries/jQuery.proxy.xml @@ -61,45 +61,43 @@ @@ -110,15 +108,14 @@ $("#test")

            ]]> @@ -131,30 +128,30 @@ $("#test") ]]> +$( "#test" ) + .on( "click", proxy ); +]]> diff --git a/entries/jQuery.queue.xml b/entries/jQuery.queue.xml index a355413c..88502494 100644 --- a/entries/jQuery.queue.xml +++ b/entries/jQuery.queue.xml @@ -19,30 +19,46 @@ Show the length of the queue. + - - + @@ -76,7 +92,7 @@ Manipulate the queue of functions to be executed on the matched element. -

            Note: This is a low-level method, you should probably use .queue() instead.

            +

            Note: This is a low-level method, you should probably use .queue() instead.

            Every element can have one or more queues of functions attached to it by jQuery. In most applications, only one queue (called fx) is used. Queues allow a sequence of actions to be called on an element asynchronously, without halting program execution.

            The jQuery.queue() method allows us to directly manipulate this queue of functions. Calling jQuery.queue() with a callback is particularly useful; it allows us to place a new function at the end of the queue.

            Note that when adding a function with jQuery.queue(), we should ensure that jQuery.dequeue() is eventually called so that the next function in line executes.

            @@ -84,62 +100,83 @@ Queue a custom function. +$( document.body ).click(function() { + $( "div" ).show( "slow" ); + $( "div" ).animate({ left: "+=200" }, 2000 ); + jQuery.queue( $( "div" )[ 0 ], "fx", function() { + $(this).addClass( "newcolor" ); + jQuery.dequeue( this ); + }); + $( "div" ).animate({ left: "-=200" }, 500 ); + jQuery.queue( $( "div" )[ 0 ], "fx", function() { + $( this ).removeClass( "newcolor" ); + jQuery.dequeue( this ); + }); + $( "div" ).slideUp(); +}); +]]> - + Set a queue array to delete the queue. + div { + margin: 3px; + width: 40px; + height: 40px; + position: absolute; + left: 0px; + top: 30px; + background: green; + display: none; + } + div.newcolor { + background: blue; + } +]]> + + +
            +]]>
            diff --git a/entries/jQuery.removeData.xml b/entries/jQuery.removeData.xml index 219a4db1..7bcb5533 100644 --- a/entries/jQuery.removeData.xml +++ b/entries/jQuery.removeData.xml @@ -18,24 +18,32 @@ Set a data store for 2 names then remove one of them. +var div = $( "div" )[ 0 ]; +$( "span:eq(0)" ).text( "" + $( "div" ).data( "test1" ) ); +jQuery.data( div, "test1", "VALUE-1" ); +jQuery.data( div, "test2", "VALUE-2" ); +$( "span:eq(1)" ).text( "" + jQuery.data( div, "test1" ) ); +jQuery.removeData( div, "test1" ); +$( "span:eq(2)" ).text( "" + jQuery.data( div, "test1" ) ); +$( "span:eq(3)" ).text( "" + jQuery.data( div, "test2" ) ); +]]> - + div { + margin: 2px; + color: blue; + } + span { + color: red; + } +]]> + - \ No newline at end of file + diff --git a/entries/jQuery.sub.xml b/entries/jQuery.sub.xml index ccb4c0d0..9dea8924 100644 --- a/entries/jQuery.sub.xml +++ b/entries/jQuery.sub.xml @@ -16,19 +16,20 @@
            Adding a method to a jQuery sub so that it isn't exposed externally: - +typeof jQuery( "body" ).myCustomMethod // undefined +]]> Override some jQuery methods to provide new functionality. @@ -38,20 +39,20 @@ typeof jQuery('body').myCustomMethod // undefined]]> myjQuery.fn.remove = function() { // New functionality: Trigger a remove event - this.trigger("remove"); + this.trigger( "remove" ); // Be sure to call the original jQuery remove method return jQuery.fn.remove.apply( this, arguments ); }; - myjQuery(function($) { - $(".menu").click(function() { - $(this).find(".submenu").remove(); + myjQuery(function( $ ) { + $( ".menu" ).click(function() { + $( this ).find( ".submenu" ).remove(); }); // A new remove event is now triggered from this copy of jQuery - $(document).on("remove", function(e) { - $(e.target).parent().hide(); + $( document ).on( "remove", function( e ) { + $( e.target ).parent().hide(); }); }); })(); @@ -78,19 +79,20 @@ typeof jQuery('body').myCustomMethod // undefined]]> // Add our plugin to the original jQuery jQuery.fn.myplugin = function() { - this.addClass("plugin"); + this.addClass( "plugin" ); // Make sure our plugin returns our special plugin version of jQuery return plugin( this ); }; })(); -$(document).ready(function() { +$( document ).ready(function() { // Call the plugin, open method now exists - $('#main').myplugin().open(); + $( "#main" ).myplugin().open(); - // Note: Calling just $("#main").open() won't work as open doesn't exist! -});]]> + // Note: Calling just $( "#main" ).open() won't work as open doesn't exist! +}); +]]> diff --git a/entries/jQuery.support.xml b/entries/jQuery.support.xml index 967de747..b10c1d5c 100644 --- a/entries/jQuery.support.xml +++ b/entries/jQuery.support.xml @@ -55,23 +55,33 @@ Returns the box model for the iframe. - + p { + color: blue; + margin: 20px; + } + span { + color: red; + } +]]> + Returns false if the page is in QuirksMode in Internet Explorer - - + + - \ No newline at end of file + diff --git a/entries/jQuery.trim.xml b/entries/jQuery.trim.xml index 6481c9f6..f40910c1 100644 --- a/entries/jQuery.trim.xml +++ b/entries/jQuery.trim.xml @@ -15,18 +15,22 @@ Remove the white spaces at the start and at the end of the string. +
            
            +
            
            +]]>
               
               
                 Remove the white spaces at the start and at the end of the string.
            -    
            -    
            +    
            +    
               
               
               
            diff --git a/entries/jQuery.type.xml b/entries/jQuery.type.xml
            index 49f4df67..7339a1e9 100644
            --- a/entries/jQuery.type.xml
            +++ b/entries/jQuery.type.xml
            @@ -40,8 +40,12 @@
               
            Find out if the parameter is a RegExp. - - + + diff --git a/entries/jQuery.unique.xml b/entries/jQuery.unique.xml index f80f1041..2177a3c4 100644 --- a/entries/jQuery.unique.xml +++ b/entries/jQuery.unique.xml @@ -15,28 +15,30 @@ Removes any duplicate elements from the array of divs. - + div { + color: blue; + } +]]> + - \ No newline at end of file + diff --git a/entries/jQuery.when.xml b/entries/jQuery.when.xml index f46cabfc..54d1f224 100644 --- a/entries/jQuery.when.xml +++ b/entries/jQuery.when.xml @@ -9,35 +9,43 @@ Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. -

            If a single Deferred is passed to jQuery.when, its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise and can be used this way:

            -
            $.when( $.ajax("test.aspx") ).then(function(data, textStatus, jqXHR){
            -     alert( jqXHR.status ); // alerts 200
            -});
            +

            If a single Deferred is passed to jQuery.when, its Promise object (a subset of the Deferred methods) is returned by the method. Additional methods of the Promise object can be called to attach callbacks, such as deferred.then. When the Deferred is resolved or rejected, usually by the code that created the Deferred originally, the appropriate callbacks will be called. For example, the jqXHR object returned by jQuery.ajax() is a Promise and can be used this way:

            +
            
            +$.when( $.ajax( "test.aspx" ) ).then(function( data, textStatus, jqXHR ) {
            +  alert( jqXHR.status ); // Alerts 200
            +});
            +    

            If a single argument is passed to jQuery.when and it is not a Deferred or a Promise, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately. The doneCallbacks are passed the original argument. In this case any failCallbacks you might set are never called since the Deferred is never rejected. For example:

            -
            $.when( { testing: 123 } ).done(
            -    function(x) { alert(x.testing); } /* alerts "123" */
            -    );
            +
            
            +$.when( { testing: 123 } ).done(function( x ) {
            +  alert( x.testing ); // Alerts "123"
            +});
            +    

            In the case where multiple Deferred objects are passed to jQuery.when, the method returns the Promise from a new "master" Deferred object that tracks the aggregate state of all the Deferreds it has been passed. The method will resolve its master Deferred as soon as all the Deferreds resolve, or reject the master Deferred as soon as one of the Deferreds is rejected. If the master Deferred is resolved, it is passed the resolved values of all the Deferreds that were passed to jQuery.when. For example, when the Deferreds are jQuery.ajax() requests, the arguments will be the jqXHR objects for the requests, in the order they were given in the argument list.

            In the multiple-Deferreds case where one of the Deferreds is rejected, jQuery.when immediately fires the failCallbacks for its master Deferred. Note that some of the Deferreds may still be unresolved at that point. If you need to perform additional processing for this case, such as canceling any unfinished ajax requests, you can keep references to the underlying jqXHR objects in a closure and inspect/cancel them in the failCallback.

            Execute a function after two ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request). - Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error. - diff --git a/entries/jQuery.xml b/entries/jQuery.xml index dc2970ae..18fb9c6d 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -45,14 +45,14 @@

            In the first formulation listed above, jQuery() — which can also be written as $() — searches through the DOM for any elements that match the provided selector and creates a new jQuery object that references these elements:

            $( "div.foo" );
            -

            If no elements match the provided selector, the new jQuery object is "empty"; that is, it contains no elements and has .length property of 0.

            +

            If no elements match the provided selector, the new jQuery object is "empty"; that is, it contains no elements and has .length property of 0.

            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() {
               $(  "span", this ).addClass( "bar" );
             });
            -
            +

            When the search for the span selector is restricted to the context of this, only spans within the clicked element will get the additional class.

            Internally, selector context is implemented with the .find() method, so $( "span", this ) is equivalent to $( this ).find( "span" ).

            @@ -62,76 +62,88 @@ $( "div.foo" ).click(function() {

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

            
             $( "div.foo" ).click(function() {
            -  $(this).slideUp();
            +  $( this ).slideUp();
             });
            -
            +

            This example causes elements to be hidden with a sliding animation when clicked. Because the handler receives the clicked item in the this keyword as a bare DOM element, the element must be passed to the $() function before applying jQuery methods to it.

            XML data returned from an Ajax call can be passed to the $() function so individual elements of the XML structure can be retrieved using .find() and other DOM traversal methods.

            
            -$.post( "url.xml", function(data) {
            -  var $child = $(data).find("child");
            +$.post( "url.xml", function( data ) {
            +  var $child = $( data ).find( "child" );
             })
            -
            +

            Cloning jQuery Objects

            When a jQuery object is passed to the $() function, a clone of the object is created. This new jQuery object references the same DOM elements as the initial one.

            Returning an Empty Set

            -

            As of jQuery 1.4, calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). In previous versions of jQuery, this would return a set containing the document node.

            +

            As of jQuery 1.4, calling the jQuery() method with no arguments returns an empty jQuery set (with a .length property of 0). In previous versions of jQuery, this would return a set containing the document node.

            Working With Plain Objects

            At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.on(), .off(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).

            
            -// define a plain object
            -var foo = {foo: "bar", hello: "world"};
            +// Define a plain object
            +var foo = { foo: "bar", hello: "world" };
             
             // Pass it to the jQuery function
             var $foo = $( foo );
             
            -// test accessing property values
            +// Test accessing property values
             var test1 = $foo.prop( "foo" ); // bar
             
            -// test setting property values
            +// Test setting property values
             $foo.prop( "foo", "foobar" );
             var test2 = $foo.prop( "foo" ); // foobar
             
            -// test using .data() as summarized above
            +// Test using .data() as summarized above
             $foo.data( "keyName", "someValue");
             console.log( $foo ); // will now contain a jQuery{randomNumber} property
             
            -// test binding an event name and triggering
            +// Test binding an event name and triggering
             $foo.on( "eventName", function () {
            -  console.log("eventName was called");
            +  console.log( "eventName was called" );
             });
             
            -$foo.trigger( "eventName" ); // logs "eventName was called"
            -
            +$foo.trigger( "eventName" ); // Logs "eventName was called" +

            Should .trigger( "eventName" ) be used, it will search for an "eventName" property on the object and attempt to execute it after any attached jQuery handlers are executed. It does not check whether the property is a function or not. To avoid this behavior, .triggerHandler( "eventName" ) should be used instead.

            
            -$foo.triggerHandler( "eventName" ); // also logs "eventName was called"
            -
            +$foo.triggerHandler( "eventName" ); // Also logs "eventName was called" +
            Find all p elements that are children of a div element and apply a border to them. - +$( "div > p" ).css( "border", "1px solid gray" ); +]]> + Find all inputs of type radio within the first form in the document. - + Find all div elements within an XML document from an Ajax response. - + Set the background color of the page to black. - + Hide all the input elements within a form. - + @@ -162,21 +174,22 @@ $( "div > p").css("border", "1px solid gray");

            If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with <tag ... >). If not, the string is interpreted as a selector expression, as explained above. But if the string appears to be an HTML snippet, jQuery attempts to create new DOM elements as described by the HTML. Then a jQuery object is created and returned that refers to these elements. You can perform any of the usual jQuery methods on this object:

            $( "<p id='test'>My <em>new</em> text</p>" ).appendTo( "body" );

            For explicit parsing of a string to HTML, use the $.parseHTML() method.

            -

            By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

            +

            By default, elements are created with an ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document).

            If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript createElement() function.

            When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser"s .innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.

            Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

            To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag:

            $( "<a href='http://jquery.com'></a>" );

            Tags that cannot contain elements may be quick-closed or not:

            -
            $( "<img />" );
            +      
            
            +$( "<img>" );
             $( "<input>" );
            -
            +

            When passing HTML to jQuery(), please also note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally otherwise ignored or removed. E.g:

            
             var el = $( "1<br/>2<br/>3" ); // returns [<br>, "2", <br>]
             el  = $( "1<br/>2<br/>3 >" ); // returns [<br>, "2", <br>, "3 &gt;"]
            -
            +

            This behavior is expected.

            As of jQuery 1.4, the second argument to jQuery() can accept a plain object consisting of a superset of the properties that can be passed to the .attr() method.

            Important: If the second argument is passed, the HTML string in the first argument must represent a a simple element with no attributes. As of jQuery 1.4, any event type can be passed in, and the following jQuery methods can be called: val, css, html, text, data, width, height, or offset.

            @@ -186,36 +199,42 @@ $( "
            ", { "class": "my-div", on: { touchstart: function( event ) { - // do something + // Do something } } }).appendTo( "body" );

            The name "class" must be quoted in the object since it is a JavaScript reserved word, and "className" cannot be used since it refers to the DOM property, not the attribute.

            -

            While the second argument is convenient, its flexibility can lead to unintended consequences (e.g. $("<input>", {size: "4"}) calling the .size() method instead of setting the size attribute). The previous code block could thus be written instead as:

            +

            While the second argument is convenient, its flexibility can lead to unintended consequences (e.g. $( "<input>", {size: "4"} ) calling the .size() method instead of setting the size attribute). The previous code block could thus be written instead as:

            
             $( "
            " ) -.addClass( "my-div" ) -.on({ - touchstart: function( event ) { - // do something - } -}).appendTo( "body" ); -
            + .addClass( "my-div" ) + .on({ + touchstart: function( event ) { + // Do something + } + }) + .appendTo( "body" ); + Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup. - + Create some DOM elements. - +}) + .appendTo( "body" ); +]]> @@ -230,20 +249,23 @@ $( "
            " ) Binds a function to be executed when the DOM has finished loading. -

            This function behaves just like $(document).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready. While this function is, technically, chainable, there really isn"t much use for chaining against it.

            +

            This function behaves just like $( document ).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready. While this function is, technically, chainable, there really isn"t much use for chaining against it.

            Execute the function when the DOM is ready to be used. - Use both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias. - +}); +]]> diff --git a/entries/jquery-2.xml b/entries/jquery-2.xml index 059e8768..2513ec7c 100644 --- a/entries/jquery-2.xml +++ b/entries/jquery-2.xml @@ -12,23 +12,23 @@ Determine if an object is a jQuery object Get the current version of jQuery running on the page - \ No newline at end of file + From bfb41e27b5fec3a27fa16c30b4239d754b172a04 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Sun, 14 Jul 2013 23:13:59 +0100 Subject: [PATCH 242/998] Code indentation and formatting (k and l entries) --- entries/keydown.xml | 81 ++++++++++++++++++------------- entries/keypress.xml | 70 +++++++++++++++----------- entries/keyup.xml | 80 +++++++++++++++++------------- entries/lang-selector.xml | 45 +++++++++++++---- entries/last-child-selector.xml | 47 +++++++++--------- entries/last-of-type-selector.xml | 46 ++++++++++-------- entries/last-selector.xml | 14 +++--- entries/last.xml | 22 ++++++--- entries/length.xml | 35 ++++++++----- entries/live.xml | 64 ++++++++++++++---------- entries/load-event.xml | 32 +++++++----- entries/load.xml | 72 +++++++++++++++++---------- entries/lt-selector.xml | 5 +- 13 files changed, 374 insertions(+), 239 deletions(-) diff --git a/entries/keydown.xml b/entries/keydown.xml index a022191c..6ad83356 100644 --- a/entries/keydown.xml +++ b/entries/keydown.xml @@ -21,73 +21,86 @@ 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 method is a shortcut for .on( "keydown", handler ) in the first and second variations, and .trigger( "keydown" ) in the third.

            The keydown event is sent to an element when the user first presses a key on the keyboard. 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:

            -
            <form>
            -  <input id="target" type="text" value="Hello there" />
            +    
            
            +<form>
            +  <input id="target" type="text" value="Hello there">
             </form>
             <div id="other">
               Trigger the handler
            -</div>
            +</div> +

            The event handler can be bound to the input field:

            -
            $('#target').keydown(function() {
            -  alert('Handler for .keydown() called.');
            -});
            +
            
            +$( "#target" ).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.

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

            -
            $('#other').click(function() {
            -  $('#target').keydown();
            -});
            +
            
            +$( "#other" ).click(function() {
            +  $( "#target" ).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.

            +

            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. +$( "#other" ).click(function() { + $( "#target" ).keydown(); +}); +]]> 460 - + +]]> diff --git a/entries/keypress.xml b/entries/keypress.xml index b1c3f557..a34024ee 100644 --- a/entries/keypress.xml +++ b/entries/keypress.xml @@ -22,30 +22,36 @@

            Note: as the keypress event isn't covered by any official specification, the actual behavior encountered when using it may differ across browsers, browser versions, and platforms.

            -

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

            +

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

            The keypress event is sent to an element when the browser registers keyboard input. This is similar to the keydown event, except that modifier and non-printing keys such as Shift, Esc, and delete trigger keydown events but not keypress events. Other differences between the two events may arise depending on platform and browser.

            A keypress event handler 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 controls can always get focus so are reasonable candidates for this event type.

            For example, consider the HTML:

            -
            <form>
            +    
            
            +<form>
               <fieldset>
            -    <input id="target" type="text" value="Hello there" />
            +    <input id="target" type="text" value="Hello there">
               </fieldset>
             </form>
             <div id="other">
               Trigger the handler
            -</div>
            +</div> +

            The event handler can be bound to the input field:

            -
            $("#target").keypress(function() {
            -  console.log("Handler for .keypress() called.");
            -});
            +
            
            +$( "#target" ).keypress(function() {
            +  console.log( "Handler for .keypress() called." );
            +});
            +    

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

            Handler for .keypress() called.

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

            -
            $('#other').click(function() {
            -  $("#target").keypress();
            -});
            +
            
            +$( "#other" ).click(function() {
            +  $( "#target" ).keypress();
            +});
            +    

            After this code executes, clicks on the Trigger the handler div will also log 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 character was entered, 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 character code.

            @@ -55,7 +61,7 @@ Show the event object when a key is pressed in the input. Note: This demo relies on a simple $.print() plugin (http://api.jquery.com/resources/events.js) for the event object's output. +$( "#other" ).click(function() { + $( "#target" ).keypress(); +}); +]]> 460 - +]]> diff --git a/entries/keyup.xml b/entries/keyup.xml index be9bcf94..4bf09a42 100644 --- a/entries/keyup.xml +++ b/entries/keyup.xml @@ -21,28 +21,33 @@ 1.0 -

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

            +

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

            The keyup event is sent to an element when the user releases a key on the keyboard. 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:

            -
            <form>
            -  <input id="target" type="text" value="Hello there" />
            +    
            
            +<form>
            +  <input id="target" type="text" value="Hello there">
             </form>
             <div id="other">
               Trigger the handler
            -</div>
            +</div> +

            The event handler can be bound to the input field:

            -
            $('#target').keyup(function() {
            -  alert('Handler for .keyup() called.');
            +    
            
            +$( "#target" ).keyup(function() {
            +  alert( "Handler for .keyup() called." );
             });
            -
            +

            Now when the insertion point is inside the field and a key is pressed and released, the alert is displayed:

            Handler for .keyup() called.

            To trigger the event manually, apply .keyup() without arguments:

            -
            $('#other').click(function() {
            -  $('#target').keyup();
            -});
            +
            
            +$( "#other" ).click(function() {
            +  $( "#target" ).keyup();
            +});
            +    

            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.

            @@ -51,45 +56,52 @@ Show the event object for the keyup handler (using a simple $.print plugin) when a key is released in the input. +$( "#other").click(function() { + $( "#target" ).keyup(); +}); +]]> 460 - + +]]> diff --git a/entries/lang-selector.xml b/entries/lang-selector.xml index 8858e598..9ec3b3e4 100644 --- a/entries/lang-selector.xml +++ b/entries/lang-selector.xml @@ -35,16 +35,41 @@ $( "div:lang(es-es)" ).addClass( "spain" ); ]]> diff --git a/entries/last-child-selector.xml b/entries/last-child-selector.xml index 5b1f6f9a..90947be2 100644 --- a/entries/last-child-selector.xml +++ b/entries/last-child-selector.xml @@ -12,30 +12,33 @@ Find the last span in each matched div and add some css plus a hover state. - + span.solast { + text-decoration: line-through; + } +]]> + diff --git a/entries/last-of-type-selector.xml b/entries/last-of-type-selector.xml index c4bf9365..14bad2b4 100644 --- a/entries/last-of-type-selector.xml +++ b/entries/last-of-type-selector.xml @@ -12,29 +12,33 @@ Find the last span in each matched div and add some css plus a hover state. - + span.solast { + text-decoration: line-through; + } +]]> + diff --git a/entries/last-selector.xml b/entries/last-selector.xml index 2afd3cc4..2cbd886f 100644 --- a/entries/last-selector.xml +++ b/entries/last-selector.xml @@ -12,16 +12,18 @@ Finds the last table row. - - + + +]]> - \ No newline at end of file + diff --git a/entries/last.xml b/entries/last.xml index c9327b68..4f9b59df 100644 --- a/entries/last.xml +++ b/entries/last.xml @@ -16,17 +16,27 @@ <li>list item 4</li> <li>list item 5</li> </ul> - +

            We can apply this method to the set of list items:

            -
            $('li').last().css('background-color', 'red');
            +
            
            +$( "li" ).last().css( "background-color", "red" );
            +    

            The result of this call is a red background for the final item.

            Highlight the last span in a paragraph. - - - + + + - \ No newline at end of file + diff --git a/entries/length.xml b/entries/length.xml index d6d27b59..48526217 100644 --- a/entries/length.xml +++ b/entries/length.xml @@ -10,22 +10,33 @@
            Count the divs. Click to add more. - + body { + cursor: pointer; + } + div { + width: 50px; + height: 30px; + margin: 5px; + float: left; + background: green; + } + span { + color: red; + } +]]> - \ No newline at end of file + diff --git a/entries/live.xml b/entries/live.xml index 5c77f041..8c55e9c1 100644 --- a/entries/live.xml +++ b/entries/live.xml @@ -34,26 +34,32 @@

            This method provides a means to attach delegated event handlers to the document element of a page, which simplifies the use of event handlers when content is dynamically added to a page. See the discussion of direct versus delegated events in the .on() method for more information.

            Rewriting the .live() method in terms of its successors is straightforward; these are templates for equivalent calls for all three event attachment methods:

            
            -$(selector).live(events, data, handler);                // jQuery 1.3+
            -$(document).delegate(selector, events, data, handler);  // jQuery 1.4.3+
            -$(document).on(events, selector, data, handler);        // jQuery 1.7+
            -
            +$( selector ).live( events, data, handler ); // jQuery 1.3+ +$( document ).delegate( selector, events, data, handler ); // jQuery 1.4.3+ +$( document ).on( events, selector, data, handler ); // jQuery 1.7+ +

            The events argument can either be a space-separated list of event type names and optional namespaces, or an object of event name strings and handlers. The data argument is optional and can be omitted. For example, the following three method calls are functionally equivalent (but see below for more effective and performant ways to attach delegated event handlers):

            
            -$("a.offsite").live("click", function(){ alert("Goodbye!"); });                // jQuery 1.3+
            -$(document).delegate("a.offsite", "click", function(){ alert("Goodbye!"); });  // jQuery 1.4.3+
            -$(document).on("click", "a.offsite", function(){ alert("Goodbye!"); });        // jQuery 1.7+
            +$( "a.offsite" ).live( "click", function() {
            +  alert( "Goodbye!" ); // jQuery 1.3+
            +});
            +$( document ).delegate( "a.offsite", "click", function() {
            +  alert( "Goodbye!" ); // jQuery 1.4.3+
            +});
            +$( document ).on( "click", "a.offsite", function() {
            +  alert( "Goodbye!" );  // jQuery 1.7+
            +});
             

            Use of the .live() method is no longer recommended since later versions of jQuery offer better methods that do not have its drawbacks. In particular, the following issues arise with the use of .live():

            • jQuery attempts to retrieve the elements specified by the selector before calling the .live() method, which may be time-consuming on large documents.
            • -
            • Chaining methods is not supported. For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.
            • +
            • Chaining methods is not supported. For example, $( "a" ).find( ".offsite, .external" ).live( ... ); is not valid and does not work as expected.
            • Since all .live() events are attached at the document element, events take the longest and slowest possible path before they are handled.
            • On mobile iOS (iPhone, iPad and iPod Touch) the click event does not bubble to the document body for most elements and cannot be used with .live() without applying one of the following workarounds:
              1. Use natively clickable elements such as a or button, as both of these do bubble to document.
              2. Use .on() or .delegate() attached to an element below the level of document.body, since mobile iOS does bubble within the body.
              3. Apply the CSS style cursor:pointer to the element that needs to bubble clicks (or a parent including document.documentElement). Note however, this will disable copy\paste on the element and cause it to be highlighted when touched.
            • -
            • Calling event.stopPropagation() in the event handler is ineffective in stopping event handlers attached lower in the document; the event has already propagated to document.
            • -
            • The .live() method interacts with other event methods in ways that can be surprising, e.g., $(document).off("click") removes all click handlers attached by any call to .live()!
            • +
            • Calling event.stopPropagation() in the event handler is ineffective in stopping event handlers attached lower in the document; the event has already propagated to document.
            • +
            • The .live() method interacts with other event methods in ways that can be surprising, e.g., $( document ).off( "click" ) removes all click handlers attached by any call to .live()!

            For pages still using .live(), this list of version-specific differences may be helpful:

              @@ -64,40 +70,48 @@ $(document).on("click", "a.offsite", function(){ alert("Goodbye!"); }); / Cancel a default action and prevent it from bubbling up by returning false. - + Cancel only the default action by using the preventDefault method. - +}); +]]> Bind custom events with .live(). Use an object to bind multiple live event handlers. Note that .live() calls the click, mouseover, and mouseout event handlers for all paragraphs--even new ones. diff --git a/entries/load-event.xml b/entries/load-event.xml index 817aea0a..2aa11c30 100644 --- a/entries/load-event.xml +++ b/entries/load-event.xml @@ -18,19 +18,23 @@ -

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

              +

              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:

              -
              <img src="book.png" alt="Book" id="book" />
              +
              
              +<img src="book.png" alt="Book" id="book">
              +    

              The event handler can be bound to the image:

              -
              $('#book').load(function() {
              +    
              
              +$( "#book" ).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.

              +

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

              @@ -50,17 +54,21 @@ Run a function when the page is fully loaded including graphics. - + Add the class bigImg to all images with height greater then 100 upon each image load. - +}); +]]> diff --git a/entries/load.xml b/entries/load.xml index a0b4aa38..dba148ac 100644 --- a/entries/load.xml +++ b/entries/load.xml @@ -18,23 +18,29 @@ Load data from the server and place the returned HTML into the matched element.

              -

              Note: The event handling suite also has a method named .load(). jQuery determines which method to fire based on the set of arguments passed to it.

              +

              Note: The event handling suite also has a method named .load(). jQuery determines which method to fire based on the set of arguments passed to it.

              This method is the simplest way to fetch data from the server. It is roughly equivalent to $.get(url, data, success) except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when textStatus is "success" or "notmodified"), .load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

              -
              $('#result').load('ajax/test.html');
              +
              
              +$( "#result" ).load( "ajax/test.html" );
              +    

              If no element is matched by the selector — in this case, if the document does not contain an element with id="result" — the Ajax request will not be sent.

              Callback Function

              If a "complete" callback is provided, it is executed after post-processing and HTML insertion has been performed. The callback is fired once for each element in the jQuery collection, and this is set to each DOM element in turn.

              -
              $('#result').load('ajax/test.html', function() {
              -  alert('Load was performed.');
              -});
              +
              
              +$( "#result" ).load( "ajax/test.html", function() {
              +  alert( "Load was performed." );
              +});
              +    

              In the two examples above, if the current document does not contain an element with an ID of "result," the .load() method is not executed.

              Request Method

              The POST method is used if data is provided as an object; otherwise, GET is assumed.

              Loading Page Fragments

              -

              The .load() method, unlike $.get(), allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the url parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded.

              +

              The .load() method, unlike $.get(), allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the url parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded.

              We could modify the example above to use only part of the document that is fetched:

              -
              $('#result').load('ajax/test.html #container');
              +
              
              +$( "#result" ).load( "ajax/test.html #container" );
              +    

              When this method executes, it retrieves the content of ajax/test.html, but then jQuery parses the returned document to find the element with an ID of container. This element, along with its contents, is inserted into the element with an ID of result, and the rest of the retrieved document is discarded.

              jQuery uses the browser's .innerHTML property to parse the retrieved document and insert it into the current document. During this process, browsers often filter elements from the document such as <html>, <title>, or <head> elements. As a result, the elements retrieved by .load() may not be exactly the same as if the document were retrieved directly by the browser.

              Script Execution

              @@ -42,22 +48,25 @@

              Here, any JavaScript loaded into #a as a part of the document will successfully execute.

              
              -$('#a').load('article.html');
              -
              +$( "#a" ).load( "article.html" ); +

              However, in the following case, script blocks in the document being loaded into #b are stripped out and not executed:

              
              -$('#b').load('article.html #target');
              +$( "#b" ).load( "article.html #target" );
               
              Load the main page's footer navigation into an ordered list. + body { + font-size: 12px; + font-family: Arial; + } +]]> +]]> + body { + font-size: 12px; + font-family: Arial; + } +]]> +]]> Load the feeds.html file into the div with the ID of feeds. - - + + pass arrays of data to the server. - + Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding. - + diff --git a/entries/lt-selector.xml b/entries/lt-selector.xml index 450076cc..d301f11d 100644 --- a/entries/lt-selector.xml +++ b/entries/lt-selector.xml @@ -21,7 +21,7 @@ index-related selectors

              The index-related selectors (including this "less than" selector) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (.myclass) and four elements are returned, these elements are given indices 0 through 3 for the purposes of these selectors.

              -

              Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $('.myclass:lt(1)') selects the first element in the document with the class myclass, rather than selecting no elements. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

              +

              Note that since JavaScript arrays use 0-based indexing, these selectors reflect that fact. This is why $( ".myclass:lt(1)" ) selects the first element in the document with the class myclass, rather than selecting no elements. In contrast, :nth-child(n) uses 1-based indexing to conform to the CSS specification.

              Prior to jQuery 1.8, the :lt(index) selector did not accept a negative value for index

              @@ -36,7 +36,8 @@ $( "td:lt(-2)" ).css( "color", "red" ); TD #0TD #1TD #2 TD #3TD #4TD #5 TD #6TD #7TD #8 -]]> + +]]> From 9e3da9b6c36ac68f49a2ad078a0cdab203ee66fe Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Mon, 15 Jul 2013 05:18:31 +0100 Subject: [PATCH 243/998] Fixed indentation issue in css entry --- entries/css.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/css.xml b/entries/css.xml index c077da8d..491b28af 100644 --- a/entries/css.xml +++ b/entries/css.xml @@ -228,8 +228,8 @@ $( "p" ) backgroundColor : "#ddd", fontWeight: "" }; - $( this ).css( styles ); -}); + $( this ).css( styles ); + }); ]]> +

              To get a comma-separated list of checkbox IDs:

              -
              $(':checkbox').map(function() {
              -      return this.id;
              -    }).get().join();
              +
              
              +$( ":checkbox" )
              +  .map(function() {
              +    return this.id;
              +  })
              +  .get()
              +  .join();
              +    

              The result of this call is the string, "two,four,six,eight".

              Within the callback function, this refers to the current DOM element for each iteration. The function can return an individual data item or an array of data items to be inserted into the resulting set. If an array is returned, the elements inside the array are inserted into the set. If the function returns null or undefined, no element will be inserted.

              Build a list of all the values within a form. - + p { + color: red; + } +]]>
              + A contrived example to show some functionality. - A"); - $(replacement[1]).append("Extra - B"); + } else if ( index == 2 ) { + // Make two of the third item and add some text + replacement = [ replacement, $( "
            • " ).get( 0 ) ]; + $( replacement[ 0 ] ).append( " - A" ); + $( replacement[ 1 ] ).append( "Extra - B" ); } - /* replacement will be a dom element, null, - or an array of dom elements */ + // Replacement will be a dom element, null, + // or an array of dom elements return replacement; }); -$("#results").append(mappedItems); - +$( "#results" ).append( mappedItems ); ]]> - + body { + font-size: 16px; + } + ul { + float: left; + margin: 0 30px; + color: blue; + } + #results { + color: red; + } +]]> + Equalize the heights of the divs. + div { + width: 40px; + float: left; + } + input { + clear: left; + } +]]> diff --git a/entries/mousedown.xml b/entries/mousedown.xml index 715ac0a0..5f663575 100644 --- a/entries/mousedown.xml +++ b/entries/mousedown.xml @@ -21,7 +21,7 @@ 1.0 -

              This method is a shortcut for .on('mousedown', handler) in the first variation, and .trigger('mousedown') in the second.

              +

              This method is a shortcut for .on( "mousedown", handler) in the first variation, and .trigger( "mousedown" ) in the second.

              The mousedown event is sent to an element when the mouse pointer is over the element, and the mouse button is pressed. Any HTML element can receive this event.

              For example, consider the HTML:

              <div id="target">
              @@ -29,22 +29,27 @@
               </div>
               <div id="other">
                 Trigger the handler
              -</div>
              +</div> +

              The event handler can be bound to any <div>:

              -
              $('#target').mousedown(function() {
              -  alert('Handler for .mousedown() called.');
              -});
              +
              
              +$( "#target" ).mousedown(function() {
              +  alert( "Handler for .mousedown() called." );
              +});
              +    

              Now if we click on this element, the alert is displayed:

              Handler for .mousedown() called.

              We can also trigger the event when a different element is clicked:

              -
              $('#other').click(function() {
              -  $('#target').mousedown();
              -});
              +
              
              +$( "#other" ).click(function() {
              +  $( "#target" ).mousedown();
              +});
              +    

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

              The mousedown event is sent when any mouse button is clicked. To act only on specific buttons, we can use the event object's which property. Not all browsers support this property (Internet Explorer uses button instead), but jQuery normalizes the property so that it is safe to use in any browser. The value of which will be 1 for the left button, 2 for the middle button, or 3 for the right button.

              This event is primarily useful for ensuring that the primary button was used to begin a drag operation; if ignored, strange results can occur when the user attempts to use a context menu. While the middle and right buttons can be detected with these properties, this is not reliable. In Opera and Safari, for example, right mouse button clicks are not detectable by default.

              @@ -53,14 +58,16 @@ Show texts when mouseup and mousedown event triggering. - diff --git a/entries/mouseenter.xml b/entries/mouseenter.xml index 4ad7f77b..02d13f06 100644 --- a/entries/mouseenter.xml +++ b/entries/mouseenter.xml @@ -21,7 +21,7 @@ 1.0 -

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

              +

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

              The mouseenter JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser. This event is sent to an element when the mouse pointer enters the element. Any HTML element can receive this event.

              For example, consider the HTML:

              <div id="outer">
              @@ -38,13 +38,17 @@
                     
                   

              The event handler can be bound to any element:

              -
              $('#outer').mouseenter(function() {
              -  $('#log').append('<div>Handler for .mouseenter() called.</div>');
              -});
              +
              
              +$( "#outer" ).mouseenter(function() {
              +  $( "#log" ).append( "<div>Handler for .mouseenter() called.</div>" );
              +});
              +    

              Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

              -
              $('#other').click(function() {
              -      $('#outer').mouseenter();
              -    });
              +
              
              +$( "#other" ).click(function() {
              +  $( "#outer" ).mouseenter();
              +});
              +    

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

              The mouseenter event differs from mouseover in the way it handles event bubbling. If mouseover were used in this example, then when the mouse pointer moved over the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseenter event, on the other hand, only triggers its handler when the mouse enters the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse enters the Outer element, but not the Inner element.

              @@ -52,48 +56,58 @@ Show texts when mouseenter and mouseout event triggering. mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element. diff --git a/entries/mouseleave.xml b/entries/mouseleave.xml index 11a15d2a..d04a0264 100644 --- a/entries/mouseleave.xml +++ b/entries/mouseleave.xml @@ -38,61 +38,74 @@

              The event handler can be bound to any element:

              -
              $('#outer').mouseleave(function() {
              -  $('#log').append('<div>Handler for .mouseleave() called.</div>');
              -});
              +
              
              +$( "#outer" ).mouseleave(function() {
              +    $( "#log" ).append( "<div>Handler for .mouseleave() called.</div>" );
              +  });
              +    

              Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. You can also trigger the event when another element is clicked:

              -
              $('#other').click(function() {
              -  $('#outer').mouseleave();
              -});
              +
              
              +$( "#other" ).click(function() {
              +    $( "#outer" ).mouseleave();
              +  });
              +    

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

              The mouseleave event differs from mouseout in the way it handles event bubbling. If mouseout were used in this example, then when the mouse pointer moved out of the Inner element, the handler would be triggered. This is usually undesirable behavior. The mouseleave event, on the other hand, only triggers its handler when the mouse leaves the element it is bound to, not a descendant. So in this example, the handler is triggered when the mouse leaves the Outer element, but not the Inner element.

              Show number of times mouseout and mouseleave events are triggered. mouseout fires when the pointer moves out of child element as well, while mouseleave fires only when the pointer moves out of the bound element. diff --git a/entries/mousemove.xml b/entries/mousemove.xml index d6609404..446ae603 100644 --- a/entries/mousemove.xml +++ b/entries/mousemove.xml @@ -21,7 +21,7 @@ 1.0 -

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

              +

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

              The mousemove event is sent to an element when the mouse pointer moves inside the element. Any HTML element can receive this event.

              For example, consider the HTML:

              <div id="target">
              @@ -32,11 +32,13 @@
               </div>
               <div id="log"></div>

              The event handler can be bound to the target:

              -
              $("#target").mousemove(function(event) {
              +    
              
              +$( "#target" ).mousemove(function( event ) {
                 var msg = "Handler for .mousemove() called at ";
                 msg += event.pageX + ", " + event.pageY;
              -  $("#log").append("<div>" + msg + "</div>");
              -});
              + $( "#log" ).append( "<div>" + msg + "</div>" ); +}); +

              Now when the mouse pointer moves within the target button, the messages are appended to <div id="log">:

              Handler for .mousemove() called at (399, 48) @@ -49,9 +51,11 @@

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

              -
              $("#other").click(function() {
              -  $("#target").mousemove();
              -});
              +
              
              +$( "#other" ).click(function() {
              +  $( "#target" ).mousemove();
              +});
              +    

              After this code executes, clicks on the Trigger button will also append the message:

              Handler for .mousemove() called at (undefined, undefined) @@ -63,29 +67,44 @@ Show the mouse coordinates when the mouse is moved over the yellow div. Coordinates are relative to the window, which in this case is the iframe. 300 - +

              +]]> diff --git a/entries/mouseout.xml b/entries/mouseout.xml index 3314631e..a84b825f 100644 --- a/entries/mouseout.xml +++ b/entries/mouseout.xml @@ -21,10 +21,11 @@ 1.0 -

              This method is a shortcut for .on('mouseout', handler) in the first two variation, and .trigger('mouseout') in the third.

              +

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

              The mouseout event is sent to an element when the mouse pointer leaves the element. Any HTML element can receive this event.

              For example, consider the HTML:

              -
              <div id="outer">
              +    
              
              +<div id="outer">
                 Outer
                 <div id="inner">
                   Inner
              @@ -33,67 +34,82 @@
               <div id="other">
                 Trigger the handler
               </div>
              -<div id="log"></div>
              +<div id="log"></div> +

              The event handler can be bound to any element:

              -
              $('#outer').mouseout(function() {
              -  $('#log').append('Handler for .mouseout() called.');
              -});
              +
              
              +$( "#outer" ).mouseout(function() {
              +  $( "#log" ).append( "Handler for .mouseout() called." );
              +});
              +    

              Now when the mouse pointer moves out of the Outer <div>, the message is appended to <div id="log">. To trigger the event manually, apply .mouseout() without an argument::

              -
              $('#other').click(function() {
              -  $('#outer').mouseout();
              -});
              +
              
              +$( "#other" ).click(function() {
              +  $( "#outer" ).mouseout();
              +});
              +    

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

              -

              This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves out of the Inner element in this example, a mouseout event will be sent to that, then trickle up to Outer. This can trigger the bound mouseout handler at inopportune times. See the discussion for .mouseleave() for a useful alternative.

              +

              This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves out of the Inner element in this example, a mouseout event will be sent to that, then trickle up to Outer. This can trigger the bound mouseout handler at inopportune times. See the discussion for .mouseleave() for a useful alternative.

              Show the number of times mouseout and mouseleave events are triggered. mouseout fires when the pointer moves out of the child element as well, while mouseleave fires only when the pointer moves out of the bound element. diff --git a/entries/mouseover.xml b/entries/mouseover.xml index 4c03a067..016ad3d5 100644 --- a/entries/mouseover.xml +++ b/entries/mouseover.xml @@ -21,10 +21,11 @@ 1.0 -

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

              +

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

              The mouseover event is sent to an element when the mouse pointer enters the element. Any HTML element can receive this event.

              For example, consider the HTML:

              -
              <div id="outer">
              +    
              
              +<div id="outer">
                 Outer
                 <div id="inner">
                   Inner
              @@ -33,18 +34,23 @@
               <div id="other">
                 Trigger the handler
               </div>
              -<div id="log"></div>
              +<div id="log"></div> +

              The event handler can be bound to any element:

              -
              $('#outer').mouseover(function() {
              -  $('#log').append('<div>Handler for .mouseover() called.</div>');
              -});
              +
              
              +$( "#outer" ).mouseover(function() {
              +  $( "#log" ).append( "<div>Handler for .mouseover() called.</div>" );
              +});
              +    

              Now when the mouse pointer moves over the Outer <div>, the message is appended to <div id="log">. We can also trigger the event when another element is clicked:

              -
              $('#other').click(function() {
              -      $('#outer').mouseover();
              -      });
              +
              
              +$( "#other" ).click(function() {
              +  $( "#outer" ).mouseover();
              +});
              +    

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

              This event type can cause many headaches due to event bubbling. For instance, when the mouse pointer moves over the Inner element in this example, a mouseover event will be sent to that, then trickle up to Outer. This can trigger our bound mouseover handler at inopportune times. See the discussion for .mouseenter() for a useful alternative.

              @@ -52,29 +58,45 @@ Show the number of times mouseover and mouseenter events are triggered. mouseover fires when the pointer moves into the child element as well, while mouseenter fires only when the pointer moves into the bound element.
              - diff --git a/entries/multiple-attribute-selector.xml b/entries/multiple-attribute-selector.xml index d9fb1cc8..01b79299 100644 --- a/entries/multiple-attribute-selector.xml +++ b/entries/multiple-attribute-selector.xml @@ -18,14 +18,16 @@ Finds all inputs that have an id attribute and whose name attribute ends with man and sets the value. - - + - \ No newline at end of file + diff --git a/entries/multiple-selector.xml b/entries/multiple-selector.xml index de7804f3..c27a3f9b 100644 --- a/entries/multiple-selector.xml +++ b/entries/multiple-selector.xml @@ -16,55 +16,69 @@ Selects the combined results of all the specified selectors. -

              You can specify any number of selectors to combine into a single result. This multiple expression combinator is an efficient way to select disparate elements. The order of the DOM elements in the returned jQuery object may not be identical, as they will be in document order. An alternative to this combinator is the .add() method.

              +

              You can specify any number of selectors to combine into a single result. This multiple expression combinator is an efficient way to select disparate elements. The order of the DOM elements in the returned jQuery object may not be identical, as they will be in document order. An alternative to this combinator is the .add() method.

              Finds the elements that match any of these three selectors. - - + + +]]> Show the order in the jQuery object. - + b { + color: red; + font-size: 16px; + display: block; + clear:left; + } + div, span, p { + width: 40px; + height: 40px; + float: left; + margin: 10px; + background-color: blue; + padding: 3px; + color: white; + } +]]> + - \ No newline at end of file + diff --git a/entries/next-adjacent-Selector.xml b/entries/next-adjacent-Selector.xml index 2d5ec935..b3bf17a7 100644 --- a/entries/next-adjacent-Selector.xml +++ b/entries/next-adjacent-Selector.xml @@ -17,19 +17,21 @@
              Finds all inputs that are next to a label. - - + + +]]> - \ No newline at end of file + diff --git a/entries/next-siblings-selector.xml b/entries/next-siblings-selector.xml index 78d0f52f..fd5fa89f 100644 --- a/entries/next-siblings-selector.xml +++ b/entries/next-siblings-selector.xml @@ -17,33 +17,35 @@ Finds all divs that are siblings after the element with #prev as its id. Notice the span isn't selected since it is not a div and the "niece" isn't selected since it is a child of a sibling, not an actual sibling. - + - +]]> + - \ No newline at end of file + diff --git a/entries/next.xml b/entries/next.xml index 9845b3c9..9f5c804b 100644 --- a/entries/next.xml +++ b/entries/next.xml @@ -14,38 +14,50 @@

              Consider a page with a simple list on it:

              
               <ul>
              -   <li>list item 1</li>
              -   <li>list item 2</li>
              -   <li class="third-item">list item 3</li>
              -   <li>list item 4</li>
              -   <li>list item 5</li>
              +  <li>list item 1</li>
              +  <li>list item 2</li>
              +  <li class="third-item">list item 3</li>
              +  <li>list item 4</li>
              +  <li>list item 5</li>
               </ul>
               

              If we begin at the third item, we can find the element which comes just after it:

              -
              $('li.third-item').next().css('background-color', 'red');
              +
              
              +$( "li.third-item" ).next().css( "background-color", "red" );
              +    

              The result of this call is a red background behind item 4. Since we do not supply a selector expression, this following element is unequivocally included as part of the object. If we had supplied one, the element would be tested for a match before it was included.

              Find the very next sibling of each disabled button and change its text "this button is disabled". - + - + span { + color: blue; + font-weight: bold; + } + button { + width: 100px; + } +]]> + Find the very next sibling of each paragraph. Keep only the ones with a class "selected". - - + + - \ No newline at end of file + diff --git a/entries/nextAll.xml b/entries/nextAll.xml index 9999371e..8965aab6 100644 --- a/entries/nextAll.xml +++ b/entries/nextAll.xml @@ -14,52 +14,73 @@

              Consider a page with a simple list on it:

              
               <ul>
              -   <li>list item 1</li>
              -   <li>list item 2</li>
              -   <li class="third-item">list item 3</li>
              -   <li>list item 4</li>
              -   <li>list item 5</li>
              +  <li>list item 1</li>
              +  <li>list item 2</li>
              +  <li class="third-item">list item 3</li>
              +  <li>list item 4</li>
              +  <li>list item 5</li>
               </ul>
              -
              +

              If we begin at the third item, we can find the elements which come after it:

              -
              $('li.third-item').nextAll().css('background-color', 'red');
              +
              
              +$( "li.third-item" ).nextAll().css( "background-color", "red" );
              +    

              The result of this call is a red background behind items 4 and 5. Since we do not supply a selector expression, these following 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.

              Locate all the divs after the first and give them a class. - + + div { + width: 80px; + height: 80px; + background: #abc; + border: 2px solid black; + margin: 10px; + float: left; + } + div.after { + border-color: red; + } +]]> 150 - + Locate all the paragraphs after the second child in the body and give them a class. 200 - +
              div
              +]]>
              - \ No newline at end of file + diff --git a/entries/nextUntil.xml b/entries/nextUntil.xml index c254d923..7e11ad12 100644 --- a/entries/nextUntil.xml +++ b/entries/nextUntil.xml @@ -30,32 +30,32 @@ 250px Find the siblings that follow <dt id="term-2"> up to the next <dt> and give them a red background color. Also, find <dd> siblings that follow <dt id="term-1"> up to <dt id="term-3"> and give them a green text color. - + +]]> - \ No newline at end of file + diff --git a/entries/not-selector.xml b/entries/not-selector.xml index b0ffdfae..a046795e 100644 --- a/entries/not-selector.xml +++ b/entries/not-selector.xml @@ -17,26 +17,24 @@ Finds all inputs that are not checked and highlights the next sibling span. Notice there is no change when clicking the checkboxes since no click events have been linked. - +
            • +]]>
              - \ No newline at end of file + diff --git a/entries/not.xml b/entries/not.xml index ba20ebe6..def00389 100644 --- a/entries/not.xml +++ b/entries/not.xml @@ -37,9 +37,11 @@ <li>list item 4</li> <li>list item 5</li> </ul> - +

              We can apply this method to the set of list items:

              -
              $('li').not(':even').css('background-color', 'red');
              +
              
              +$( "li" ).not( ":even" ).css( "background-color", "red" );
              +    

              The result of this call is a red background for items 2 and 4, as they do not match the selector (recall that :even and :odd use 0-based indexing).

              Removing Specific Elements

              The second version of the .not() method allows us to remove elements from the matched set, assuming we have found those elements previously by some other means. For example, suppose our list had an id applied to one of its items:

              @@ -51,34 +53,45 @@ <li>list item 4</li> <li>list item 5</li> </ul> - +

              We can fetch the third list item using the native JavaScript getElementById() function, then remove it from a jQuery object:

              
              -$('li').not(document.getElementById('notli'))
              -  .css('background-color', 'red');
              -
              +$( "li" ).not( document.getElementById( "notli" ) ) + .css( "background-color", "red" ); +

              This statement changes the color of items 1, 2, 4, and 5. We could have accomplished the same thing with a simpler jQuery expression, but this technique can be useful when, for example, other libraries provide references to plain DOM nodes.

              As of jQuery 1.4, the .not() method can take a function as its argument in the same way that .filter() does. Elements for which the function returns true are excluded from the filtered set; all other elements are included.

              Adds a border to divs that are not green or blue. - + Removes the element with the ID "selected" from the set of all paragraphs. - + Removes all elements that match "div p.selected" from the total set of all paragraphs. - + - \ No newline at end of file + diff --git a/entries/nth-child-selector.xml b/entries/nth-child-selector.xml index 959f0c20..40d46787 100644 --- a/entries/nth-child-selector.xml +++ b/entries/nth-child-selector.xml @@ -10,23 +10,29 @@ Selects all elements that are the nth-child of their parent. -

              Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing two <li>s, $('li:nth-child(1)') selects the first <li> while $('li:eq(1)') selects the second.

              +

              Because jQuery's implementation of :nth- selectors is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For other selector expressions such as :eq() or :even jQuery follows JavaScript's "0-indexed" counting. Given a single <ul> containing two <li>s, $( "li:nth-child(1)" ) selects the first <li> while $( "li:eq(1)" ) selects the second.

              The :nth-child(n) pseudo-class is easily confused with :eq(n), even though the two can result in dramatically different matched elements. With :nth-child(n), all children are counted, regardless of what they are, and the specified element is selected only if it matches the selector attached to the pseudo-class. With :eq(n) only the selector attached to the pseudo-class is counted, not limited to children of any other element, and the (n+1)th one (n is 0-based) is selected.

              Further discussion of this unusual usage can be found in the W3C CSS specification.

              Find the second li in each matched ul and note it. - + - + + +]]> 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/nth-last-of-type-selector.xml b/entries/nth-last-of-type-selector.xml index 214b3ec8..91b3db02 100644 --- a/entries/nth-last-of-type-selector.xml +++ b/entries/nth-last-of-type-selector.xml @@ -15,12 +15,19 @@ Find the second to last li in each matched ul and note it. - + - + + +]]> This is a playground to see how the selector works with different strings. - - + +]]> From 6b76f10f3304524e1aed51a642deaecc97c26b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 15 Jul 2013 16:58:18 -0400 Subject: [PATCH 245/998] Cleanup. --- entries/each.xml | 14 ++--- entries/empty.xml | 4 +- entries/end.xml | 8 +-- entries/eq-selector.xml | 8 +-- entries/event.data.xml | 7 +-- entries/event.delegateTarget.xml | 2 +- .../event.isImmediatePropagationStopped.xml | 8 +-- entries/event.isPropagationStopped.xml | 6 +- entries/event.metaKey.xml | 16 ++--- entries/event.pageX.xml | 18 +++--- entries/event.pageY.xml | 18 +++--- entries/event.preventDefault.xml | 4 +- entries/event.relatedTarget.xml | 2 +- entries/event.stopImmediatePropagation.xml | 4 +- entries/event.stopPropagation.xml | 4 +- entries/event.target.xml | 6 +- entries/event.type.xml | 2 +- entries/event.which.xml | 10 +-- entries/fadeIn.xml | 9 +-- entries/fadeOut.xml | 4 +- entries/fadeTo.xml | 35 +++++------ entries/file-selector.xml | 15 +++-- entries/filter.xml | 21 +++---- entries/find.xml | 18 +++--- entries/finish.xml | 61 ++++++++++--------- entries/focus-selector.xml | 14 ++--- entries/focusout.xml | 24 ++++---- entries/get.xml | 40 +++++++----- entries/has.xml | 6 +- entries/hasClass.xml | 14 +++-- entries/header-selector.xml | 9 --- entries/height.xml | 8 +-- entries/hidden-selector.xml | 12 ++-- entries/hide.xml | 23 ++++--- entries/hover.xml | 13 ++-- entries/html.xml | 8 +-- entries/image-selector.xml | 8 +-- entries/index.xml | 2 +- entries/input-selector.xml | 5 +- entries/insertBefore.xml | 3 +- entries/is.xml | 28 ++++----- 41 files changed, 267 insertions(+), 254 deletions(-) diff --git a/entries/each.xml b/entries/each.xml index 0f21947e..ea75814e 100644 --- a/entries/each.xml +++ b/entries/each.xml @@ -31,7 +31,7 @@ $( "li" ).each(function( index ) {

              You can stop the loop from within the callback function by returning false.

              Note: most jQuery methods that return a jQuery object also loop through the set of elements in the jQuery collection — a process known as implicit iteration. When this occurs, it is often unnecessary to explicitly iterate with the .each() method:

              -
              
              +    
              
               // The .each() method is unnecessary here:
               $( "li" ).each(function() {
                 $( this ).addClass( "foo" );
              @@ -39,14 +39,14 @@ $( "li" ).each(function() {
               
               // Instead, you should rely on implicit iteration:
               $( "li" ).addClass( "bar" );
              -
              +
              Iterate over three divs and sets their color property. - Use "return" to break out of each() loops early. + Use return false to break out of each() loops early. " ); + logDiv.append( msgs.join( ", " ) + "
              " ); }); } ]]>
              diff --git a/entries/event.delegateTarget.xml b/entries/event.delegateTarget.xml index 16f1f64e..af9b55ba 100644 --- a/entries/event.delegateTarget.xml +++ b/entries/event.delegateTarget.xml @@ -20,4 +20,4 @@ $( ".box" ).on( "click", "button", function( event ) { - \ No newline at end of file + diff --git a/entries/event.isImmediatePropagationStopped.xml b/entries/event.isImmediatePropagationStopped.xml index 241881bc..44235564 100644 --- a/entries/event.isImmediatePropagationStopped.xml +++ b/entries/event.isImmediatePropagationStopped.xml @@ -11,10 +11,10 @@ Checks whether event.stopImmediatePropagation() was called. diff --git a/entries/event.pageX.xml b/entries/event.pageX.xml index 69616554..0fb99752 100644 --- a/entries/event.pageX.xml +++ b/entries/event.pageX.xml @@ -4,24 +4,24 @@ 1.0.4 - The mouse position relative to the left edge of the document. + The mouse position relative to the left edge of the document. Show the mouse position relative to the left and top edges of the document (within this iframe). diff --git a/entries/event.pageY.xml b/entries/event.pageY.xml index baf7def6..8815db94 100644 --- a/entries/event.pageY.xml +++ b/entries/event.pageY.xml @@ -4,24 +4,24 @@ 1.0.4 - The mouse position relative to the top edge of the document. + The mouse position relative to the top edge of the document. Show the mouse position relative to the left and top edges of the document (within this iframe). diff --git a/entries/event.preventDefault.xml b/entries/event.preventDefault.xml index adf92ad4..68f0a43a 100644 --- a/entries/event.preventDefault.xml +++ b/entries/event.preventDefault.xml @@ -4,7 +4,7 @@ 1.0 - If this method is called, the default action of the event will not be triggered. + If this method is called, the default action of the event will not be triggered.

              For example, clicked anchors will not take the browser to a new URL. We can use event.isDefaultPrevented() to determine if this method has been called by an event handler that was triggered by this event.

              @@ -13,7 +13,7 @@
              diff --git a/entries/event.target.xml b/entries/event.target.xml index eef599a1..7ce3c544 100644 --- a/entries/event.target.xml +++ b/entries/event.target.xml @@ -35,9 +35,9 @@ $( "body" ).click(function( event ) { Implements a simple event delegation: The click handler is added to an unordered list, and the children of its li children are hidden. Clicking one of the li children toggles (see toggle()) their children. diff --git a/entries/fadeOut.xml b/entries/fadeOut.xml index b7b3cc46..28228979 100644 --- a/entries/fadeOut.xml +++ b/entries/fadeOut.xml @@ -35,7 +35,7 @@ $( "#clickme" ).click(function() { // Animation complete. }); }); - +

              @@ -114,7 +114,7 @@ $( "span" ).hover(function() { - Find the right answer! The fade will take 250 milliseconds and change various styles when it completes. + Find the right answer! The fade will take 250 milliseconds and change various styles when it completes. @@ -86,8 +86,8 @@ $( "p" ).find( "span" ).css( "color", "red" ); } ]]> - diff --git a/entries/focus-selector.xml b/entries/focus-selector.xml index d672df28..0d3f1e23 100644 --- a/entries/focus-selector.xml +++ b/entries/focus-selector.xml @@ -12,17 +12,17 @@ Adds the focused class to whatever element has focus diff --git a/entries/get.xml b/entries/get.xml index 64c9eec9..d9e7428f 100644 --- a/entries/get.xml +++ b/entries/get.xml @@ -13,22 +13,28 @@

              The .get() method grants us access to the DOM nodes underlying each jQuery object. Consider a simple unordered list:

              
              -  <ul>
              -    <li id="foo">foo</li>
              -    <li id="bar">bar</li>
              -  </ul>
              +<ul>
              +  <li id="foo">foo</li>
              +  <li id="bar">bar</li>
              +</ul>
                     

              With an index specified, .get( index ) retrieves a single element:

              -
              console.log( $( "li" ).get( 0 ) );
              +
              
              +console.log( $( "li" ).get( 0 ) );
              +      

              Since the index is zero-based, the first list item is returned:

              <li id="foo">

              Each jQuery object also masquerades as an array, so we can use the array dereferencing operator to get at the list item instead:

              -
              console.log( $( "li" )[ 0 ] );
              +
              
              +console.log( $( "li" )[ 0 ] );
              +      

              However, this syntax lacks some of the additional capabilities of .get(), such as specifying a negative index:

              -
              console.log( $( "li" ).get( -1 ) );
              +
              
              +console.log( $( "li" ).get( -1 ) );
              +      

              A negative index is counted from the end of the matched set, so this example returns the last item in the list:

              <li id="bar"> @@ -37,11 +43,11 @@ Display the tag name of the click element. @@ -75,7 +81,9 @@ </ul>

              Without a parameter, .get() returns an array of all of the elements:

              -
              console.log( $( "li" ).get() );
              +
              
              +console.log( $( "li" ).get() );
              +      

              All of the matched DOM nodes are returned by this call, contained in a standard array:

              [<li id="foo">, <li id="bar">] @@ -84,14 +92,14 @@ Select all divs in the document and return the DOM Elements as an Array; then use the built-in reverse() method to reverse that array. - diff --git a/entries/height.xml b/entries/height.xml index 70cdf5b9..3632ed02 100644 --- a/entries/height.xml +++ b/entries/height.xml @@ -14,7 +14,7 @@

              This method is also able to find the height of the window and document.

              
              -$( window ).height();   // returns height of browser viewport
              +$( window ).height(); // returns height of browser viewport
               $( document ).height(); // returns height of HTML document
                     

              Note that .height() will always return the content height, regardless of the value of the CSS box-sizing property. As of jQuery 1.8, this may require retrieving the CSS height plus box-sizing property and then subtracting any potential border and padding on each element when the element has box-sizing: border-box. To avoid this penalty, use .css( "height" ) rather than .height().

              @@ -25,8 +25,8 @@ $( document ).height(); // returns height of HTML document Show various heights. Note the values are from the iframe so might be smaller than you expected. The yellow highlight shows the iframe body. @@ -108,12 +111,12 @@ $( "#showr" ).click(function() { span { background: #def3ca; padding: 3px; - float:left; + float: left; } ]]> @@ -202,9 +202,9 @@ $( "li" ).click(function() { An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red. 1.0 - Selects odd elements, zero-indexed. See also even. + Selects odd elements, zero-indexed. See also even.

              In particular, note that the 0-based indexing means that, counter-intuitively, :odd selects the second element, fourth element, and so on within the matched set.

              @@ -13,19 +13,22 @@ Finds odd table rows, matching the second, fourth and so on (index 1, 3, 5 etc.). - + - + +]]> diff --git a/entries/off.xml b/entries/off.xml index dbad704a..dcd9a278 100644 --- a/entries/off.xml +++ b/entries/off.xml @@ -24,70 +24,86 @@ -

              The off() method removes event handlers that were attached with .on(). See the discussion of delegated and directly bound events on that page for more information. Specific event handlers can be removed on elements by providing combinations of event names, namespaces, selectors, or handler function names. When multiple filtering arguments are given, all of the arguments provided must match for the event handler to be removed.

              +

              The off() method removes event handlers that were attached with .on(). See the discussion of delegated and directly bound events on that page for more information. Specific event handlers can be removed on elements by providing combinations of event names, namespaces, selectors, or handler function names. When multiple filtering arguments are given, all of the arguments provided must match for the event handler to be removed.

              If a simple event name such as "click" is provided, all events of that type (both direct and delegated) are removed from the elements in the jQuery set. When writing code that will be used as a plugin, or simply when working with a large code base, best practice is to attach and remove events using namespaces so that the code will not inadvertently remove event handlers attached by other code. All events of all types in a specific namespace can be removed from an element by providing just a namespace, such as ".myPlugin". At minimum, either a namespace or event name must be provided.

              To remove specific delegated event handlers, provide a selector argument. The selector string must exactly match the one passed to .on() when the event handler was attached. To remove all delegated events from an element without removing non-delegated events, use the special value "**".

              -

              A handler can also be removed by specifying the function name in the handler argument. When jQuery attaches an event handler, it assigns a unique id to the handler function. Handlers proxied by jQuery.proxy() or a similar mechanism will all have the same unique id (the proxy function), so passing proxied handlers to .off may remove more handlers than intended. In those situations it is better to attach and remove event handlers using namespaces.

              +

              A handler can also be removed by specifying the function name in the handler argument. When jQuery attaches an event handler, it assigns a unique id to the handler function. Handlers proxied by jQuery.proxy() or a similar mechanism will all have the same unique id (the proxy function), so passing proxied handlers to .off may remove more handlers than intended. In those situations it is better to attach and remove event handlers using namespaces.

              As with .on(), you can pass events as an object instead of specifying an events string and handler function as separate arguments. The keys for the events object are events and/or namespaces; the values are handler functions or the special value false.

              Add and remove event handlers on the colored button. - +
              Click!
              +]]>
              Remove all event handlers from all paragraphs: - + Remove all delegated click handlers from all paragraphs: - + Remove just one previously bound handler by passing it as the third argument: - +// ... Foo will no longer be called. +$( "body" ).off( "click", "p", foo ); +]]>
              Unbind all delegated event handlers by their namespace: - +// Remove event handlers in the ".validator" namespace +$( "form" ).off( ".validator" ); +]]> diff --git a/entries/offset.xml b/entries/offset.xml index 697b79f3..2546e3d5 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -17,41 +17,59 @@ Access the offset of the second paragraph: - +p.html( "left: " + offset.left + ", top: " + offset.top ); +]]> - + p { + margin-left: 10px; + } +]]>
              +
              Click to see the offset. - + +]]> @@ -78,9 +96,17 @@ div.abs { width:50px; height:50px; position:absolute; Set the offset of the second paragraph: - - - + + + diff --git a/entries/offsetParent.xml b/entries/offsetParent.xml index e562c9c3..363c3208 100644 --- a/entries/offsetParent.xml +++ b/entries/offsetParent.xml @@ -28,13 +28,15 @@ </ul>

              If we begin at item A, we can find its positioned ancestor:

              -
              $('li.item-a').offsetParent().css('background-color', 'red');
              +
              
              +$( "li.item-a" ).offsetParent().css( "background-color", "red" );
              +    

              This will change the color of list item II, which is positioned.

              Find the offsetParent of item "A." 250 - $('li.item-a').offsetParent().css('background-color', 'red'); + $( "li.item-a" ).offsetParent().css( "background-color", "red" ); +
            +]]> - \ No newline at end of file + diff --git a/entries/on.xml b/entries/on.xml index 1a059240..33a8b850 100644 --- a/entries/on.xml +++ b/entries/on.xml @@ -11,7 +11,7 @@ A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. - Data to be passed to the handler in event.data when an event is triggered. + Data to be passed to the handler in event.data when an event is triggered. A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. @@ -26,13 +26,13 @@ A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - Data to be passed to the handler in event.data when an event occurs. + Data to be passed to the handler in event.data when an event occurs. -

            The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()

            +

            The .on() method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on() method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind(), .delegate(), and .live(). To remove events bound with .on(), see .off(). To attach an event that runs only once and then removes itself, see .one()

            Event names and namespaces

            -

            Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon chraracters.

            +

            Any event names can be used for the events argument. jQuery will pass through the browser's standard JavaScript event types, calling the handler function when the browser generates events due to user actions such as click. In addition, the .trigger() method can trigger both standard browser event names and custom event names to call attached handlers. Event names should only contain alphanumerics, underscore, and colon chraracters.

            An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off("click.myPlugin") or .off("click.simple") without disturbing other click handlers attached to the elements. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. Namespaces beginning with an underscore are reserved for jQuery's use.

            In the second form of .on(), the events argument is a plain object. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces. The value for each key is a function (or false value) that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below.

            Direct and delegated events

            @@ -43,45 +43,53 @@

            Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready.

            In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored. On a data table with 1,000 rows in its tbody, this example attaches a handler to 1,000 elements:

            
            -$("#dataTable tbody tr").on("click", function(event){
            -  alert($(this).text());
            +$( "#dataTable tbody tr" ).on( "click", function( event ) {
            +  alert( $( this ).text() );
             });
            -
            +

            A delegated-events approach attaches an event handler to only one element, the tbody, and the event only needs to bubble up one level (from the clicked tr to tbody):

            
            -$("#dataTable tbody").on("click", "tr", function(event){
            -  alert($(this).text());
            +$( "#dataTable tbody" ).on( "click", "tr", function( event ) {
            +  alert( $( this ).text() );
             });
            -
            +

            Note: Delegated events do not work for SVG.

            The event handler and its environment

            The handler argument is a function (or the value false, see below), and is required unless you pass an object for the events argument. You can provide an anonymous handler function at the point of the .on() call, as the examples have done above, or declare a named function and pass its name:

            
            -function notify() { alert("clicked"); }
            -$("button").on("click", notify);
            -
            -

            When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

            +function notify() { + alert( "clicked" ); +} +$( "button" ).on( "click", notify ); + +

            When the browser triggers an event or other JavaScript calls jQuery's .trigger() method, jQuery passes the handler an event object it can use to analyze and change the status of the event. This object is a normalized subset of data provided by the browser; the browser's unmodified native event object is available in event.originalEvent. For example, event.type contains the event name (e.g., "resize") and event.target indicates the deepest (innermost) element where the event occurred.

            By default, most events bubble up from the original event target to the document element. At each element along the way, jQuery calls any matching event handlers that have been attached. A handler can prevent the event from bubbling further up the document tree (and thus prevent handlers on those elements from running) by calling event.stopPropagation(). Any other handlers attached on the current element will run however. To prevent that, call event.stopImmediatePropagation(). (Event handlers bound to an element are called in the same order that they were bound.)

            Similarly, a handler can call event.preventDefault() to cancel any default action that the browser may have for this event; for example, the default action on a click event is to follow the link. Not all browser events have default actions, and not all default actions can be canceled. See the W3C Events Specification for details.

            -

            Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $("a.disabled").on("click", false); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

            -

            When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $(this).

            +

            Returning false from an event handler will automatically call event.stopPropagation() and event.preventDefault(). A false value can also be passed for the handler as a shorthand for function(){ return false; }. So, $( "a.disabled" ).on( "click", false ); attaches an event handler to all links with class "disabled" that prevents them from being followed when they are clicked and also stops the event from bubbling.

            +

            When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) To create a jQuery object from the element so that it can be used with jQuery methods, use $( this ).

            Passing data to the handler

            -

            If a data argument is provided to .on() and is not null or undefined, it is passed to the handler in the event.data property each time an event is triggered. The data argument can be any type, but if a string is used the selector must either be provided or explicitly passed as null so that the data is not mistaken for a selector. Best practice is to use a plain object so that multiple values can be passed as properties.

            +

            If a data argument is provided to .on() and is not null or undefined, it is passed to the handler in the event.data property each time an event is triggered. The data argument can be any type, but if a string is used the selector must either be provided or explicitly passed as null so that the data is not mistaken for a selector. Best practice is to use a plain object so that multiple values can be passed as properties.

            As of jQuery 1.4, the same event handler can be bound to an element multiple times. This is especially useful when the event.data feature is being used, or when other unique data resides in a closure around the event handler function. For example:

            
            -function greet(event) { alert("Hello "+event.data.name); }
            -$("button").on("click", { name: "Karl" }, greet);
            -$("button").on("click", { name: "Addy" }, greet);
            -
            +function greet( event ) { + alert( "Hello "+event.data.name ); +} +$( "button" ).on( "click", { + name: "Karl" +}, greet ); +$( "button" ).on( "click", { + name: "Addy" +}, greet ); +

            The above code will generate two different alerts when the button is clicked.

            -

            As an alternative or in addition to the data argument provided to the .on() method, you can also pass data to an event handler using a second argument to .trigger() or .triggerHandler().

            +

            As an alternative or in addition to the data argument provided to the .on() method, you can also pass data to an event handler using a second argument to .trigger() or .triggerHandler().

            Event performance

            In most cases, an event such as click occurs infrequently and performance is not a significant concern. However, high frequency events such as mousemove or scroll can fire dozens of times per second, and in those cases it becomes more important to use events judiciously. Performance can be increased by reducing the amount of work done in the handler itself, caching information needed by the handler rather than recalculating it, or by rate-limiting the number of actual page updates using setTimeout.

            Attaching many delegated event handlers near the top of the document tree can degrade performance. Each time the event occurs, jQuery must compare all selectors of all attached events of that type to every element in the path from the event target up to the top of the document. For best performance, attach delegated events at a document location as close as possible to the target elements. Avoid excessive use of document or document.body for delegated events on large documents.

            -

            jQuery can process simple selectors of the form tag#id.class very quickly when they are used to filter delegated events. So, "#myForm", "a.external", and "button" are all fast selectors. Delegated events that use more complex selectors, particularly hierarchical ones, can be several times slower--although they are still fast enough for most applications. Hierarchical selectors can often be avoided simply by attaching the handler to a more appropriate point in the document. For example, instead of $("body").on("click", "#commentForm .addNew", addComment) use $("#commentForm").on("click", ".addNew", addComment).

            +

            jQuery can process simple selectors of the form tag#id.class very quickly when they are used to filter delegated events. So, "#myForm", "a.external", and "button" are all fast selectors. Delegated events that use more complex selectors, particularly hierarchical ones, can be several times slower--although they are still fast enough for most applications. Hierarchical selectors can often be avoided simply by attaching the handler to a more appropriate point in the document. For example, instead of $( "body" ).on( "click", "#commentForm .addNew", addComment ) use $( "#commentForm" ).on( "click", ".addNew", addComment ).

            Additional notes

            -

            There are shorthand methods for some events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

            -

            Deprecated in jQuery 1.8, removed in 1.9: The name "hover" used as a shorthand for the string "mouseenter mouseleave". It attaches a single event handler for those two events, and the handler must examine event.type to determine whether the event is mouseenter or mouseleave. Do not confuse the "hover" pseudo-event-name with the .hover() method, which accepts one or two functions.

            +

            There are shorthand methods for some events such as .click() that can be used to attach or trigger event handlers. For a complete list of shorthand methods, see the events category.

            +

            Deprecated in jQuery 1.8, removed in 1.9: The name "hover" used as a shorthand for the string "mouseenter mouseleave". It attaches a single event handler for those two events, and the handler must examine event.type to determine whether the event is mouseenter or mouseleave. Do not confuse the "hover" pseudo-event-name with the .hover() method, which accepts one or two functions.

            jQuery's event system requires that a DOM element allow attaching data via a property on the element, so that events can be tracked and delivered. The object, embed, and applet elements cannot attach data, and therefore cannot have jQuery events bound to them.

            The focus and blur events are specified by the W3C to not bubble, but jQuery defines cross-browser focusin and focusout events that do bubble. When focus and blur are used to attach delegated event handlers, jQuery maps the names and delivers them as focusin and focusout respectively. For consistency and clarity, use the bubbling event type names.

            In all browsers, the load, scroll, and error events (e.g., on an <img> element) do not bubble. In Internet Explorer 8 and lower, the paste and reset events do not bubble. Such events are not supported for use with delegation, but they can be used when the event handler is directly attached to the element generating the event.

            @@ -89,102 +97,145 @@ $("button").on("click", { name: "Addy" }, greet);
            Display a paragraph's text in an alert when it is clicked: - + Pass data to the event handler, which is specified here by name: - +$( "p" ).on( "click", { foo: "bar" }, myHandler ); +]]> Cancel a form submit action and prevent the event from bubbling up by returning false: - + Cancel only the default action by using .preventDefault(). - +}); +]]> Stop submit events from bubbling without preventing form submit, using .stopPropagation(). - +}); +]]> Attach and trigger custom (non-browser) events. - + +]]> Attach multiple event handlers simultaneously using a plain object. - + - +}); +]]> Click any paragraph to add another after it. Note that .on() allows a click event on any paragraph--even new ones--since the event is handled by the ever-present body element after it bubbles to there. - + Display each paragraph's text in an alert box whenever it is clicked: - + Cancel a link's default action using the preventDefault method. - +}); +]]> diff --git a/entries/one.xml b/entries/one.xml index 295eb652..f44ed2b8 100644 --- a/entries/one.xml +++ b/entries/one.xml @@ -38,24 +38,26 @@ A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. - Data to be passed to the handler in event.data when an event occurs. + Data to be passed to the handler in event.data when an event occurs.

            The first form of this method is identical to .bind(), except that the handler is unbound after its first invocation. The second two forms, introduced in jQuery 1.7, are identical to .on() except that the handler is removed after the first time the event occurs at the delegated element, whether the selector matched anything or not. For example:

            -
            $("#foo").one("click", function() {
            -  alert("This will be displayed only once.");
            +    
            
            +$( "#foo" ).one( "click", function() {
            +  alert( "This will be displayed only once." );
             });
            -$("body").one("click", "#foo", function() {
            -  alert("This displays if #foo is the first thing clicked in the body.");
            +$( "body" ).one( "click", "#foo", function() {
            +  alert( "This displays if #foo is the first thing clicked in the body." );
             });
            -
            +

            After the code is executed, a click on the element with ID foo will display the alert. Subsequent clicks will do nothing. This code is equivalent to:

            -
            $("#foo").on("click", function( event ) {
            -  alert("This will be displayed only once.");
            -  $(this).off( event );
            +    
            
            +$( "#foo" ).on( "click", function( event ) {
            +  alert( "This will be displayed only once." );
            +  $( this ).off( event );
             });
            -
            +

            In other words, explicitly calling .off() from within a regularly-bound handler has exactly the same effect.

            If the first argument contains more than one space-separated event types, the event handler is called once for each event type.

            @@ -63,22 +65,31 @@ $("body").one("click", "#foo", function() { Tie a one-time click to each div. To display the text of all paragraphs in an alert box the first time each of them is clicked: - + diff --git a/entries/only-child-selector.xml b/entries/only-child-selector.xml index a8aff997..3058fd9b 100644 --- a/entries/only-child-selector.xml +++ b/entries/only-child-selector.xml @@ -12,12 +12,19 @@ Change the text and add a border for each button that is the only child of its parent. - + +]]> diff --git a/entries/only-of-type-selector.xml b/entries/only-of-type-selector.xml index b3adfda3..542e9824 100644 --- a/entries/only-of-type-selector.xml +++ b/entries/only-of-type-selector.xml @@ -12,13 +12,25 @@ Change the text and add a border for each button that is the only child button of its parent. - + +]]> diff --git a/entries/outerHeight.xml b/entries/outerHeight.xml index e46e33e2..c7e30d41 100644 --- a/entries/outerHeight.xml +++ b/entries/outerHeight.xml @@ -10,20 +10,30 @@ Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.

            The top and bottom padding and border are always included in the .outerHeight() calculation; if the includeMargin argument is set to true, the margin (top and bottom) is also included.

            -

            This method is not applicable to window and document objects; for these, use .height() instead.

            +

            This method is not applicable to window and document objects; for these, use .height() instead.

            Get the outerHeight of a paragraph. - - - + + + - \ No newline at end of file + diff --git a/entries/outerWidth.xml b/entries/outerWidth.xml index 834f6a6a..b855c096 100644 --- a/entries/outerWidth.xml +++ b/entries/outerWidth.xml @@ -11,23 +11,30 @@

            Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.

            If includeMargin is omitted or false, the padding and border are included in the calculation; if true, the margin is also included.

            -

            This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

            +

            This method is not applicable to window and document objects; for these, use .width() instead. Although .outerWidth() can be used on table elements, it may give unexpected results on tables using the border-collapse: collapse CSS property.

            Get the outerWidth of a paragraph. - - + - \ No newline at end of file + From 0526923251af3ea07612ae6de7abdf5369d7f736 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Wed, 17 Jul 2013 11:20:32 +0100 Subject: [PATCH 247/998] Code indentation and formatting (p entries) --- entries/parent-selector.xml | 19 ++++-- entries/parent.xml | 66 +++++++++++---------- entries/parents.xml | 105 +++++++++++++++++++++------------- entries/parentsUntil.xml | 16 +++--- entries/password-selector.xml | 66 +++++++++++---------- entries/position.xml | 17 +++--- entries/prepend.xml | 92 +++++++++++++++++++---------- entries/prependTo.xml | 43 +++++++++----- entries/prev.xml | 90 +++++++++++++++++------------ entries/prevAll.xml | 49 ++++++++++------ entries/prevUntil.xml | 20 ++++--- entries/promise.xml | 49 ++++++++-------- entries/prop.xml | 67 +++++++++++++--------- entries/pushStack.xml | 12 ++-- 14 files changed, 428 insertions(+), 283 deletions(-) diff --git a/entries/parent-selector.xml b/entries/parent-selector.xml index 66c6f1e6..424cd36e 100644 --- a/entries/parent-selector.xml +++ b/entries/parent-selector.xml @@ -10,19 +10,26 @@

            This is the inverse of :empty.

            One important thing to note regarding the use of :parent (and :empty) is that child nodes include text nodes.

            The W3C recommends that the <p> element have at least one child node, even if that child is merely text (see http://www.w3.org/TR/html401/struct/text.html#edef-P). Some other elements, on the other hand, are empty (i.e. have no children) by definition: <input>, <img>, <br>, and <hr>, for example.

            -

            To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

            +

            To obtain the parents or ancestors of an existing jQuery set, see the .parent() and .parents() methods.

            Finds all tds with children, including text. - + - + + +]]> diff --git a/entries/parent.xml b/entries/parent.xml index 3e2ecb41..508a52f5 100644 --- a/entries/parent.xml +++ b/entries/parent.xml @@ -10,7 +10,7 @@ Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

            Given a jQuery object that represents a set of DOM elements, the .parent() method allows us to search through the parents of these elements in the DOM tree and construct a new jQuery object from the matching elements.

            -

            The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

            +

            The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $( "html" ).parent() method returns a set containing document whereas $( "html" ).parents() returns an empty set.

            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.

            Consider a page with a basic nested list on it:

            
            @@ -33,47 +33,55 @@
             </ul>
                 

            If we begin at item A, we can find its parents:

            -
            $('li.item-a').parent().css('background-color', 'red');
            +
            
            +$( "li.item-a" ).parent().css( "background-color", "red");
            +    

            The result of this call is a red background for the level-2 list. Since we do not supply a selector expression, the parent element is unequivocally included as part of the object. If we had supplied one, the element would be tested for a match before it was included.

            Shows the parent of each element as (parent > child). Check the View Source to see the raw html. - + +
            div, + strong, + span, + em, + b, + + + b +
            +]]>
            Find the parent element of each paragraph with a class "selected". - - + diff --git a/entries/parents.xml b/entries/parents.xml index a0ee8944..3b7f2b95 100644 --- a/entries/parents.xml +++ b/entries/parents.xml @@ -10,7 +10,7 @@ Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.

            Given a jQuery object that represents a set of DOM elements, the .parents() method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones. When multiple DOM elements are in the original set, the resulting set will be in reverse order of the original elements as well, with duplicates removed.

            -

            The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $("html").parent() method returns a set containing document whereas $("html").parents() returns an empty set.

            +

            The .parents() and .parent() methods are similar, except that the latter only travels a single level up the DOM tree. Also, $( "html" ).parent() method returns a set containing document whereas $( "html" ).parents() returns an empty set.

            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.

            Consider a page with a basic nested list on it:

            
            @@ -31,73 +31,96 @@
               </li>
               <li class="item-iii">III</li>
             </ul>
            -
            +

            If we begin at item A, we can find its ancestors:

            -
            $('li.item-a').parents().css('background-color', 'red');
            +
            
            +$( "li.item-a" ).parents().css( "background-color", "red" );
            +    

            The result of this call is a red background for the level-2 list, item II, and the level-1 list (and on up the DOM tree all the way to the <html> element). Since we do not supply a selector expression, all of the ancestors are part of the returned jQuery object. If we had supplied one, only the matching items among these would be included.

            Find all parent elements of each b. - + b { + color: blue; + } + strong { + color: red; + } +]]> + Click to find all unique div parent elements of each span. +}); +]]> - + + Click Hellos to toggle their parents. +]]> - \ No newline at end of file + diff --git a/entries/parentsUntil.xml b/entries/parentsUntil.xml index a7974b76..0d2357fa 100644 --- a/entries/parentsUntil.xml +++ b/entries/parentsUntil.xml @@ -30,12 +30,13 @@ 220px Find the ancestors of <li class="item-a"> up to <ul class="level-1"> and give them a red background color. Also, find ancestors of <li class="item-2"> that have a class of "yes" up to <ul class="level-1"> and give them a green border. +