Skip to content

Commit f585006

Browse files
pobockskswedberg
authored andcommitted
fixes #149 - Warns not to feed jQuery [DOM, DOM, $(JQ_OBJ)]
1 parent de14d0a commit f585006

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

entries/jQuery.xml

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
<argument name="element" type="Element">
1818
<desc>A DOM element to wrap in a jQuery object.</desc>
1919
</argument>
20-
</signature>
20+
</signature>
2121
<signature>
2222
<added>1.0</added>
23-
<argument name="object" type="PlainObject">
24-
<desc>A plain object to wrap in a jQuery object.</desc>
23+
<argument name="elementArray" type="Array">
24+
<desc>An array containing a set of DOM elements to wrap in a jQuery object.</desc>
2525
</argument>
2626
</signature>
2727
<signature>
2828
<added>1.0</added>
29-
<argument name="elementArray" type="Array">
30-
<desc>An array containing a set of DOM elements to wrap in a jQuery object.</desc>
29+
<argument name="object" type="PlainObject">
30+
<desc>A plain object to wrap in a jQuery object.</desc>
3131
</argument>
3232
</signature>
3333
<signature>
@@ -54,7 +54,9 @@ $('div.foo').click(function() {
5454
<p>When the search for the span selector is restricted to the context of <code>this</code>, only spans within the clicked element will get the additional class.</p>
5555
<p>Internally, selector context is implemented with the <code>.find()</code> method, so <code>$('span', this)</code> is equivalent to <code>$(this).find('span')</code>.</p>
5656
<h4 id="using-dom-elements">Using DOM elements</h4>
57-
<p>The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way. A common use of this facility is to call jQuery methods on an element that has been passed to a callback function through the keyword <code>this</code>:</p>
57+
<p>The second and third formulations of this function create a jQuery object using one or more DOM elements that were already selected in some other way.</p>
58+
<p><strong>Note:</strong>These formulations are meant to consume only DOM elements; feeding mixed data to the elementArray form is particularly discouraged.</p>
59+
<p>A common use of this facility is to call jQuery methods on an element that has been passed to a callback function through the keyword <code>this</code>:</p>
5860
<pre><code>
5961
$('div.foo').click(function() {
6062
$(this).slideUp();

0 commit comments

Comments
 (0)