Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions page/plugins/basic-plugin-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ Here's an example of a small plugin using some of the techniques we've discussed

$.fn.showLinkLocation = function() {

return this.filter( "a" ).each(function() {
this.filter( "a" ).each(function() {
$( this ).append( " (" + $( this ).attr( "href" ) + ")" );
});

return this;

};

Expand All @@ -216,9 +218,11 @@ Our plugin can be optimized though:

$.fn.showLinkLocation = function() {

return this.filter( "a" ).append(function() {
this.filter( "a" ).append(function() {
return " (" + this.href + ")";
});

return this;

};

Expand Down