First, class level ($.extend)
Class level you can understand that to expand the jquery class, the most obvious example is $.ajax (...), which is equivalent to a static method.
The $.extend method is used when developing its methods, i.e. jquery.extend (object);
Second, the object level
The object level can be understood as an object-based extension, such as $ ("#table"). ChangeColor (...); Here this ChangeColor, is based on the expansion of the object.
The $.fn.extend method is used when developing its methods, i.e. jQuery.fn.extend (object);
Third, jquery plug-in development process
1, define the scope: to define a private scope for the plug-in, external code can not directly access the code inside the plug-in, plug-in internal code does not pollute the global variables,
2. Extend a plugin for jquery: Add a spread method to the instance of jquery. The spread method can receive some parameters.
3, set default value: Set default value for extension method, the default Property object is generally defined as defaults. Use $.extend (defaults,options) to merge the default values with the passed-in parameters
4, support for jquery connection call: Loop to return each element.
5, plug-in method: In order to make the code structure visualization, need to use function. The method in the plugin cannot be called by the outside world.
6. Custom callback function: Use call and apply method to execute callback function,
Writing jquery Plugins