Skip to content

Commit 82ebb27

Browse files
committed
before(): Document new callback signature
Since jQuery version 1.10, `$.fn.before` invokes the supplied function with two arguments: the numeric index of each element in the set and the string markup describing each element's contents. Remove the second argument from the documentation of the pre-1.10 signature and add a new entry to thoroughly document the post-1.10 signature.
1 parent 76e8402 commit 82ebb27

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

entries/before.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<added>1.4</added>
2323
<argument name="function" type="Function">
2424
<argument name="index" type="Integer" />
25-
<argument name="html" type="String" />
2625
<return>
2726
<type name="htmlString"/>
2827
<type name="Element"/>
@@ -31,6 +30,20 @@
3130
<desc>A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, <code>this</code> refers to the current element in the set.
3231
</desc>
3332
</argument>
33+
</signature>
34+
<signature>
35+
<added>1.10</added>
36+
<argument name="function" type="Function">
37+
<argument name="index" type="Integer" />
38+
<argument name="html" type="String" />
39+
<return>
40+
<type name="htmlString"/>
41+
<type name="Element"/>
42+
<type name="jQuery"/>
43+
</return>
44+
<desc>A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, <code>this</code> refers to the current element in the set.
45+
</desc>
46+
</argument>
3447
</signature>
3548
<desc>Insert content, specified by the parameter, before each element in the set of matched elements.</desc>
3649
<longdesc>

0 commit comments

Comments
 (0)