Skip to content

Commit 21e1958

Browse files
authored
All: Fix event selectors
Multiple selectors erroneously used `selector)` instead of `selector`. This has been fixed. The typos were accidentally introduced during a mass-replace in gh-1223. Fixes gh-1228 Closes gh-1229 Ref gh-1223 Ref gh-1226 Ref gh-1227
1 parent a71164b commit 21e1958

37 files changed

+78
-78
lines changed

entries/ajaxComplete.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<argument name="&quot;ajaxComplete&quot;" type="string">
88
<desc>The string <code>"ajaxComplete"</code>.</desc>
99
</argument>
10-
<argument name="handler" type="Function">
10+
<argument name="handler" type="Function">
1111
<argument name="event" type="Event" />
1212
<argument name="jqXHR" type="jqXHR" />
1313
<argument name="ajaxOptions" type="PlainObject" />
@@ -33,7 +33,7 @@ $( document ).on( "ajaxComplete", function() {
3333
</code></pre>
3434
<p>Now, make an Ajax request using any jQuery method:</p>
3535
<pre><code>
36-
$( ".trigger)" ).on( "click", function() {
36+
$( ".trigger" ).on( "click", function() {
3737
$( ".result" ).load( "ajax/test.html" );
3838
} );
3939
</code></pre>

entries/ajaxSend.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $( document ).on( "ajaxSend", function() {
3333
</code></pre>
3434
<p>Now, make an Ajax request using any jQuery method:</p>
3535
<pre><code>
36-
$( ".trigger)" ).on( "click", function() {
36+
$( ".trigger" ).on( "click", function() {
3737
$( ".result" ).load( "ajax/test.html" );
3838
} );
3939
</code></pre>

entries/animate.xml

+11-11
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</code></pre>
4646
<p>To animate the opacity, left offset, and height of the image simultaneously:</p>
4747
<pre><code>
48-
$( "#clickme)" ).on( "click", function() {
48+
$( "#clickme" ).on( "click", function() {
4949
$( "#book" ).animate({
5050
opacity: 0.25,
5151
left: "+=50",
@@ -101,7 +101,7 @@ $( "li" ).animate({
101101
<p>As of jQuery version 1.4, you can set per-property easing functions within a single <code>.animate()</code> call. In the first version of <code>.animate()</code>, each property can take an array as its value: The first member of the array is the CSS property and the second member is an easing function. If a per-property easing function is not defined for a particular property, it uses the value of the <code>.animate()</code> method's optional easing argument. If the easing argument is not defined, the default <code>swing</code> function is used.</p>
102102
<p>For example, to simultaneously animate the width and height with the <code>swing</code> easing function and the opacity with the <code>linear</code> easing function:</p>
103103
<pre><code>
104-
$( "#clickme)" ).on( "click", function() {
104+
$( "#clickme" ).on( "click", function() {
105105
$( "#book" ).animate({
106106
width: [ "toggle", "swing" ],
107107
height: [ "toggle", "swing" ],
@@ -113,7 +113,7 @@ $( "#clickme)" ).on( "click", function() {
113113
</code></pre>
114114
<p>In the second version of <code>.animate()</code>, the options object can include the <code>specialEasing</code> property, which is itself an object of CSS properties and their corresponding easing functions. For example, to simultaneously animate the width using the <code>linear</code> easing function and the height using the <code>easeOutBounce</code> easing function:</p>
115115
<pre><code>
116-
$( "#clickme)" ).on( "click", function() {
116+
$( "#clickme" ).on( "click", function() {
117117
$( "#book" ).animate({
118118
width: "toggle",
119119
height: "toggle"
@@ -137,7 +137,7 @@ $( "#clickme)" ).on( "click", function() {
137137
<code><![CDATA[
138138
// Using multiple unit types within one animation.
139139
140-
$( "#go)" ).on( "click", function() {
140+
$( "#go" ).on( "click", function() {
141141
$( "#block" ).animate({
142142
width: "70%",
143143
opacity: 0.4,
@@ -162,11 +162,11 @@ $( "#go)" ).on( "click", function() {
162162
<example>
163163
<desc>Animates a div's left property with a relative value. Click several times on the buttons to see the relative animations queued up.</desc>
164164
<code><![CDATA[
165-
$( "#right)" ).on( "click", function() {
165+
$( "#right" ).on( "click", function() {
166166
$( ".block" ).animate({ "left": "+=50px" }, "slow" );
167167
});
168168
169-
$( "#left)" ).on( "click", function(){
169+
$( "#left" ).on( "click", function(){
170170
$( ".block" ).animate({ "left": "-=50px" }, "slow" );
171171
});
172172
]]></code>
@@ -191,7 +191,7 @@ $( "#left)" ).on( "click", function(){
191191

192192
The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.</desc>
193193
<code><![CDATA[
194-
$( "#go1)" ).on( "click", function() {
194+
$( "#go1" ).on( "click", function() {
195195
$( "#block1" )
196196
.animate({
197197
width: "90%"
@@ -203,18 +203,18 @@ $( "#go1)" ).on( "click", function() {
203203
.animate({ borderRightWidth: "15px" }, 1500 );
204204
});
205205
206-
$( "#go2)" ).on( "click", function() {
206+
$( "#go2" ).on( "click", function() {
207207
$( "#block2" )
208208
.animate({ width: "90%" }, 1000 )
209209
.animate({ fontSize: "24px" }, 1000 )
210210
.animate({ borderLeftWidth: "15px" }, 1000 );
211211
});
212212
213-
$( "#go3)" ).on( "click", function() {
213+
$( "#go3" ).on( "click", function() {
214214
$( "#go1" ).add( "#go2" ).trigger( "click" );
215215
});
216216
217-
$( "#go4)" ).on( "click", function() {
217+
$( "#go4" ).on( "click", function() {
218218
$( "div" ).css({
219219
width: "",
220220
fontSize: "",
@@ -248,7 +248,7 @@ $( "#go4)" ).on( "click", function() {
248248
<example>
249249
<desc>Animates the first div's left property and synchronizes the remaining divs, using the step function to set their left properties at each stage of the animation. </desc>
250250
<code><![CDATA[
251-
$( "#go)" ).on( "click", function() {
251+
$( "#go" ).on( "click", function() {
252252
$( ".block" ).first().animate({
253253
left: 100
254254
}, {

entries/animated-selector.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<example>
1414
<desc>Change the color of any div that is animated.</desc>
1515
<code><![CDATA[
16-
$( "#run)" ).on( "click", function() {
16+
$( "#run" ).on( "click", function() {
1717
$( "div:animated" ).toggleClass( "colored" );
1818
});
1919

entries/clearQueue.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<example>
1515
<desc>Empty the queue.</desc>
1616
<code><![CDATA[
17-
$( "#start)" ).on( "click", function() {
17+
$( "#start" ).on( "click", function() {
1818
var myDiv = $( "div" );
1919
myDiv.show( "slow" );
2020
myDiv.animate({
@@ -38,7 +38,7 @@ $( "#start)" ).on( "click", function() {
3838
myDiv.slideUp();
3939
});
4040
41-
$( "#stop)" ).on( "click", function() {
41+
$( "#stop" ).on( "click", function() {
4242
var myDiv = $( "div" );
4343
myDiv.clearQueue();
4444
myDiv.stop();

entries/css.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<example>
2929
<desc>Get the background color of a clicked div.</desc>
3030
<code><![CDATA[
31-
$( "div)" ).on( "click", function() {
31+
$( "div" ).on( "click", function() {
3232
var color = $( this ).css( "background-color" );
3333
$( "#result" ).html( "That div is <span style='color:" +
3434
color + ";'>" + color + "</span>." );
@@ -54,7 +54,7 @@ $( "div)" ).on( "click", function() {
5454
<example>
5555
<desc>Get the width, height, text color, and background color of a clicked div.</desc>
5656
<code><![CDATA[
57-
$( "div)" ).on( "click", function() {
57+
$( "div" ).on( "click", function() {
5858
var html = [ "The clicked div has the following styles:" ];
5959
6060
var styleProps = $( this ).css([

entries/detach.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<example>
1515
<desc>Detach all paragraphs from the DOM</desc>
1616
<code><![CDATA[
17-
$( "p)" ).on( "click", function() {
17+
$( "p" ).on( "click", function() {
1818
$( this ).toggleClass( "off" );
1919
});
2020
var p;

entries/each.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ $( document.body ).on( "click", function() {
7474
<example>
7575
<desc>To access a jQuery object instead of the regular DOM element, use <code>$( this )</code>. For example:</desc>
7676
<code><![CDATA[
77-
$( "span)" ).on( "click", function() {
77+
$( "span" ).on( "click", function() {
7878
$( "li" ).each(function() {
7979
$( this ).toggleClass( "example" );
8080
});

entries/fadeIn.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
&lt;img id="book" src="book.png" alt="" width="100" height="123"&gt;
3030

3131
// With the element initially hidden, we can show it slowly:
32-
$( "#clickme)" ).on( "click", function() {
32+
$( "#clickme" ).on( "click", function() {
3333
$( "#book" ).fadeIn( "slow", function() {
3434
// Animation complete
3535
});
@@ -88,7 +88,7 @@ $( document.body ).on( "click", function() {
8888
<example>
8989
<desc>Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top.</desc>
9090
<code><![CDATA[
91-
$( "a)" ).on( "click", function() {
91+
$( "a" ).on( "click", function() {
9292
$( "div" ).fadeIn( 3000, function() {
9393
$( "span" ).fadeIn( 100 );
9494
});

entries/fadeOut.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</code></pre>
3131
<p>With the element initially shown, we can hide it slowly:</p>
3232
<pre><code>
33-
$( "#clickme)" ).on( "click", function() {
33+
$( "#clickme" ).on( "click", function() {
3434
$( "#book" ).fadeOut( "slow", function() {
3535
// Animation complete.
3636
});
@@ -56,7 +56,7 @@ $( "#clickme)" ).on( "click", function() {
5656
<example>
5757
<desc>Animates all paragraphs to fade out, completing the animation within 600 milliseconds.</desc>
5858
<code><![CDATA[
59-
$( "p)" ).on( "click", function() {
59+
$( "p" ).on( "click", function() {
6060
$( "p" ).fadeOut( "slow" );
6161
});
6262
]]></code>
@@ -76,7 +76,7 @@ $( "p)" ).on( "click", function() {
7676
<example>
7777
<desc>Fades out spans in one section that you click on.</desc>
7878
<code><![CDATA[
79-
$( "span)" ).on( "click", function() {
79+
$( "span" ).on( "click", function() {
8080
$( this ).fadeOut( 1000, function() {
8181
$( "div" ).text( "'" + $( this ).text() + "' has faded!" );
8282
$( this ).remove();
@@ -113,15 +113,15 @@ $( "span" ).hover(function() {
113113
<example>
114114
<desc>Fades out two divs, one with a "linear" easing and one with the default, "swing," easing.</desc>
115115
<code><![CDATA[
116-
$( "#btn1)" ).on( "click", function() {
116+
$( "#btn1" ).on( "click", function() {
117117
function complete() {
118118
$( "<div>" ).text( this.id ).appendTo( "#log" );
119119
}
120120
$( "#box1" ).fadeOut( 1600, "linear", complete );
121121
$( "#box2" ).fadeOut( 1600, complete );
122122
});
123123
124-
$( "#btn2)" ).on( "click", function() {
124+
$( "#btn2" ).on( "click", function() {
125125
$( "div" ).show();
126126
$( "#log" ).empty();
127127
});

entries/fadeTo.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
&lt;/div&gt;
4545
&lt;img id="book" src="book.png" alt="" width="100" height="123"&gt;
4646
// With the element initially shown, we can dim it slowly:
47-
$( "#clickme)" ).on( "click", function() {
47+
$( "#clickme" ).on( "click", function() {
4848
$( "#book" ).fadeTo( "slow" , 0.5, function() {
4949
// Animation complete.
5050
});
@@ -80,7 +80,7 @@ Compare to this one that won't fade.
8080
<example>
8181
<desc>Fade div to a random opacity on each click, completing the animation within 200 milliseconds.</desc>
8282
<code><![CDATA[
83-
$( "div)" ).on( "click", function() {
83+
$( "div" ).on( "click", function() {
8484
$( this ).fadeTo( "fast", Math.random() );
8585
});
8686
]]></code>

entries/height.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ $( document ).height();
3434
function showHeight( element, height ) {
3535
$( "div" ).text( "The height for the " + element + " is " + height + "px." );
3636
}
37-
$( "#getp)" ).on( "click", function() {
37+
$( "#getp" ).on( "click", function() {
3838
showHeight( "paragraph", $( "p" ).height() );
3939
});
40-
$( "#getd)" ).on( "click", function() {
40+
$( "#getd" ).on( "click", function() {
4141
showHeight( "document", $( document ).height() );
4242
});
43-
$( "#getw)" ).on( "click", function() {
43+
$( "#getw" ).on( "click", function() {
4444
showHeight( "window", $( window ).height() );
4545
});
4646
]]></code>

entries/hide.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $( ".target" ).hide();
4949
</code></pre>
5050
<pre><code>
5151
// With the element initially shown, we can hide it slowly:
52-
$( "#clickme)" ).on( "click", function() {
52+
$( "#clickme" ).on( "click", function() {
5353
$( "#book" ).hide( "slow", function() {
5454
alert( "Animation complete." );
5555
});
@@ -101,13 +101,13 @@ $( "button" ).on( "click", function() {
101101
<example>
102102
<desc>Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.</desc>
103103
<code><![CDATA[
104-
$( "#hider)" ).on( "click", function() {
104+
$( "#hider" ).on( "click", function() {
105105
$( "span:last-child" ).hide( "fast", function() {
106106
// Use arguments.callee so we don't need a named function
107107
$( this ).prev().hide( "fast", arguments.callee );
108108
});
109109
});
110-
$( "#shower)" ).on( "click", function() {
110+
$( "#shower" ).on( "click", function() {
111111
$( "span" ).show( 2000 );
112112
});
113113
]]></code>
@@ -134,7 +134,7 @@ $( "#shower)" ).on( "click", function() {
134134
for ( var i = 0; i < 5; i++ ) {
135135
$( "<div>" ).appendTo( document.body );
136136
}
137-
$( "div)" ).on( "click", function() {
137+
$( "div" ).on( "click", function() {
138138
$( this ).hide( 2000, function() {
139139
$( this ).remove();
140140
});

entries/html.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $( "div.demo-container" ).html();
2929
<example>
3030
<desc>Click a paragraph to convert it from html to text.</desc>
3131
<code><![CDATA[
32-
$( "p)" ).on( "click", function() {
32+
$( "p" ).on( "click", function() {
3333
var htmlString = $( this ).html();
3434
$( this ).text( htmlString );
3535
});

entries/index.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ alert( "Index: " + $( "#bar" ).index() );
8181
<example>
8282
<desc>On click, returns the index (zero-based) of that div in the page.</desc>
8383
<code><![CDATA[
84-
$( "div)" ).on( "click", function() {
84+
$( "div" ).on( "click", function() {
8585
// `this` is the DOM element that was clicked
8686
var index = $( "div" ).index( this );
8787
$( "span" ).text( "That was div index #" + index );

entries/is.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<desc>A function used as a test for every element in the set. It accepts two arguments, <code>index</code>, which is the element's index in the jQuery collection, and <code>element</code>, which is the DOM element. Within the function, <code>this</code> refers to the current DOM element.</desc>
1414
<argument name="index" type="Integer" />
1515
<argument name="element" type="Element" />
16-
<return type="Boolean" />
16+
<return type="Boolean" />
1717
</argument>
1818
</signature>
1919
<signature>
@@ -63,7 +63,7 @@ $( "ul" ).on( "click", function( event ) {
6363
</code></pre>
6464
<p>You can attach a click handler to every <code>&lt;li&gt;</code> that evaluates the number of <code>&lt;strong&gt;</code> elements within the clicked <code>&lt;li&gt;</code> at that time like so:</p>
6565
<pre><code>
66-
$( "li)" ).on( "click", function() {
66+
$( "li" ).on( "click", function() {
6767
var li = $( this ),
6868
isWithTwo = li.is(function() {
6969
return $( "strong", this ).length === 2;
@@ -177,7 +177,7 @@ $( "div" ).text( "isFormParent = " + isFormParent );
177177
<desc>Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red.</desc>
178178
<code><![CDATA[
179179
var alt = $( "#browsers li:nth-child(2n)" ).css( "background", "#0ff" );
180-
$( "li)" ).on( "click", function() {
180+
$( "li" ).on( "click", function() {
181181
var li = $( this );
182182
if ( li.is( alt ) ) {
183183
li.slideUp();
@@ -204,7 +204,7 @@ $( "li)" ).on( "click", function() {
204204
<desc>An alternate way to achieve the above example using an element rather than a jQuery object. Checks against an existing collection of alternating list elements. Blue, alternating list elements slide up while others turn red.</desc>
205205
<code><![CDATA[
206206
var alt = $( "#browsers li:nth-child(2n)" ).css( "background", "#0ff" );
207-
$( "li)" ).on( "click", function() {
207+
$( "li" ).on( "click", function() {
208208
if ( alt.is( this ) ) {
209209
$( this ).slideUp();
210210
} else {

entries/jQuery.fx.interval.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<desc>Cause all animations to run with less frames.</desc>
1515
<code><![CDATA[
1616
jQuery.fx.interval = 100;
17-
$( "input)" ).on( "click", function() {
17+
$( "input" ).on( "click", function() {
1818
$( "div" ).toggle( 3000 );
1919
});
2020
]]></code>

entries/jQuery.fx.off.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var toggleFx = function() {
2121
};
2222
toggleFx();
2323
$( "button" ).on( "click", toggleFx );
24-
$( "input)" ).on( "click", function() {
24+
$( "input" ).on( "click", function() {
2525
$( "div" ).toggle( "slow" );
2626
} );
2727
]]></code>

entries/jQuery.getScript.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ $.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
9494
<code><![CDATA[
9595
var url = "https://code.jquery.com/color/jquery.color-2.1.2.js";
9696
$.getScript( url, function() {
97-
$( "#go)" ).on( "click", function() {
97+
$( "#go" ).on( "click", function() {
9898
$( ".block" )
9999
.animate({
100100
backgroundColor: "rgb(255, 180, 180)"

0 commit comments

Comments
 (0)