File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -187,11 +187,13 @@ Here's an example of a small plugin using some of the techniques we've discussed
187
187
188
188
$.fn.showLinkLocation = function() {
189
189
190
- return this.filter( "a" ).each(function() {
190
+ this.filter( "a" ).each(function() {
191
191
var link = $( this );
192
192
link.append( " (" + link.attr( "href" ) + ")" );
193
193
});
194
194
195
+ return this;
196
+
195
197
};
196
198
197
199
}( jQuery ));
@@ -217,10 +219,12 @@ Our plugin can be optimized though:
217
219
218
220
$.fn.showLinkLocation = function() {
219
221
220
- return this.filter( "a" ).append(function() {
222
+ this.filter( "a" ).append(function() {
221
223
return " (" + this.href + ")";
222
224
});
223
225
226
+ return this;
227
+
224
228
};
225
229
226
230
}( jQuery ));
You can’t perform that action at this time.
0 commit comments