Skip to content

Commit 1df2c5f

Browse files
tjvantollscottgonzalez
authored andcommitted
jQuery.widget: Remove extraneous spaces in :data selectors
Spaces within :data selectors are significant, and the ones used in these docs were causing the examples to not find the correct elements. Closes gh-285
1 parent 2cf3d53 commit 1df2c5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

entries/jQuery.widget.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,21 @@
124124
<p>The instance is stored using <a href="//api.jquery.com/jQuery.data/"><code>jQuery.data()</code></a> with the widget's full name as the key. Therefore, the <a href="/data-selector/"><code>:data</code></a> selector can also determine whether an element has a given widget bound to it.</p>
125125

126126
<pre><code>
127-
$( "#elem" ).is( ":data( 'ui-progressbar' )" ); // true
128-
$( "#elem" ).is( ":data( 'ui-draggable' )" ); // false
127+
$( "#elem" ).is( ":data('ui-progressbar')" ); // true
128+
$( "#elem" ).is( ":data('ui-draggable')" ); // false
129129
</code></pre>
130130

131131
<p>Unlike <code>instance()</code>, <code>:data</code> can be used even if the widget being tested for has not loaded.</p>
132132

133133
<pre><code>
134134
$( "#elem" ).nonExistentWidget( "instance" ); // TypeError
135-
$( "#elem" ).is( ":data( 'ui-nonExistentWidget' )" ); // false
135+
$( "#elem" ).is( ":data('ui-nonExistentWidget')" ); // false
136136
</code></pre>
137137

138138
<p>You can also use <code>:data</code> to get a list of all elements that are instances of a given widget.</p>
139139

140140
<pre><code>
141-
$( ":data( 'ui-progressbar' )" );
141+
$( ":data('ui-progressbar')" );
142142
</code></pre>
143143

144144
<h3>Properties</h3>

0 commit comments

Comments
 (0)