Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All: Mark event aliases as deprecated #1223

Merged
merged 33 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1b00d2b
All: Mark event aliases as deprecated
mgol Apr 16, 2023
bff1493
All: Remove the detach-shorthand note
mgol Apr 17, 2023
bf1f218
ajaxStart: Mark the shorthand method as deprecated
mgol Apr 17, 2023
54f5c8e
All: Fix Additional Notes for all AJAX events
mgol Apr 17, 2023
df4a1c6
focus: Deprecate .focus(), tweak the blur page
mgol Apr 18, 2023
9c7639f
All: Separate blur & focus shorthand pages
mgol Apr 18, 2023
c696ca7
All: Tweak focus/blur, migrate focusin/focusout
mgol Apr 18, 2023
3b02e6b
All: Fix indentation of examples
mgol Apr 18, 2023
35b481f
hover: Deprecate the API
mgol Apr 20, 2023
a23ab44
All: Add individual descriptions back
mgol Apr 20, 2023
4f08883
resize: Deprecate the API
mgol Apr 20, 2023
8905219
All: Deprecate scroll, click & dblclick; fix resize
mgol Apr 21, 2023
a270b7a
All: De-indent entries on event pages for better Git history
mgol Apr 21, 2023
f4b077b
ajaxStart: separate the deprecated page
mgol Apr 21, 2023
611f3c7
All: Move descriptions in Ajax event pages up
mgol Apr 21, 2023
47c6e85
All: JavaScript event -> event
mgol Apr 21, 2023
e70bfa5
All: Deprecate mouse* shorthands
mgol Apr 21, 2023
e6d774d
All: Deprecate change & select
mgol Apr 21, 2023
2537bc7
All: Remove a few .click() uses
mgol Apr 21, 2023
db29f90
All: Deprecate other event shorthands
mgol Apr 23, 2023
027012f
All: Add separate shorthand pages for load/unload
mgol Apr 23, 2023
4f41f67
All: Link to shorthands from event pages
mgol Apr 23, 2023
ada6134
All: Add other AJAX shorthand pages
mgol Apr 23, 2023
6f41267
All: Migrare AJAX event pages
mgol Apr 23, 2023
6f9101b
All: Remove obsolete shortcut notes
mgol Apr 23, 2023
f6ac37a
error: Separate the event page, like for load & unload
mgol Apr 23, 2023
d0ef87b
All: Remove internal usage of deprecated event shorthands
mgol Apr 23, 2023
16ea4ad
All: Tweak wording on event pages on on/bind
mgol Apr 23, 2023
4205fd6
All: Remove internal ajax event shorthand usage
mgol Apr 23, 2023
fecc648
All: Add descriptions to ajax event shorthand pages
mgol Apr 23, 2023
65d3204
All: Tweak the warning on load/unload, add one for error
mgol Apr 24, 2023
a7fa37f
All: Add shorthand notes on AJAX event pages as well
mgol Apr 24, 2023
b4bc05e
All: Fix links to AJAX events on shorthand pages
mgol Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions entries/ajaxComplete-shorthand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxComplete" return="jQuery" deprecated="3.3">
<title>.ajaxComplete()</title>
<desc>Register a handler to be called when Ajax requests complete. This is an <a href="/Ajax_Events/">AjaxEvent</a>.</desc>
<signature>
<added>1.0</added>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<longdesc>
<div class="warning">
<p>This API is deprecated. Use <a href="/ajaxComplete/"><code>.on( "ajaxComplete", handler )</code></a> instead.</p>
</div>
</longdesc>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="deprecated/deprecated-3.3"/>
</entry>
37 changes: 22 additions & 15 deletions entries/ajaxComplete.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxComplete" return="jQuery">
<title>.ajaxComplete()</title>
<entry type="method" name="on" return="jQuery">
<title>ajaxComplete event</title>
<desc>Register a handler to be called when Ajax requests complete. This is an <a href="/Ajax_Events/">AjaxEvent</a>.</desc>
<signature>
<added>1.0</added>
<added>1.7</added>
<argument name="&quot;ajaxComplete&quot;" type="string">
<desc>The string <code>"ajaxComplete"</code>.</desc>
</argument>
<argument name="handler" type="Function">
<argument name="event" type="Event" />
<argument name="jqXHR" type="jqXHR" />
<argument name="ajaxOptions" type="PlainObject" />
<desc>The function to be invoked.</desc>
</argument>
</signature>
<desc>Register a handler to be called when Ajax requests complete. This is an <a href="/Ajax_Events/">AjaxEvent</a>.</desc>
<longdesc>
<p>Whenever an Ajax request completes, jQuery triggers the <code>ajaxComplete</code> event. Any and all handlers that have been registered with the <code>.ajaxComplete()</code> method are executed at this time.</p>
<div class="warning">
<p>This page describes the <code>ajaxComplete</code> event. For the deprecated <code>.ajaxComplete()</code> method, see <a href="/ajaxComplete-shorthand/"><code>.ajaxComplete()</code></a>.</p>
</div>
<p>Whenever an Ajax request completes, jQuery triggers the <code>ajaxComplete</code> event. Any and all registered <code>ajaxComplete</code> handlers are executed at this time.</p>
<p>To observe this method in action, set up a basic Ajax load request:</p>
<pre><code>
&lt;div class="trigger"&gt;Trigger&lt;/div&gt;
Expand All @@ -21,38 +27,39 @@
</code></pre>
<p>Attach the event handler to the document:</p>
<pre><code>
$( document ).ajaxComplete(function() {
$( document ).on( "ajaxComplete", function() {
$( ".log" ).text( "Triggered ajaxComplete handler." );
});
} );
</code></pre>
<p>Now, make an Ajax request using any jQuery method:</p>
<pre><code>
$( ".trigger" ).click(function() {
$( ".trigger)" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
});
} );
</code></pre>
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request completes, the log message is displayed.</p>
<p>All <code>ajaxComplete</code> 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 <code>ajaxComplete</code> handler is executed, it is passed the event object, the <code>XMLHttpRequest</code> 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:</p>
<pre><code>
$( 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 );
}
});
} );
</code></pre>
<p><strong>Note:</strong> You can get the returned Ajax contents by looking at <code>xhr.responseText</code>.</p>
</longdesc>
<note id="global-ajax-event" type="additional" data-title=".ajaxComplete()"/>
<note id="ajax-global-false" type="additional" data-title=".ajaxComplete()"/>
<note id="global-ajax-event" type="additional" data-title="ajaxComplete"/>
<note id="ajax-global-false" type="additional" data-title="ajaxComplete"/>
<example>
<desc>Show a message when an Ajax request completes.</desc>
<code><![CDATA[
$( document ).ajaxComplete(function( event, request, settings ) {
$( document ).on( "ajaxComplete", function( event, request, settings ) {
$( "#msg" ).append( "<li>Request Complete.</li>" );
});
} );
]]></code>
</example>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="version/1.7"/>
</entry>
19 changes: 19 additions & 0 deletions entries/ajaxError-shorthand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxError" return="jQuery" deprecated="3.3">
<title>.ajaxError()</title>
<desc>Register a handler to be called when Ajax requests complete with an error. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<longdesc>
<div class="warning">
<p>This API is deprecated. Use <a href="/ajaxError/"><code>.on( "ajaxError", handler )</code></a> instead.</p>
</div>
</longdesc>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="deprecated/deprecated-3.3"/>
</entry>
36 changes: 22 additions & 14 deletions entries/ajaxError.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxError" return="jQuery">
<title>.ajaxError()</title>
<entry type="method" name="on" return="jQuery">
<title>ajaxError event</title>
<desc>Register a handler to be called when Ajax requests complete with an error. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<added>1.7</added>
<argument name="&quot;ajaxError&quot;" type="string">
<desc>The string <code>"ajaxError"</code>.</desc>
</argument>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
<argument name="event" type="Event" />
Expand All @@ -11,9 +15,11 @@
<argument name="thrownError" type="String" />
</argument>
</signature>
<desc>Register a handler to be called when Ajax requests complete with an error. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<longdesc>
<p>Whenever an Ajax request completes with an error, jQuery triggers the <code>ajaxError</code> event. Any and all handlers that have been registered with the <code>.ajaxError()</code> method are executed at this time. <strong>Note:</strong> <em>This handler is not called for cross-domain script and cross-domain JSONP requests.</em></p>
<div class="warning">
<p>This page describes the <code>ajaxError</code> event. For the deprecated <code>.ajaxError()</code> method, see <a href="/ajaxError-shorthand/"><code>.ajaxError()</code></a>.</p>
</div>
<p>Whenever an Ajax request completes with an error, jQuery triggers the <code>ajaxError</code> event. Any and all registered <code>ajaxError</code> handlers are executed at this time. <strong>Note:</strong> <em>This handler is not called for cross-domain script and cross-domain JSONP requests.</em></p>
<p>To observe this method in action, set up a basic Ajax load request.</p>
<pre><code>
&lt;button class="trigger"&gt;Trigger&lt;/button&gt;
Expand All @@ -22,35 +28,37 @@
</code></pre>
<p>Attach the event handler to the document:</p>
<pre><code>
$( document ).ajaxError(function() {
$( document ).on( "ajaxError", function() {
$( ".log" ).text( "Triggered ajaxError handler." );
});
} );
</code></pre>
<p>Now, make an Ajax request using any jQuery method:</p>
<pre><code>
$( "button.trigger" ).on( "click", function() {
$( "div.result" ).load( "ajax/missing.html" );
});
} );
</code></pre>
<p>When the user clicks the button and the Ajax request fails, because the requested file is missing, the log message is displayed.</p>
<p>All <code>ajaxError</code> 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 <code>ajaxError</code> handler is executed, it is passed the event object, the <code>jqXHR</code> object (prior to jQuery 1.5, the <code><abbr title="XMLHttpRequest">XHR</abbr></code> object), and the settings object that was used in the creation of the request. When an HTTP error occurs, the fourth argument (<code>thrownError</code>) 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:</p>
<pre><code>
$( 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." );
}
});</code></pre>
} );
</code></pre>
</longdesc>
<note id="global-ajax-event" type="additional" data-title=".ajaxError()"/>
<note id="ajax-global-false" type="additional" data-title=".ajaxError()"/>
<note id="global-ajax-event" type="additional" data-title="ajaxError"/>
<note id="ajax-global-false" type="additional" data-title="ajaxError"/>
<example>
<desc>Show a message when an Ajax request fails.</desc>
<code><![CDATA[
$( document ).ajaxError(function( event, request, settings ) {
$( document ).on( "ajaxError", function( event, request, settings ) {
$( "#msg" ).append( "<li>Error requesting page " + settings.url + "</li>" );
});
} );
]]></code>
</example>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="version/1.7"/>
</entry>
19 changes: 19 additions & 0 deletions entries/ajaxSend-shorthand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxSend" return="jQuery" deprecated="3.3">
<title>.ajaxSend()</title>
<desc>Attach a function to be executed before an Ajax request is sent. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<longdesc>
<div class="warning">
<p>This API is deprecated. Use <a href="/ajaxSend/"><code>.on( "ajaxSend", handler )</code></a> instead.</p>
</div>
</longdesc>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="deprecated/deprecated-3.3"/>
</entry>
37 changes: 22 additions & 15 deletions entries/ajaxSend.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxSend" return="jQuery">
<title>.ajaxSend()</title>
<entry type="method" name="on" return="jQuery">
<title>ajaxSend event</title>
<desc>Attach a function to be executed before an Ajax request is sent. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<added>1.7</added>
<argument name="&quot;ajaxSend&quot;" type="string">
<desc>The string <code>"ajaxSend"</code>.</desc>
</argument>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
<argument name="event" type="Event" />
<argument name="jqXHR" type="jqXHR" />
<argument name="ajaxOptions" type="PlainObject" />
</argument>
</signature>
<desc>Attach a function to be executed before an Ajax request is sent. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<longdesc>
<p>Whenever an Ajax request is about to be sent, jQuery triggers the <code>ajaxSend</code> event. Any and all handlers that have been registered with the <code>.ajaxSend()</code> method are executed at this time.</p>
<div class="warning">
<p>This page describes the <code>ajaxSend</code> event. For the deprecated <code>.ajaxSend()</code> method, see <a href="/ajaxSend-shorthand/"><code>.ajaxSend()</code></a>.</p>
</div>
<p>Whenever an Ajax request is about to be sent, jQuery triggers the <code>ajaxSend</code> event. Any and all registerd <code>ajaxSend</code> handlers are executed at this time.</p>
<p>To observe this method in action, set up a basic Ajax load request:</p>
<pre><code>
&lt;div class="trigger"&gt;Trigger&lt;/div&gt;
Expand All @@ -21,36 +27,37 @@
</code></pre>
<p>Attach the event handler to the document:</p>
<pre><code>
$( document ).ajaxSend(function() {
$( document ).on( "ajaxSend", function() {
$( ".log" ).text( "Triggered ajaxSend handler." );
});
} );
</code></pre>
<p>Now, make an Ajax request using any jQuery method:</p>
<pre><code>
$( ".trigger" ).click(function() {
$( ".trigger)" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
});
} );
</code></pre>
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request is about to begin, the log message is displayed.</p>
<p>All <code>ajaxSend</code> 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 <code>ajaxSend</code> handler is executed, it is passed the event object, the <code>jqXHR</code> object (in version 1.4, <code>XMLHttpRequest</code>object), and the <a href="/jQuery.ajax/">settings object</a> 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:</p>
<pre><code>
$( document ).ajaxSend(function( event, jqxhr, settings ) {
$( document ).on( "ajaxSend", function( event, jqxhr, settings ) {
if ( settings.url == "ajax/test.html" ) {
$( ".log" ).text( "Triggered ajaxSend handler." );
}
});
} );
</code></pre>
</longdesc>
<note id="global-ajax-event" type="additional" data-title=".ajaxSend()"/>
<note id="ajax-global-false" type="additional" data-title=".ajaxSend()"/>
<note id="global-ajax-event" type="additional" data-title="ajaxSend"/>
<note id="ajax-global-false" type="additional" data-title="ajaxSend"/>
<example>
<desc>Show a message before an Ajax request is sent.</desc>
<code><![CDATA[
$( document ).ajaxSend(function( event, request, settings ) {
$( document ).on( "ajaxSend", function( event, request, settings ) {
$( "#msg" ).append( "<li>Starting request at " + settings.url + "</li>" );
});
} );
]]></code>
</example>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="version/1.7"/>
</entry>
19 changes: 19 additions & 0 deletions entries/ajaxStart-shorthand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxStart" return="jQuery" deprecated="3.3">
<title>.ajaxStart()</title>
<desc>Register a handler to be called when the first Ajax request begins. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<longdesc>
<div class="warning">
<p>This API is deprecated. Use <a href="/ajaxStart/"><code>.on( "ajaxStart", handler )</code></a> instead.</p>
</div>
</longdesc>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="deprecated/deprecated-3.3"/>
</entry>
33 changes: 20 additions & 13 deletions entries/ajaxStart.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxStart" return="jQuery">
<title>.ajaxStart()</title>
<entry type="method" name="on" return="jQuery">
<title>ajaxStart event</title>
<desc>Register a handler to be called when the first Ajax request begins. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<added>1.7</added>
<argument name="&quot;ajaxStart&quot;" type="string">
<desc>The string <code>"ajaxStart"</code>.</desc>
</argument>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<desc>Register a handler to be called when the first Ajax request begins. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<longdesc>
<p>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 <code>ajaxStart</code> event. Any and all handlers that have been registered with the <code>.ajaxStart()</code> method are executed at this time.</p>
<div class="warning">
<p>This page describes the <code>ajaxStart</code> event. For the deprecated <code>.ajaxStart()</code> method, see <a href="/ajaxStart-shorthand/"><code>.ajaxStart()</code></a>.</p>
</div>
<p>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 <code>ajaxStart</code> event. Any and all handlers that have been registered with <code>.on( "ajaxStart", ... )</code> are executed at this time.</p>
<p>To observe this method in action, set up a basic Ajax load request:</p>
<pre><code>
&lt;div class="trigger"&gt;Trigger&lt;/div&gt;
Expand All @@ -18,28 +24,29 @@
</code></pre>
<p>Attach the event handler to any element:</p>
<pre><code>
$( document ).ajaxStart(function() {
$( document ).on( "ajaxStart", function() {
$( ".log" ).text( "Triggered ajaxStart handler." );
});
} );
</code></pre>
<p>Now, make an Ajax request using any jQuery method:</p>
<pre><code>
$( ".trigger" ).click(function() {
$( ".trigger" ).on( "click", function() {
$( ".result" ).load( "ajax/test.html" );
});
} );
</code></pre>
<p>When the user clicks the element with class <code>trigger</code> and the Ajax request is sent, the log message is displayed.</p>
</longdesc>
<note id="global-ajax-event" type="additional" data-title=".ajaxStart()"/>
<note id="ajax-global-false" type="additional" data-title=".ajaxStart()"/>
<note id="global-ajax-event" type="additional" data-title="ajaxStart"/>
<note id="ajax-global-false" type="additional" data-title="ajaxStart"/>
<example>
<desc>Show a loading message whenever an Ajax request starts (and none is already active).</desc>
<code><![CDATA[
$( document ).ajaxStart(function() {
$( document ).on( "ajaxStart", function() {
$( "#loading" ).show();
});
} );
]]></code>
</example>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="version/1.7"/>
</entry>
19 changes: 19 additions & 0 deletions entries/ajaxStop-shorthand.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<entry type="method" name="ajaxStop" return="jQuery" deprecated="3.3">
<title>.ajaxStop()</title>
<desc>Register a handler to be called when all Ajax requests have completed. This is an <a href="/Ajax_Events/">Ajax Event</a>.</desc>
<signature>
<added>1.0</added>
<argument name="handler" type="Function">
<desc>The function to be invoked.</desc>
</argument>
</signature>
<longdesc>
<div class="warning">
<p>This API is deprecated. Use <a href="/ajaxStop/"><code>.on( "ajaxStop", handler )</code></a> instead.</p>
</div>
</longdesc>
<category slug="ajax/global-ajax-event-handlers"/>
<category slug="version/1.0"/>
<category slug="deprecated/deprecated-3.3"/>
</entry>
Loading