Skip to content

Commit a6eecc2

Browse files
committed
jQuery.hasData: Clarified when it returns false
Fixes jquerygh-889 Closes jquerygh-891
1 parent 6142f86 commit a6eecc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/jQuery.hasData.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</signature>
1010
<desc>Determine whether an element has any jQuery data associated with it.</desc>
1111
<longdesc>
12-
<p>The <code>jQuery.hasData()</code> method provides a way to determine if an element currently has any values that were set using <code><a href="/jQuery.data/">jQuery.data()</a></code>. If no data is associated with an element (there is no data object at all or the data object is empty), the method returns <code>false</code>; otherwise it returns <code>true</code>.</p>
12+
<p>The <code>jQuery.hasData()</code> method provides a way to determine if an element currently has any values that were set using <code><a href="/jQuery.data/">jQuery.data()</a></code>. If there is no data object associated with an element, the method returns <code>false</code>; otherwise it returns <code>true</code>.</p>
1313
<p>The primary advantage of <code>jQuery.hasData(element)</code> is that it does not create and associate a data object with the element if none currently exists. In contrast, <code>jQuery.data(element)</code> always returns a data object to the caller, creating one if no data object previously existed.
1414
</p>
1515
<p>Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using <code>.on()</code>, <code>.bind()</code>, <code>.live()</code>, <code>.delegate()</code>, or one of the shorthand event methods also associates a data object with that element.

0 commit comments

Comments
 (0)