Skip to content

Commit 7fe064d

Browse files
committed
Added a standards divergence warning to blur.xml
Returning false in jQuery event handlers stops the propagation of the event, while returning false in native event listeners only prevents the default.
1 parent 22e00d3 commit 7fe064d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

entries/blur.xml

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ $( "#other" ).click(function() {
5151
</code></pre>
5252
<p>After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message.</p>
5353
<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>
54+
<div class="warning"><strong>Note:</strong> the consequences of returning <code>false</code> from an event handler in jQuery differ from returning <code>false</code> in a native event handler (<code>element.addEventListener("click", function () { return false; })</code>) in that jQuery calls <code>event.preventDefault()</code> and <code>event.stopPropagation()</code> and a native event handler only calls <code>event.preventDefault()</code>.</div>
5455
</longdesc>
5556
<example>
5657
<desc>To trigger the blur event on all paragraphs:</desc>

0 commit comments

Comments
 (0)