Differences between b / w plugin based on name and plugin based on function

since I was just starting to develop plugins in jquery, I am curious to know the difference between a plugin based on a name and a plugin based on a function and which is better suited for developing a plugin

+3
source share
1 answer

based on a name, also called a method plugin and a function based plugin, also called a plugin function

  • Method plugins should always return a jQuery object (this, in code), to ensure chaining.
  • Functional plugins do not support chaining; method plugins support chaining.
  • Method plugins should always return a jQuery object (this, in code), to ensure chaining.
  • Method plugins extend the jQuery.fn object, function plugins directly extend the jQuery object.
+1
source

All Articles