Can someone tell me about the benefits of adding a jQuery plugin?

What are the benefits? This seems like a tricky way to do things, so why not just take a simple approach to creating such a plugin as described in jQuery Plugins :

Please see here: http://jsfiddle.net/e2aYH/11/

Compared with..

jQuery.fn.placeKitten = function( options ) { // default settings: var defaults = { ... }; var settings = $.extend( {}, defaults, options ); return this.each(function() { // Plugin code to produce kitten image would go here... }); }; 

The author of this work also continued to argue that in any case, he would not have bothered with the jQuery plugin, and they should never be used, but instead make your code โ€œmodularโ€. What would it mean if not through the jQuery plugin? and if it means not using jQuery at all, I see a lot of advantages and effectiveness when using jQuery, so I also donโ€™t understand this point.

+1
javascript jquery jquery-plugins design-patterns
Sep 05 '13 at 2:35
source share

No one has answered this question yet.

See similar questions:

58
JQuery plugin template - best practice, convention, performance and memory impact

or similar:

738
How to make an AJAX call without jQuery?
282
Managing jQuery plugin dependency in webpack
141
AngularJS directive with default options
3
JQuery plugin options: extension to or inside of this. block?
2
Sub options for jquery plugin
one
Custom jQuery plugin with methods and parameters
0
Correct place to define parameters in jquery plugin
0
Extend jQuery Plugin
0
jQuery pluggins, data () and namespace
0
JQuery plugin tasks



All Articles