Skip to content

Commit 1cdfd83

Browse files
authored
jQuery.globalEval: Document the document parameter
Since jQuery 3.5.0, jQuery.globalEval accepts an optional third parameter accepting a document in which context the code will be evaluated. This commit also adds the Document type and links it to one of the jQuery signatures; so far it was using `type="document"` which linked to a non-existent types section. Closes gh-1168 Ref jquery/jquery#4601
1 parent cd40fa3 commit 1cdfd83

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

entries/jQuery.globalEval.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
</property>
1919
</argument>
2020
</signature>
21+
<signature>
22+
<added>3.5.0</added>
23+
<argument name="code" type="String">
24+
<desc>The JavaScript code to execute.</desc>
25+
</argument>
26+
<argument name="options" type="PlainObject" optional="true">
27+
<property name="nonce" type="string">
28+
<desc>The nonce attribute passed to the executed script.</desc>
29+
</property>
30+
</argument>
31+
<argument name="doc" type="Document" optional="true">
32+
<desc>A document in which context the code will be evaluated.</desc>
33+
</argument>
34+
</signature>
2135
<desc>Execute some JavaScript code globally.</desc>
2236
<longdesc>
2337
<p>This method behaves differently from using a normal JavaScript <code>eval()</code> in that it's executed within the global context (which is important for loading external scripts dynamically).</p>

entries/jQuery.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ $( myForm.elements ).hide();
155155
<argument name="html" type="htmlString">
156156
<desc>A string of HTML to create on the fly. Note that this parses HTML, <strong>not</strong> XML.</desc>
157157
</argument>
158-
<argument name="ownerDocument" optional="true" type="document">
158+
<argument name="ownerDocument" optional="true" type="Document">
159159
<desc>A document in which the new elements will be created.</desc>
160160
</argument>
161161
</signature>

pages/Types.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ <h2 id="Promise"> Promise Object</h2>
663663
</p>
664664
<h2 id="Callbacks">Callbacks Object</h2>
665665
<p>A multi-purpose object that provides a powerful way to manage callback lists. It supports adding, removing, firing, and disabling callbacks. The Callbacks object is created and returned by the <code>$.Callbacks</code> function and subsequently returned by most of that function's methods. </p>
666+
<h2 id="Document">Document</h2>
667+
<p>A document object created by the browser's DOM parser, usually from a string representing HTML or XML.</p>
666668
<h2 id="XMLDocument">XML Document</h2>
667669
<p>A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.</p>
668670
<h2 id="Assert">Assert</h2>

0 commit comments

Comments
 (0)