-
Notifications
You must be signed in to change notification settings - Fork 263
All: Mark event aliases as deprecated #1223
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
1b00d2b
All: Mark event aliases as deprecated
mgol bff1493
All: Remove the detach-shorthand note
mgol bf1f218
ajaxStart: Mark the shorthand method as deprecated
mgol 54f5c8e
All: Fix Additional Notes for all AJAX events
mgol df4a1c6
focus: Deprecate .focus(), tweak the blur page
mgol 9c7639f
All: Separate blur & focus shorthand pages
mgol c696ca7
All: Tweak focus/blur, migrate focusin/focusout
mgol 3b02e6b
All: Fix indentation of examples
mgol 35b481f
hover: Deprecate the API
mgol a23ab44
All: Add individual descriptions back
mgol 4f08883
resize: Deprecate the API
mgol 8905219
All: Deprecate scroll, click & dblclick; fix resize
mgol a270b7a
All: De-indent entries on event pages for better Git history
mgol f4b077b
ajaxStart: separate the deprecated page
mgol 611f3c7
All: Move descriptions in Ajax event pages up
mgol 47c6e85
All: JavaScript event -> event
mgol e70bfa5
All: Deprecate mouse* shorthands
mgol e6d774d
All: Deprecate change & select
mgol 2537bc7
All: Remove a few .click() uses
mgol db29f90
All: Deprecate other event shorthands
mgol 027012f
All: Add separate shorthand pages for load/unload
mgol 4f41f67
All: Link to shorthands from event pages
mgol ada6134
All: Add other AJAX shorthand pages
mgol 6f41267
All: Migrare AJAX event pages
mgol 6f9101b
All: Remove obsolete shortcut notes
mgol f6ac37a
error: Separate the event page, like for load & unload
mgol d0ef87b
All: Remove internal usage of deprecated event shorthands
mgol 16ea4ad
All: Tweak wording on event pages on on/bind
mgol 4205fd6
All: Remove internal ajax event shorthand usage
mgol fecc648
All: Add descriptions to ajax event shorthand pages
mgol 65d3204
All: Tweak the warning on load/unload, add one for error
mgol a7fa37f
All: Add shorthand notes on AJAX event pages as well
mgol b4bc05e
All: Fix links to AJAX events on shorthand pages
mgol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
All: Mark event aliases as deprecated
Fixes gh-1205
- Loading branch information
commit 1b00d2bbabfc0fa0d00e1582c34cc5e63bec12a1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,111 @@ | ||
<?xml version="1.0"?> | ||
<entry type="method" name="blur" return="jQuery"> | ||
<title>.blur()</title> | ||
<entries> | ||
<desc>Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.</desc> | ||
<signature> | ||
<added>1.0</added> | ||
<argument name="handler" type="Function"> | ||
<desc>A function to execute each time the event is triggered.</desc> | ||
<argument name="eventObject" type="Event" /> | ||
</argument> | ||
</signature> | ||
<signature> | ||
<added>1.4.3</added> | ||
<argument name="eventData" type="Anything" optional="true"> | ||
<desc>An object containing data that will be passed to the event handler.</desc> | ||
</argument> | ||
<argument name="handler" type="Function"> | ||
<desc>A function to execute each time the event is triggered.</desc> | ||
<argument name="eventObject" type="Event" /> | ||
</argument> | ||
</signature> | ||
<signature> | ||
<added>1.0</added> | ||
</signature> | ||
<longdesc> | ||
<p>This method is a shortcut for <code>.on( "blur", handler )</code> in the first two variations, and <code>.trigger( "blur" )</code> in the third.</p> | ||
<p>The <code>blur</code> event is sent to an element when it loses focus. Originally, this event was only applicable to form elements, such as <code><input></code>. 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.</p> | ||
<p>For example, consider the HTML:</p> | ||
<pre><code> | ||
<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." ); | ||
}); | ||
</code></pre> | ||
<p>Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert:</p> | ||
<p> | ||
<samp>Handler for .blur() called.</samp> | ||
</p> | ||
<p>To trigger the event programmatically, apply <code>.blur()</code> without an argument:</p> | ||
<pre><code> | ||
$( "#other" ).click(function() { | ||
$( "#target" ).blur(); | ||
}); | ||
</code></pre> | ||
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p> | ||
<p>The <code>blur</code> event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the <code>blur</code> event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping <code>blur</code> to the <code>focusout</code> event in its event delegation methods, <a href="/live/"><code>.live()</code></a> and <a href="/delegate/"><code>.delegate()</code></a>.</p> | ||
</longdesc> | ||
<note id="detach-shorthand" type="additional" data-event="blur"/> | ||
<example> | ||
<desc>To trigger the blur event on all paragraphs:</desc> | ||
<code><![CDATA[ | ||
$( "p" ).blur(); | ||
]]></code> | ||
</example> | ||
<category slug="events/form-events"/> | ||
<category slug="forms"/> | ||
<category slug="version/1.0"/> | ||
<category slug="version/1.4.3"/> | ||
</entry> | ||
<entry type="method" name="on" return="jQuery"> | ||
<title>blur event</title> | ||
<signature> | ||
<added>1.7</added> | ||
<argument name=""blur"" type="string"> | ||
<desc>The string <code>"blur"</code>.</desc> | ||
</argument> | ||
<argument name="eventData" type="Anything" optional="true"> | ||
<desc>An object containing data that will be passed to the event handler.</desc> | ||
</argument> | ||
<argument name="handler" type="Function"> | ||
<desc>A function to execute each time the event is triggered.</desc> | ||
<argument name="eventObject" type="Event" /> | ||
</argument> | ||
</signature> | ||
<longdesc> | ||
<p>The <code>blur</code> event is sent to an element when it loses focus. Originally, this event was only applicable to form elements, such as <code><input></code>. 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.</p> | ||
<p>For example, consider the HTML:</p> | ||
<pre><code> | ||
<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" ).on( "blur", function() { | ||
alert( "Handler for `blur` called." ); | ||
} ); | ||
</code></pre> | ||
<p>Now if the first field has the focus, clicking elsewhere or tabbing away from it displays the alert:</p> | ||
<p> | ||
<samp>Handler for `blur` called.</samp> | ||
</p> | ||
<p>To trigger the event programmatically, call <code>.trigger( "blur" )</code>:</p> | ||
<pre><code> | ||
$( "#other" ).on( "click", function() { | ||
$( "#target" ).trigger( "blur" ); | ||
} ); | ||
</code></pre> | ||
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p> | ||
<p>The <code>blur</code> event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the <code>blur</code> event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping <code>blur</code> to the <code>focusout</code> event in its event delegation methods, <a href="/live/"><code>.live()</code></a> and <a href="/delegate/"><code>.delegate()</code></a>.</p> | ||
</longdesc> | ||
<note id="detach-shorthand" type="additional" data-event="blur"/> | ||
<example> | ||
<desc>To trigger the blur event on all paragraphs:</desc> | ||
<code><![CDATA[ | ||
$( "p" ).trigger( "blur" ); | ||
]]></code> | ||
</example> | ||
<category slug="events/form-events"/> | ||
<category slug="forms"/> | ||
<category slug="version/1.7"/> | ||
</entry> | ||
|
||
<entry type="method" name="trigger" return="jQuery"> | ||
<title>.trigger( "blur" )</title> | ||
<signature> | ||
<added>1.7</added> | ||
<argument name=""blur"" type="string"> | ||
<desc>The string <code>"blur"</code>.</desc> | ||
</argument> | ||
</signature> | ||
<longdesc> | ||
<p>See the description for <a href="#on1"><code>.on( "blur", ... )</code></a>.</p> | ||
</longdesc> | ||
<category slug="events/form-events"/> | ||
<category slug="forms"/> | ||
<category slug="version/1.7"/> | ||
</entry> | ||
|
||
<entry type="method" name="blur" return="jQuery" deprecated="3.3"> | ||
<title>.blur()</title> | ||
<signature> | ||
<added>1.0</added> | ||
<argument name="handler" type="Function"> | ||
<desc>A function to execute each time the event is triggered.</desc> | ||
<argument name="eventObject" type="Event" /> | ||
</argument> | ||
</signature> | ||
<signature> | ||
<added>1.4.3</added> | ||
<argument name="eventData" type="Anything" optional="true"> | ||
<desc>An object containing data that will be passed to the event handler.</desc> | ||
</argument> | ||
<argument name="handler" type="Function"> | ||
<desc>A function to execute each time the event is triggered.</desc> | ||
<argument name="eventObject" type="Event" /> | ||
</argument> | ||
</signature> | ||
<signature> | ||
<added>1.0</added> | ||
</signature> | ||
<longdesc> | ||
<div class="warning"> | ||
<p>This API is deprecated.</p> | ||
<p>Instead of <code>.blur( handler )</code> or <code>.blur( eventData, handler )</code>, use <a href="#on1"><code>.on( "blur", handler )</code></a> or <a href="#on1"><code>.on( "blur", eventData, handler )</code></a>, respectively.</p> | ||
<p>Instead of <code>.blur()</code>, use <a href="#trigger2"><code>.trigger( "blur" )</code></a>.</p> | ||
</div> | ||
</longdesc> | ||
<category slug="events/form-events"/> | ||
<category slug="forms"/> | ||
<category slug="version/1.0"/> | ||
<category slug="version/1.4.3"/> | ||
<category slug="deprecated/deprecated-3.3"/> | ||
</entry> | ||
</entries> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.