Skip to content

Commit 4f0a6f3

Browse files
AurelioDeRosaarthurvr
authored andcommitted
jQuery.data: correct info on .data( "name", undefined )
Fixes gh-586 Closes gh-673
1 parent 85581c0 commit 4f0a6f3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

entries/jQuery.data.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jQuery.data( document.body, "bar", "test" );
2525
</code></pre>
2626
</longdesc>
2727
<note id="no-data-on-xml" type="additional"/>
28-
<note id="data-doesnt-accept-undefined" type="additional" data-title="jQuery.data" data-parameters="el, &quot;name&quot;"/>
28+
<note id="jquery-data-doesnt-accept-undefined" type="additional" data-title="jQuery.data" data-parameters="el, &quot;name&quot;"/>
2929
<example>
3030
<desc>Store then retrieve a value from the div element.</desc>
3131
<code><![CDATA[

notes.xsl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<xsl:template name="note">
33
<xsl:choose>
44
<xsl:when test="@id = 'data-doesnt-accept-undefined'">
5-
<code>undefined</code> is not recognised as a data value. Calls such as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" />, undefined )</code> will return the corresponding data for "name", and is therefore the same as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" /> )</code>.
5+
<code>undefined</code> is not recognized as a data value. Calls such as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" />, undefined )</code> will return the jQuery object that it was called on, allowing for chaining.
6+
</xsl:when>
7+
<xsl:when test="@id = 'jquery-data-doesnt-accept-undefined'">
8+
<code>undefined</code> is not recognized as a data value. Calls such as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" />, undefined )</code> will return the corresponding data for "name", and is therefore the same as <code><xsl:value-of select="@data-title" />( <xsl:value-of select="@data-parameters" /> )</code>.
69
</xsl:when>
710
<xsl:when test="@id = 'dimensions-number'">
811
The number returned by dimensions-related APIs, including <code><xsl:value-of select="@data-title"/></code>, may be fractional in some cases. Code should not assume it is an integer. Also, dimensions may be incorrect when the page is zoomed by the user; browsers do not expose an API to detect this condition.

0 commit comments

Comments
 (0)