Skip to content

Commit f606cec

Browse files
committed
Added note about support for SVG documents
Fixes jquerygh-884 Closes jquerygh-896
1 parent 28a7fe6 commit f606cec

11 files changed

+14
-1
lines changed

entries/append.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</signature>
3434
<desc>Insert content, specified by the parameter, to the end of each element in the set of matched elements.</desc>
3535
<longdesc>
36-
<p>The <code>.append()</code> method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the <em>first</em> child, use <a href="/prepend/"><code>.prepend()</code></a>). </p>
36+
<p>The <code>.append()</code> method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the <em>first</em> child, use <a href="/prepend/"><code>.prepend()</code></a>).</p>
3737
<p>The <code>.append()</code> and <code><a href="/appendTo/">.appendTo()</a></code> methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target. With <code>.append()</code>, the selector expression preceding the method is the container into which the content is inserted. With <code>.appendTo()</code>, on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.</p>
3838
<p>Consider the following HTML:</p>
3939
<pre><code>
@@ -87,6 +87,7 @@ $( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );
8787
<p>Since <code>.append()</code> can accept any number of additional arguments, the same result can be achieved by passing in the three <code>&lt;div&gt;</code>s as three separate arguments, like so: <code>$('body').append( $newdiv1, newdiv2, existingdiv1 )</code>. The type and number of arguments will largely depend on how you collect the elements in your code.</p>
8888
</longdesc>
8989
<note id="html-code-execution" type="additional"/>
90+
<note id="svg-support" type="additional"/>
9091
<example>
9192
<desc>Appends some HTML to all paragraphs.</desc>
9293
<code><![CDATA[

entries/appendTo.xml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ $( "h2" ).appendTo( $( ".container" ) );
5757
<p><strong>Before jQuery 1.9,</strong> the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the <code>.end()</code> method reliably when being used with an unknown number of elements.</p>
5858
</longdesc>
5959
<note id="html-code-execution" type="additional"/>
60+
<note id="svg-support" type="additional"/>
6061
<example>
6162
<desc>Append all spans to the element with the ID "foo" (Check append() documentation for more examples)</desc>
6263
<code><![CDATA[

entries/attr.xml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<p><strong>Note:</strong> Attribute values are strings with the exception of a few attributes such as value and tabindex.</p>
2222
</div>
2323
<p>As of jQuery 1.6, the <code>.attr()</code> method returns <code>undefined</code> for attributes that have not been set. <strong>To retrieve and change DOM properties such as the <code>checked</code>, <code>selected</code>, or <code>disabled</code> state of form elements, use the <a href="/prop/">.prop()</a> method.</strong></p>
24+
<note id="svg-support" type="additional"/>
2425

2526
<h4>Attributes vs. Properties</h4>
2627
<p>The difference between <em>attributes</em> and <em>properties</em> can be important in specific situations. <strong>Before jQuery 1.6</strong>, the <code>.attr()</code> method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. <strong>As of jQuery 1.6</strong>, the <code>.prop()</code> method provides a way to explicitly retrieve property values, while <code>.attr()</code> retrieves attributes.</p>

entries/filter.xml

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ $( "li" )
7676
.css( "background-color", "red" );
7777
</code></pre>
7878
<p>This alteration to the code will cause the third and sixth list items to be highlighted, as it uses the modulus operator (<code>%</code>) to select every item with an <code>index</code> value that, when divided by 3, has a remainder of <code>2</code>.</p>
79+
<note id="svg-support" type="additional"/>
7980
</longdesc>
8081
<example>
8182
<desc>Change the color of all divs; then add a border to those with a "middle" class.</desc>

entries/find.xml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ var item1 = $( "li.item-1" )[ 0 ];
6363
$( "li.item-ii" ).find( item1 ).css( "background-color", "red" );
6464
</code></pre>
6565
<p>The result of this call would be a red background on item 1.</p>
66+
<note id="svg-support" type="additional"/>
6667
</longdesc>
6768
<example>
6869
<desc>Starts with all paragraphs and searches for descendant span elements, same as <code>$( "p span" )</code></desc>

entries/insertAfter.xml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ $( "h2" ).insertAfter( $( ".container" ) );
5353
<p><strong>Before jQuery 1.9,</strong> the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the <code>.end()</code> method reliably when being used with an unknown number of elements.</p>
5454
</longdesc>
5555
<note id="html-code-execution" type="additional"/>
56+
<note id="svg-support" type="additional"/>
5657
<example>
5758
<desc>Insert all paragraphs after an element with id of "foo". Same as $( "#foo" ).after( "p" )</desc>
5859
<code><![CDATA[

entries/insertBefore.xml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ $( "h2" ).insertBefore( $( ".container" ) );
5353
<p><strong>Before jQuery 1.9,</strong> the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the <code>.end()</code> method reliably when being used with an unknown number of elements.</p>
5454
</longdesc>
5555
<note id="html-code-execution" type="additional"/>
56+
<note id="svg-support" type="additional"/>
5657
<example>
5758
<desc>Insert all paragraphs before an element with id of "foo". Same as $( "#foo" ).before( "p" )</desc>
5859
<code><![CDATA[

entries/prepend.xml

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ $( "body" ).prepend( $newdiv1, [ newdiv2, existingdiv1 ] );
8787
<p>Since <code>.prepend()</code> can accept any number of additional arguments, the same result can be achieved by passing in the three <code>&lt;div&gt;</code>s as three separate arguments, like so: <code>$( "body" ).prepend( $newdiv1, newdiv2, existingdiv1 )</code>. The type and number of arguments will largely depend on how you collect the elements in your code.</p>
8888
</longdesc>
8989
<note id="html-code-execution" type="additional"/>
90+
<note id="svg-support" type="additional"/>
9091
<example>
9192
<desc>Prepends some HTML to all paragraphs.</desc>
9293
<code><![CDATA[

entries/prependTo.xml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ $( "h2" ).prependTo( $( ".container" ) );
5656
<p>If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last.</p>
5757
</longdesc>
5858
<note id="html-code-execution" type="additional"/>
59+
<note id="svg-support" type="additional"/>
5960
<example>
6061
<desc>Prepend all spans to the element with the ID "foo" (Check .prepend() documentation for more examples)</desc>
6162
<css><![CDATA[

entries/removeAttr.xml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
$element.prop( "onclick", null );
1616
console.log( "onclick property: ", $element[ 0 ].onclick );
1717
</code></pre>
18+
<note id="svg-support" type="additional"/>
1819
</longdesc>
1920
<example>
2021
<desc>Clicking the button changes the title of the input next to it. Move the mouse pointer over the text input to see the effect of adding and removing the title attribute.</desc>

notes.xsl

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
<xsl:when test="@id = 'global-ajax-event'">
7171
As of jQuery 1.9, all the handlers for the <a href="/category/ajax/global-ajax-event-handlers/">jQuery global Ajax events</a>, including those added with the <code><xsl:value-of select="@data-title"/></code> method, <em>must</em> be attached to <code>document</code>.
7272
</xsl:when>
73+
<xsl:when test="@id = 'svg-support'">
74+
jQuery doesn't officially support SVG. Using jQuery methods on SVG documents, unless explicitly documented for that method, might cause unexpected behaviors. Examples of methods that support SVG as of jQuery 3.0 are <code>addClass</code> and <code>removeClass</code>.
75+
</xsl:when>
7376
</xsl:choose>
7477
</xsl:template>
7578
</xsl:stylesheet>

0 commit comments

Comments
 (0)