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 @@
+
+ This API is deprecated. Use Whenever an Ajax request completes, jQuery triggers the This page describes the Whenever an Ajax request completes, jQuery triggers the To observe this method in action, set up a basic Ajax load request: Attach the event handler to the document: Now, make an Ajax request using any jQuery method: When the user clicks the element with class All Note: You can get the returned Ajax contents by looking at This API is deprecated. Use Whenever an Ajax request completes with an error, jQuery triggers the This page describes the Whenever an Ajax request completes with an error, jQuery triggers the To observe this method in action, set up a basic Ajax load request. Attach the event handler to the document: Now, make an Ajax request using any jQuery method: When the user clicks the button and the Ajax request fails, because the requested file is missing, the log message is displayed. All This API is deprecated. Use Whenever an Ajax request is about to be sent, jQuery triggers the This page describes the Whenever an Ajax request is about to be sent, jQuery triggers the To observe this method in action, set up a basic Ajax load request: Attach the event handler to the document: Now, make an Ajax request using any jQuery method: When the user clicks the element with class All This API is deprecated. Use 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 This page describes the 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 To observe this method in action, set up a basic Ajax load request: Attach the event handler to any element: Now, make an Ajax request using any jQuery method: When the user clicks the element with class This API is deprecated. Use Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the This page describes the Whenever an Ajax request completes, jQuery checks whether there are any other outstanding Ajax requests. If none remain, jQuery triggers the To observe this method in action, set up a basic Ajax load request: Attach the event handler to the document: Now, make an Ajax request using any jQuery method: When the user clicks the element with class This API is deprecated. Use Whenever an Ajax request completes successfully, jQuery triggers the This page describes the Whenever an Ajax request completes successfully, jQuery triggers the To observe this method in action, set up a basic Ajax load request: Attach the event handler to any element: Now, make an Ajax request using any jQuery method: When the user clicks the element with class All Note: You can get the returned Ajax contents by looking at To animate the opacity, left offset, and height of the image simultaneously: As of jQuery version 1.4, you can set per-property easing functions within a single For example, to simultaneously animate the width and height with the In the second version of This API is deprecated. Instead of Instead of This method is a shortcut for This page describes the The For example, consider the HTML: The event handler can be bound to the first input field: 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 To trigger the event programmatically, call After this code executes, clicks on Trigger the handler will also alert the message. The The See the description for See the description for .on( "ajaxComplete", handler )
instead."ajaxComplete"
.ajaxComplete
event. Any and all handlers that have been registered with the .ajaxComplete()
method are executed at this time.ajaxComplete
event. For the deprecated .ajaxComplete()
method, see .ajaxComplete()
.ajaxComplete
event. Any and all registered ajaxComplete
handlers are executed at this time.
<div class="trigger">Trigger</div>
@@ -21,38 +27,39 @@
-$( document ).ajaxComplete(function() {
+$( document ).on( "ajaxComplete", function() {
$( ".log" ).text( "Triggered ajaxComplete handler." );
-});
+} );
-$( ".trigger" ).click(function() {
+$( ".trigger)" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
-});
+} );
trigger
and the Ajax request completes, the log message is displayed.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 );
}
-});
+} );
xhr.responseText
.
.on( "ajaxError", handler )
instead."ajaxError"
.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.ajaxError
event. For the deprecated .ajaxError()
method, see .ajaxError()
.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.
<button class="trigger">Trigger</button>
@@ -22,35 +28,37 @@
-$( document ).ajaxError(function() {
+$( document ).on( "ajaxError", function() {
$( ".log" ).text( "Triggered ajaxError handler." );
-});
+} );
$( "button.trigger" ).on( "click", function() {
$( "div.result" ).load( "ajax/missing.html" );
-});
+} );
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." );
}
-});
.on( "ajaxSend", handler )
instead."ajaxSend"
.ajaxSend
event. Any and all handlers that have been registered with the .ajaxSend()
method are executed at this time.ajaxSend
event. For the deprecated .ajaxSend()
method, see .ajaxSend()
.ajaxSend
event. Any and all registerd ajaxSend
handlers are executed at this time.
<div class="trigger">Trigger</div>
@@ -21,36 +27,37 @@
-$( document ).ajaxSend(function() {
+$( document ).on( "ajaxSend", function() {
$( ".log" ).text( "Triggered ajaxSend handler." );
-});
+} );
-$( ".trigger" ).click(function() {
+$( ".trigger)" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
-});
+} );
trigger
and the Ajax request is about to begin, the log message is displayed.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, XMLHttpRequest
object), 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." );
}
-});
+} );
.on( "ajaxStart", handler )
instead."ajaxStart"
.ajaxStart
event. Any and all handlers that have been registered with the .ajaxStart()
method are executed at this time.ajaxStart
event. For the deprecated .ajaxStart()
method, see .ajaxStart()
.ajaxStart
event. Any and all handlers that have been registered with .on( "ajaxStart", ... )
are executed at this time.
<div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
-$( document ).ajaxStart(function() {
+$( document ).on( "ajaxStart", function() {
$( ".log" ).text( "Triggered ajaxStart handler." );
-});
+} );
-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
-});
+} );
trigger
and the Ajax request is sent, the log message is displayed.
.on( "ajaxStop", handler )
instead."ajaxStop"
.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. ajaxStop
event. For the deprecated .ajaxStop()
method, see .ajaxStop()
.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.
<div class="trigger">Trigger</div>
@@ -18,28 +24,29 @@
-$( document ).ajaxStop(function() {
+$( document ).on( "ajaxStop", function() {
$( ".log" ).text( "Triggered ajaxStop handler." );
-});
+} );
-$( ".trigger" ).click(function() {
+$( ".trigger" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
-});
+} );
trigger
and the Ajax request completes, the log message is displayed.
.on( "ajaxSuccess", handler )
instead."ajaxSuccess"
.ajaxSuccess
event. Any and all handlers that have been registered with the .ajaxSuccess()
method are executed at this time.ajaxSuccess
event. For the deprecated .ajaxSuccess()
method, see .ajaxSuccess()
.ajaxSuccess
event. Any and all registered ajaxSuccess
handlers are executed at this time.
<div class="trigger">Trigger</div>
@@ -22,38 +28,39 @@
-$(document).ajaxSuccess(function() {
+$( document ).on( "ajaxSuccess", function() {
$( ".log" ).text( "Triggered ajaxSuccess handler." );
-});
+} );
$( ".trigger" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
-});
+} );
trigger
and the Ajax request completes successfully, the log message is displayed.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 );
}
-});
+} );
xhr.responseXML
or xhr.responseText
for xml and html respectively.
-$( "#clickme" ).click(function() {
+$( "#clickme)" ).on( "click", function() {
$( "#book" ).animate({
opacity: 0.25,
left: "+=50",
@@ -101,7 +101,7 @@ $( "li" ).animate({
.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.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() {
.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() {
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 @@
+
+
@@ -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.
.blur( handler )
or .blur( eventData, handler )
, use .on( "blur", handler )
or .on( "blur", eventData, handler )
, respectively..blur()
, use .trigger( "blur" )
."blur"
..on( "blur", handler )
in the first two variations, and .trigger( "blur" )
in the third.blur
event. For the deprecated .blur()
method, see .blur()
.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.
+
@@ -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." );
-});
+
+$( "#target" ).on( "blur", function() {
+ alert( "Handler for `blur` called." );
+} );
.blur()
without an argument:.trigger( "blur" )
:
-$( "#other" ).click(function() {
- $( "#target" ).blur();
-});
+$( "#other" ).on( "click", function() {
+ $( "#target" ).trigger( "blur" );
+} );
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()
.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.
"blur"
..on( "blur", ... )
."change"
..on( "change", ... )
.