Possible Duplicate:
What does jQuery.fn mean?
Part of the jQuery source code states:
jQuery.fn = jQuery.prototype = {
Given this, wouldn't
$.fn.adamPlugin = function(options) {
return this.each(function() { });
};
Be identical to
$.prototype.adamPlugin = function(options) {
return this.each(function() { });
};
If so, what's the point of $.fn
? Adding things to a prototype is fairly common in JavaScript, so I can't quite understand why the jQuery folks would try to abstract this away.