The following is their own understanding, welcome to learn from the small partners to correct, thank you thank you
1.jquery.fn.extend (object): Commonly used to make plugins
Official explanation: A jquery plugin is simply a new method, which we use to extend JQuery ' s prototype object. (A new simple jquery plugin that we used to extend the jquery prototype object)
As soon as you see the extended prototype object, it's clear that you're adding a method to the jquery prototype, and the resulting jquery instance can be used in this way through the rules of the prototype chain.
<Script> $(function() {$.fn.extend ({min:function(A, b) {returna<b?a:b; }, Max:function(A, b) {returna>b?a:b; } }); Console.log ($.min (1, 2)); //Error: $.min is not a functionConsole.log ($ ("P"). Min (1, 2)); //1 }); </Script>
2.jquery.extend (object)
Official explanation: Extend the jquery object itself. Used to add new functions to the jquery namespace.
Extension object itself, then the instance is not found for these methods
<Script> $(function() {$.extend ({min:function(A, b) {returna<b?a:b; }, Max:function(A, b) {returna>b?a:b; } }); Console.log ($.min (1, 2)); //1Console.log ($ ("P"). Min (1, 2)); //Error: $ (...). Min is not a function });
3. Jquery.fn (object)
Why put in the last say, please draw on this small partner's share, thank this small partner, borrow your address,
Http://caibaojian.com/jquery-extend-and-jquery-fn-extend.html
Abstract: For reference to the above address, the original will poke that address
Jquery.fn = Jquery.prototype = {Init:function (selector, context) {//....//...};
So the extension of the method, to write in the extend inside, not to change the prototype, a big thing
Front-End Engineers-jquery-understand $.extend (), $.fn.extend (), $.fn,