jquery plug-in development is divided into two types:
Class 1 level
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);
Page, call:
2 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);
Page, call:
3. Expansion
$.xy = {Add:function (A, b) {return a+b,}, Minus:function (A, B) {return-A-B;}, Voidmethod:function () {alert ("void");}}; var i = $.xy.add (3,2); var m = $.xy.minus (3,2); $.xy.voidmethod ();
JavaScript notes--jquery plug-in development of several ways