JQuery. fn explanation
The learning of jQuery is not very difficult, and the difference between jQuery. fn. extend (object) and jQuery. extend (object) is different.
The following is a detailed explanation:
JQuery. extend (object); adds a new static method for the class to extend the jQuery class itself;
JQuery. fn. extend (object); add a method to the jQuery object;
Eg:
$. Extend ({
Add: function (a, B) {return a + B ;}
});
Add a "static method" for jQuery as add, and then you can use this method in the place where jQuery is introduced,
$. Add (3, 4); // return 7
JQuery. fn = jQuery. prototype is equivalent to adding attributes to the jQuery class, that is, adding "member functions" to the jQuery class ". JQuery class instances can use this "member function ".
$. Fn. close = function (){}
$. Close = function (){}
The most obvious difference is when calling:
$ ('# Test'). close () and $. close ();